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.
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.