Add a MultiUserChat.presenceChanged callback method to be informed if a presence within a MUC has changed (joined, leaved, status change)

Description

MultiUserChat.addParticipantListener javadoc currently states

Adds a packet listener that will be notified of any new Presence packets sent to the group chat. Using a listener is a suitable way to know when the list of occupants should be re-loaded due to any changes.

However, this is not true. Because it's not guaranteed that smacks built-in PacketListener is called before the custom PacketListener from the user and therefore has a chance to update e.g. the occupant count or the list of occupants. It may be guaranteed if https://igniterealtime.atlassian.net/browse/SMACK-532#icft=SMACK-532 was fixed.

I think the best solution would be to add an callback method to MUC that is invoked every time a presence in the MUC has changed (e.g. join, leave, status change) and these change has be propagated to the MUC instances. internal state.

The javadoc of addPacketListener should then be fixed by removing the statement "...is a suitable way to know when the list of occupants should be re-loaded due to any changes."

See also the Stackoverflow question which is the origin of this bug report.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created March 6, 2013 at 12:44 PM
Updated March 29, 2015 at 10:42 AM
Resolved January 12, 2015 at 1:16 PM

Flag notifications