Fix for the "Broadcast presence for" option in the room settings

Description

http://www.igniterealtime.org/community/message/196266

Currently when you uncheck the "broadcast presence for" for a certain role (say visitor), their join presence is correctly supressed, but their unavailable presence is not when they leave the room. This is because Openfire (correctly) sets their role to none upon departure.

Unfortunately this is done right before the check to see if their presence should be broadcast, resulting in the presence always being sent to the entire room, despite them previously being a visitor.

To solve this, I created a shouldBroadcastPresence function, and check to see if the user's original presence should be broadcast. If not, the new presence (with role=none) is only sent to the user, and not the entire room. This also fixes the issue listed above where unavailable presence packets were being sent twice upon user departure.

Environment

None

Attachments

1

Activity

Show:

Guenther Niess November 6, 2009 at 4:50 PM

Ben, I like your patch. It looks very efficient I applied a small modified version to r11365.

Ben Vinson September 22, 2009 at 9:22 PM

The patch for this also fixes

Ben Vinson September 22, 2009 at 9:21 PM

patch for LocalMUCRoom

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created September 22, 2009 at 12:23 PM
Updated February 1, 2010 at 3:18 AM
Resolved November 6, 2009 at 4:50 PM