From d53b707e4f3f383b0e3b0ae998216cae6e6c4174 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 20 Mar 2003 00:46:34 +0000 Subject: [PATCH] Can init the mutelist with a String[] of muted players. Can get a String[] of the currently muted players. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2312 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/chat/client/MuteDirector.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/crowd/chat/client/MuteDirector.java b/src/java/com/threerings/crowd/chat/client/MuteDirector.java index a093cbcd4..818434020 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.5 2002/12/12 23:54:27 shaper Exp $ +// $Id: MuteDirector.java,v 1.6 2003/03/20 00:46:34 ray Exp $ package com.threerings.crowd.chat; @@ -40,6 +40,18 @@ public class MuteDirector extends BasicDirector super(ctx); } + /** + * Set up the mute director with the specified list of initial mutees. + */ + public MuteDirector (CrowdContext ctx, String[] list) + { + this(ctx); + + for (int ii=0, nn=list.length; ii < nn; ii++) { + _mutelist.add(list[ii]); + } + } + /** * Set the required ChatDirector. */ @@ -86,6 +98,17 @@ public class MuteDirector extends BasicDirector } } + /** + * @return a list of the currently muted players. + * + * This list may be out of date immediately upon returning from this + * method. + */ + public String[] getMuted () + { + return (String[]) _mutelist.toArray(new String[_mutelist.size()]); + } + // documentation inherited from interface ChatValidator public boolean validateSpeak (String msg) {