diff --git a/src/java/com/threerings/crowd/chat/client/ChatDirector.java b/src/java/com/threerings/crowd/chat/client/ChatDirector.java index 75a270045..2f9189a17 100644 --- a/src/java/com/threerings/crowd/chat/client/ChatDirector.java +++ b/src/java/com/threerings/crowd/chat/client/ChatDirector.java @@ -1,5 +1,5 @@ // -// $Id: ChatDirector.java,v 1.30 2002/07/27 01:34:47 ray Exp $ +// $Id: ChatDirector.java,v 1.31 2002/07/27 01:58:57 ray Exp $ package com.threerings.crowd.chat; @@ -68,8 +68,10 @@ public class ChatDirector */ public void setMuteDirector (MuteDirector muter) { - _muter = muter; - addChatValidator(_muter); + if (_muter == null) { + _muter = muter; + _muter.setChatDirector(this); + } } /** @@ -180,6 +182,14 @@ public class ChatDirector dispatchMessage(new SystemMessage(xlate(bundle, message), localtype)); } + /** + * Display the feedback message, translated with the default bundle. + */ + public void displayFeedbackMessage (String message) + { + displayFeedbackMessage(_bundle, message); + } + /** * Display a feedback message. */ diff --git a/src/java/com/threerings/crowd/chat/client/MuteDirector.java b/src/java/com/threerings/crowd/chat/client/MuteDirector.java index 48589a18d..f368ac3d6 100644 --- a/src/java/com/threerings/crowd/chat/client/MuteDirector.java +++ b/src/java/com/threerings/crowd/chat/client/MuteDirector.java @@ -1,5 +1,5 @@ // -// $Id: MuteDirector.java,v 1.1 2002/06/28 04:09:39 ray Exp $ +// $Id: MuteDirector.java,v 1.2 2002/07/27 01:58:57 ray Exp $ package com.threerings.crowd.chat; @@ -23,6 +23,18 @@ public class MuteDirector // nothing to initialize right now } + /** + * Set the required ChatDirector. + */ + public void setChatDirector (ChatDirector chatdir) + { + if (_chatdir == null) { + _chatdir = chatdir; + _chatdir.addChatValidator(this); + _chatdir.setMuteDirector(this); + } + } + /** * Check to see if the specified user is muted. */ @@ -53,13 +65,16 @@ public class MuteDirector public boolean validateTell (String target, String msg) { if (isMuted(target)) { - // TODO: give user feedback on why the TELL is cancelled + _chatdir.displayFeedbackMessage("m.no_tell_mute"); return false; } return true; // let it go through.. } + /** The chat director that we're working hard for. */ + protected ChatDirector _chatdir; + /** The mutelist. */ protected HashSet _mutelist = new HashSet(); }