powered by Jive Software

Broadcast problem

I use Openfire Plugin ‘broadcast.jar’ to broadcast messages to all users. In the Openfire system properties,I set the value of plugin.broadcast.disableGroupPermissions “true”. The “to” property of message I send is “[group]@[serviceName].[serverName]”. All the users can receive the broadcast messages except the group administrator.That’s to say, in the table “jiveGroupUser” of openfire database,once the “administrator” field is set to “1”, the corresponding users can never receive broadcast again. Why this happens?
IQRouter.java (22030 Bytes)

Why there is nobody answer my question?

Could it be that the admin is the only one that can send broadcasts, then why would he receive his own messages?

My setting in openfire system properties is “allow any user to broadcast a message to a group”. So My question is, for example, user ‘A’ broadcast a message to group ‘staff’, and ‘A’ can be the member of ‘staff’ or not, all users in the group 'staff ’ can receive this broadcast message except administators in group ‘staff’.

Hi MyAmanda,

I think this is more related to the design issue of a group. The present implementation separates admins and members inside a group, and the Broadcast plugin exactly follows this implementation. A user in a group can either be an admin OR a member in a group. So, if you broadcast to members of a group, the message will not be delivered to the admins.

The plugin could be enhanced to include the ability to broadcast to admins, and you may propose this enhancement to the developers.

In the mean time, if you’re a Java coder and would like admins to also receive broadcasted messages you could add the following code to the processMessage(Message message, boolean targetAll, Group group, boolean canProceed) method in BroadcastPlugin.java within the else if (canProceed) statement. Notice the call to group.getAdmins():

for (JID userJID : group.getAdmins()) {
        Message newMessage = message.createCopy();
        newMessage.setTo(userJID);
        try {
            componentManager.sendPacket(this, newMessage);
        }
        catch (Exception e) {
            componentManager.getLog().error(e);
        }
    }

So the code becomes something like the following in BroadcastPlugin.java:

else if (canProceed) {
    // Broadcast message to group users. Users that are offline will get
    // the message when they come back online
    for (JID userJID : group.getAdmins()) {
        Message newMessage = message.createCopy();
        newMessage.setTo(userJID);
        try {
            componentManager.sendPacket(this, newMessage);
        }
        catch (Exception e) {
            componentManager.getLog().error(e);
        }
    }
    for (JID userJID : group.getMembers()) {
        Message newMessage = message.createCopy();
        newMessage.setTo(userJID);
        try {
            componentManager.sendPacket(this, newMessage);
        }
        catch (Exception e) {
            componentManager.getLog().error(e);
        }
    }
}

Hope that helps.