Allow system broadcasts to be INFO or ATTENTION level.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3032 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ChatProvider.java,v 1.28 2004/06/15 22:03:51 ray Exp $
|
// $Id: ChatProvider.java,v 1.29 2004/06/17 18:28:58 ray Exp $
|
||||||
|
|
||||||
package com.threerings.crowd.chat.server;
|
package com.threerings.crowd.chat.server;
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ public class ChatProvider
|
|||||||
throw new InvocationException(AccessControl.LACK_ACCESS);
|
throw new InvocationException(AccessControl.LACK_ACCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(body.username, null, message);
|
broadcast(body.username, null, message, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,15 +152,22 @@ public class ChatProvider
|
|||||||
* as a system message.
|
* as a system message.
|
||||||
* @param bundle the bundle, or null if the message needs no translation.
|
* @param bundle the bundle, or null if the message needs no translation.
|
||||||
* @param msg the content of the message to broadcast.
|
* @param msg the content of the message to broadcast.
|
||||||
|
* @param attention if true, the message is sent as ATTENTION level,
|
||||||
|
* otherwise as INFO. Ignored if from is non-null.
|
||||||
*/
|
*/
|
||||||
public static void broadcast (Name from, String bundle, String msg)
|
public static void broadcast (Name from, String bundle, String msg,
|
||||||
|
boolean attention)
|
||||||
{
|
{
|
||||||
Iterator iter = CrowdServer.plreg.enumeratePlaces();
|
Iterator iter = CrowdServer.plreg.enumeratePlaces();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
PlaceObject plobj = (PlaceObject)iter.next();
|
PlaceObject plobj = (PlaceObject)iter.next();
|
||||||
if (plobj.shouldBroadcast()) {
|
if (plobj.shouldBroadcast()) {
|
||||||
if (from == null) {
|
if (from == null) {
|
||||||
SpeakProvider.sendInfo(plobj, bundle, msg);
|
if (attention) {
|
||||||
|
SpeakProvider.sendAttention(plobj, bundle, msg);
|
||||||
|
} else {
|
||||||
|
SpeakProvider.sendInfo(plobj, bundle, msg);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SpeakProvider.sendSpeak(plobj, from, bundle, msg,
|
SpeakProvider.sendSpeak(plobj, from, bundle, msg,
|
||||||
|
|||||||
Reference in New Issue
Block a user