We’re trying to write a plugin to change user availability/status via a web service call. This plugin needs to function correctly in a clustered environment so we have set up two dev servers to do simulate that (Server A and B). We’ve tried several different ways to update the user presence and found one that would work. The solution we found is to call LocalMUCRoom.presenceUpdated(MUCRole, Presence) method to propogate the presence changes to other servers in the cluster. One caveat is that the Presence packet passed into the presenceUpdated method needs to include extendedInformation, e.g.
<presence to="firstname.lastname@example.org/mr.j" from="email@example.com/mr.j"><priority>0</priority><status>Live</status>< ;x xmlns=“http://jabber.org/protocol/muc#user”><item jid="firstname.lastname@example.org/mr.j" affiliation=“admin” role=“moderator”/></x>
If the extendedInformation is missing, an exception will be thrown from LocalMUCRoom.sendInitialPresence on server B when a second user (user B) joins the room on that server after the first user (user A) in the room changes status on server A. But, if the extendedInformation is included, user A’s role presence would have an extra piece of extendedInformation added to it every time user A changes status in the room.
My question is, is that an expected behavior and could I actually use presenceUpdated method to update presence? If not, what’s the correct way to achieve this?
Thanks in advance!