From 3f438188dc5f8ec3ec61cccbeb4b4e8423973273 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 27 May 2005 21:35:07 +0000 Subject: [PATCH] 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 --- .../crowd/chat/client/MuteDirector.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/crowd/chat/client/MuteDirector.java b/src/java/com/threerings/crowd/chat/client/MuteDirector.java index 3bbf1af20..7f755b9fa 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.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); } }