diff --git a/src/java/com/threerings/crowd/chat/client/ChatDirector.java b/src/java/com/threerings/crowd/chat/client/ChatDirector.java
index 9007de21b..1c80d2c39 100644
--- a/src/java/com/threerings/crowd/chat/client/ChatDirector.java
+++ b/src/java/com/threerings/crowd/chat/client/ChatDirector.java
@@ -169,8 +169,18 @@ public class ChatDirector extends BasicDirector
}
/**
- * Adds the supplied chat display to the chat display list. It will
- * subsequently be notified of incoming chat messages as well as tell
+ * Adds the supplied chat display to the front of the chat display list. It
+ * will subsequently be notified of incoming chat messages as well as tell
+ * responses.
+ */
+ public void pushChatDisplay (ChatDisplay display)
+ {
+ _displays.add(0, display);
+ }
+
+ /**
+ * Adds the supplied chat display to the end of the chat display list. It
+ * will subsequently be notified of incoming chat messages as well as tell
* responses.
*/
public void addChatDisplay (ChatDisplay display)
@@ -1088,15 +1098,19 @@ public class ChatDirector extends BasicDirector
public void setMessage (ChatMessage message)
{
_message = message;
+ _displayed = false;
}
public boolean apply (ChatDisplay observer)
{
- observer.displayMessage(_message);
+ if (observer.displayMessage(_message, _displayed)) {
+ _displayed = true;
+ }
return true;
}
protected ChatMessage _message;
+ protected boolean _displayed;
}
/** Implements /help. */
@@ -1388,11 +1402,11 @@ public class ChatDirector extends BasicDirector
/** A list of registered chat displays. */
protected ObserverList _displays =
- new ObserverList(ObserverList.FAST_UNSAFE_NOTIFY);
+ new ObserverList(ObserverList.SAFE_IN_ORDER_NOTIFY);
/** A list of registered chat filters. */
protected ObserverList _filters =
- new ObserverList(ObserverList.FAST_UNSAFE_NOTIFY);
+ new ObserverList(ObserverList.SAFE_IN_ORDER_NOTIFY);
/** A mapping from auxiliary chat objects to the types under which
* they are registered. */
@@ -1406,7 +1420,7 @@ public class ChatDirector extends BasicDirector
/** Observers that are watching our chatters list. */
protected ObserverList _chatterObservers =
- new ObserverList(ObserverList.FAST_UNSAFE_NOTIFY);
+ new ObserverList(ObserverList.SAFE_IN_ORDER_NOTIFY);
/** Registered chat command handlers. */
protected static HashMap _handlers =
diff --git a/src/java/com/threerings/crowd/chat/client/ChatDisplay.java b/src/java/com/threerings/crowd/chat/client/ChatDisplay.java
index 5a91a1870..22d86f6f3 100644
--- a/src/java/com/threerings/crowd/chat/client/ChatDisplay.java
+++ b/src/java/com/threerings/crowd/chat/client/ChatDisplay.java
@@ -38,7 +38,10 @@ public interface ChatDisplay
/**
* Called to display a chat message.
*
- * @see ChatMessage
+ * @param alreadyDisplayed true if a previous chat display in the list has
+ * already displayed this message, false otherwise.
+ *
+ * @return true if the message was displayed, false if not.
*/
- public void displayMessage (ChatMessage msg);
+ public boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed);
}