Always report something to the user when they try to mute/unmute someone,

report success always when muting, even if nothing changed, but report
that the person wasn't there if an umute fails.
We get bug reports from people who unmute the person but they still can't
hear them and the only thing I can think of is that they are mistyping
the name.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3579 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2005-05-27 21:35:07 +00:00
parent 7233c34e0f
commit 3f438188dc
@@ -1,5 +1,5 @@
//
// $Id: MuteDirector.java,v 1.13 2004/08/27 02:12:30 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -113,9 +113,21 @@ public class MuteDirector extends BasicDirector
*/
public void setMuted (Name username, boolean mute)
{
if (mute ? _mutelist.add(username) : _mutelist.remove(username)) {
_chatdir.displayFeedback(null, MessageBundle.tcompose(
mute ? "m.muted" : "m.unmuted", username));
boolean changed = mute ? _mutelist.add(username)
: _mutelist.remove(username);
String feedback;
if (mute) {
feedback = "m.muted";
} else {
feedback = changed ? "m.unmuted" : "m.notmuted";
}
// always give some feedback to the user
_chatdir.displayFeedback(null,
MessageBundle.tcompose(feedback, username));
// if the mutelist actually changed, notify observers
if (changed) {
notifyObservers(username, mute);
}
}