I'm working on persistent group conversations with Ejabberd 19.09 and mucsub.
When a member of a group sends a presence unavailable, sometimes the server does not respond at all. If we repeat the same test after sending a presence available just before the presence unavailable, the server responds. In any case, apparently, we have no changes in the room occupancy.
Is this an expected behavior?
First test:
Steps to reproduce first test:
- admin
test1
creates a roomroomX
(members-only)
<!-- [CREATE ROOM] | test1 -->
<iq from='[email protected]' to='[email protected]' type='set' id='1111111'>
<subscribe xmlns='urn:xmpp:mucsub:0' nick='test1'>
<event node='urn:xmpp:mucsub:nodes:messages' /><event node='urn:xmpp:mucsub:nodes:affiliations' /><event node='urn:xmpp:mucsub:nodes:subject' /><event node='urn:xmpp:mucsub:nodes:config' /><event node='urn:xmpp:mucsub:nodes:subscribers' /><event node='urn:xmpp:mucsub:nodes:presence' />
</subscribe>
</iq>
- admin
test1
invites and subscribes the usertest2
<!-- [INVITE test2] | test1 -->
<message from='[email protected]' id='33333' to='[email protected]'>
<x xmlns='http://jabber.org/protocol/muc#user'>
<invite to='[email protected]'><reason>REASON</reason></invite>
</x>
</message>
<!-- [SUBSCRIBE test2 TO ROOM] | test1 -->
<iq from='[email protected]' to='[email protected]' type='set' id='222222'>
<subscribe xmlns='urn:xmpp:mucsub:0' jid='[email protected]' nick='test2'>
<event node='urn:xmpp:mucsub:nodes:messages' /><event node='urn:xmpp:mucsub:nodes:presence' /><event node='urn:xmpp:mucsub:nodes:subject' /><event node='urn:xmpp:mucsub:nodes:config' /><event node='urn:xmpp:mucsub:nodes:subscribers' /><event node='urn:xmpp:mucsub:nodes:presence' />
</subscribe>
</iq>
- the invitation is automatically accepted, user
test2
is now a room member, he can send messages and he is subscribed to all events - member
test2
wants to abandon the room, and sends a presence type=unavailable
<!-- [test2 leaves the room] | test2 -->
<presence to='[email protected]/test2' from='[email protected]' type='unavailable'>
<status>leave</status>
</presence>
Results:
- service does not respond to member
- no changes to the room occupancy: member’s affiliation is still “member”, role is still “member”, subscription is still active
Second test:
Steps to reproduce second test:
- admin
test1
creates a roomroomX
(members-only) - admin
test1
invites and subscribes the usertest2
- the invitation is automatically accepted, user
test2
is now a room member, he can send messages and he is subscribed to all events - member
test2
sends a presence type=available (in theory this is redundant, but it's made on purpose as part of this test)
<!-- [test2 JOINS THE ROOM] | test2 -->
<presence from='[email protected]' id='n13mt3l' to='[email protected]/test2'>
<x xmlns='http://jabber.org/protocol/muc'/>
</presence>
- member
test2
wants to abandon the room, and sends a presence type=unavailable
Results
- service responds to member
- no changes to the room occupancy: member’s affiliation is still “member”, role is still “member”, subscription is still active