1

we are working on an Instant Messaging app based on XMPP handling members-only persistent groups using XEP-0045 and MucSub. We have some issues with room occupancy and we didn't find a way to let users abandon a room permanently: we tried several approaches and none of them led to successful behavior.

The behavior we are looking for is very similar to WhatsApp and other similar mobile apps.

The first thing we had to think about is: which users we consider as participants?

The parameters we can use are:

  • Affiliation
  • Role
  • Subscription

To consider it as a working solution, we need that:

  • All the standard and obvious features of group conversations
  • Members can join and leave the group
  • If a member leaves a group, he cannot rejoin without invitation
  • Members can see the list of members and their privileges
  • Membership should not be affected by the member’s connection status
  • The member list and privileges must be persistent across server reboots

Our test environment:

  • Ejabberd 19.09 with mucsub enabled
  • PostgreSQL DB

We explored the following approaches:

Approach 1:

We can use affiliation to determine if a user is a participant, and consider him as a non-participant when the affiliation is none, outcast or not affiliated.

Who we consider as a participant:

  • Affiliation: member (or owner or admin)
  • Role: any
  • Subscription: any

How to abandon a room:

a. Sending a presence unavailable


    <presence to='roomX@conference.x.com/test2' from='test2@x.com' type='unavailable'>
      <status>leave</status>
    </presence>

b. changing your own affiliation


    <iq from='test2@x.com/app' 
        id='1234' 
        to='roomX@conference.x.com'
        type='set'>
      <query xmlns='http://jabber.org/protocol/muc#admin'>
        <item affiliation='none' jid='test2@x.com'/>
      </query>
    </iq>

New attributes of ex participants:

  • Affiliation: none (or outcast if the user has been banned)
  • Role: any
  • Subscription: any (more probably the user will be unsubscribed, but this parameter is not checked to determine participants)

Issues:

 Approach 2:

We can use subscriptions status to determine if a user is a participant, and consider him as a non-participant when the he unsubscribes.

Who we consider as a participant:

  • Affiliation: member (or owner or admin)
  • Role: any
  • Subscription: subscribed to all kind of events

How to abandon a room:

  • The user will abandon a room by unsubscribing.

<iq from='test2@x.com'
    to='roomX@conference.x.com'
    type='set'
    id='12345'>
  <unsubscribe xmlns='urn:xmpp:mucsub:0' />
</iq>

New attributes of ex participants:

  • Affiliation: member (or owner or admin)
  • Role: any
  • Subscription: not subscribed

Issues:

  • The ex participant can rejoin subscribe again without invitation, and following this approach will lead that he will be considered as a participant again (with no invitation)
Community
  • 1
  • 1
Yakko Olè
  • 71
  • 1
  • 5

0 Answers0