I have a question about XMPPConnection behavior when it comes to presence messages. Currently, it seems to queue up some presence messages before raising an event (see XMPPConnection.handlePresence and XMPPConnection.flushPresenceQueue). What is the reasoning behind this? My best guess would be a performance benefit, since there could be a lot of burst presence traffic and raising an event for each one might take too long?
This behavior is causing some weird behavior in my MUC usage, as users joining a room sometimes receive chat messages from people that they haven’t received the presence for yet (since types are handled immediately).
I would like to add a configurable option – a Boolean field called QueuePresences in XMPPConnection. If this is true, XMPPConnection does the presence queuing; if false, it throws events immediately. Some care would have to be taken to make sure that presence events don’t get thrown out of order (e.g. if QueuePresences is set to false, the queued presence events should be dealt with immediately so that a new presence event doesn’t get handled first).
If there are no feedback or objections, then I can go ahead an implement and commit this; otherwise if someone else wants to do it, that’s fine too