From c696896f10c8cc3fae1108af2b28c1580ffc6ae2 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 31 Mar 2006 18:15:32 +0000 Subject: [PATCH] Allow the view to be restricted to a particular type of chat. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3993 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/jme/chat/ChatView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/java/com/threerings/jme/chat/ChatView.java b/src/java/com/threerings/jme/chat/ChatView.java index 4e862374f..6a6a4be86 100644 --- a/src/java/com/threerings/jme/chat/ChatView.java +++ b/src/java/com/threerings/jme/chat/ChatView.java @@ -110,6 +110,11 @@ public class ChatView extends BContainer // documentation inherited from interface ChatDisplay public void displayMessage (ChatMessage msg) { + // we may be restricted in the chat types we handle + if (!handlesType(msg.localtype)) { + return; + } + if (msg instanceof UserMessage) { UserMessage umsg = (UserMessage) msg; if (umsg.localtype == ChatCodes.USER_CHAT_TYPE) { @@ -149,6 +154,11 @@ public class ChatView extends BContainer _text.appendText(text); } + protected boolean handlesType (String localType) + { + return true; + } + protected boolean handleInput (String text) { if (text.length() == 0) {