Leave some backwards compatibility leniency in here, since it appears there's code out there that instantiates SpeakHandlers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6309 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -63,6 +63,19 @@ public class SpeakHandler
|
|||||||
* @param validator an optional validator that can be used to prevent arbitrary users from
|
* @param validator an optional validator that can be used to prevent arbitrary users from
|
||||||
* using the speech services on this object.
|
* using the speech services on this object.
|
||||||
*/
|
*/
|
||||||
|
public SpeakHandler (DObject speakObj, SpeakerValidator validator)
|
||||||
|
{
|
||||||
|
this(null, speakObj, validator);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a handler that will provide speech on the supplied distributed object.
|
||||||
|
*
|
||||||
|
* @param locator the object we use to look up BodyObjects from ClientObjects
|
||||||
|
* @param speakObj the object for which speech requests will be processed.
|
||||||
|
* @param validator an optional validator that can be used to prevent arbitrary users from
|
||||||
|
* using the speech services on this object.
|
||||||
|
*/
|
||||||
public SpeakHandler (BodyLocator locator, DObject speakObj, SpeakerValidator validator)
|
public SpeakHandler (BodyLocator locator, DObject speakObj, SpeakerValidator validator)
|
||||||
{
|
{
|
||||||
_locator = locator;
|
_locator = locator;
|
||||||
@@ -74,7 +87,9 @@ public class SpeakHandler
|
|||||||
public void speak (ClientObject caller, String message, byte mode)
|
public void speak (ClientObject caller, String message, byte mode)
|
||||||
{
|
{
|
||||||
// ensure that the caller has normal chat privileges
|
// ensure that the caller has normal chat privileges
|
||||||
BodyObject source = _locator.forClient(caller);
|
BodyObject source = (_locator != null) ? _locator.forClient(caller) :
|
||||||
|
(BodyObject) caller;
|
||||||
|
|
||||||
String errmsg = caller.checkAccess(ChatCodes.CHAT_ACCESS, null);
|
String errmsg = caller.checkAccess(ChatCodes.CHAT_ACCESS, null);
|
||||||
if (errmsg != null) {
|
if (errmsg != null) {
|
||||||
// we normally don't listen for responses to speak messages so we can't just throw an
|
// we normally don't listen for responses to speak messages so we can't just throw an
|
||||||
|
|||||||
Reference in New Issue
Block a user