Let the user know when we drop a tell to a muted user.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1623 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2002-07-27 01:58:57 +00:00
parent 42f2df01c8
commit f6d9139b2d
2 changed files with 30 additions and 5 deletions
@@ -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; package com.threerings.crowd.chat;
@@ -68,8 +68,10 @@ public class ChatDirector
*/ */
public void setMuteDirector (MuteDirector muter) public void setMuteDirector (MuteDirector muter)
{ {
_muter = muter; if (_muter == null) {
addChatValidator(_muter); _muter = muter;
_muter.setChatDirector(this);
}
} }
/** /**
@@ -180,6 +182,14 @@ public class ChatDirector
dispatchMessage(new SystemMessage(xlate(bundle, message), localtype)); 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. * Display a feedback message.
*/ */
@@ -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; package com.threerings.crowd.chat;
@@ -23,6 +23,18 @@ public class MuteDirector
// nothing to initialize right now // 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. * Check to see if the specified user is muted.
*/ */
@@ -53,13 +65,16 @@ public class MuteDirector
public boolean validateTell (String target, String msg) public boolean validateTell (String target, String msg)
{ {
if (isMuted(target)) { if (isMuted(target)) {
// TODO: give user feedback on why the TELL is cancelled _chatdir.displayFeedbackMessage("m.no_tell_mute");
return false; return false;
} }
return true; // let it go through.. return true; // let it go through..
} }
/** The chat director that we're working hard for. */
protected ChatDirector _chatdir;
/** The mutelist. */ /** The mutelist. */
protected HashSet _mutelist = new HashSet(); protected HashSet _mutelist = new HashSet();
} }