diff --git a/src/as/com/threerings/crowd/chat/client/ChatDirector.as b/src/as/com/threerings/crowd/chat/client/ChatDirector.as index 14590ca9e..65f1becd9 100644 --- a/src/as/com/threerings/crowd/chat/client/ChatDirector.as +++ b/src/as/com/threerings/crowd/chat/client/ChatDirector.as @@ -186,6 +186,33 @@ public class ChatDirector extends BasicDirector return _chatters; } + /** + * Adds a chatter to our list of recent chatters. This is normally done + * automatically by the ChatDirector, but may be called to also to + * forcibly add a chatter. The ChatterValidator will have to approve + * of the chatter. + */ + public function addChatter (name :Name) :void + { + // check to see if the chatter validator approves.. + if ((_chatterValidator != null) && + (!_chatterValidator.isChatterValid(name))) { + return; + } + + var wasThere :Boolean = ArrayUtil.removeAll(_chatters, name); + _chatters.unshift(name); + + if (!wasThere) { + if (_chatters.length > MAX_CHATTERS) { + _chatters.length = MAX_CHATTERS; // truncate array + } + + // we only notify on a change to the contents, not just reordering + notifyChatterObservers(); + } + } + /** * Registers a chat command handler. * @@ -896,30 +923,6 @@ public class ChatDirector extends BasicDirector return _history; } - /** - * Adds a chatter to our list of recent chatters. - */ - protected function addChatter (name :Name) :void - { - // check to see if the chatter validator approves.. - if ((_chatterValidator != null) && - (!_chatterValidator.isChatterValid(name))) { - return; - } - - var wasThere :Boolean = ArrayUtil.removeAll(_chatters, name); - _chatters.unshift(name); - - if (!wasThere) { - if (_chatters.length > MAX_CHATTERS) { - _chatters.length = MAX_CHATTERS; // truncate array - } - - // we only notify on a change to the contents, not just reordering - notifyChatterObservers(); - } - } - /** * Notifies all registered {@link ChatterObserver}s that the list of * chatters has changed.