3

I am working on the chat application. I want to implement the group user chat and I have successfully done that.

Now I want toad the functionality by which user can leave the group. I found leave the group but it seems like it's just making user unavailable but not removing user from the member list.

Is there any way by which user remove himself from the member list?

I have read the xep 0045 for it, in that there is a topic for existing the room which seems make user unavailable but not removing from member list.

http://xmpp.org/extensions/xep-0045.html#exit

If anyone has any idea how to do this please share it.

ekad
  • 14,436
  • 26
  • 44
  • 46
Satish
  • 1,012
  • 2
  • 15
  • 32
  • have you succeed in implementing the above mentioned if so can you share the solution? your help is appreciated – Rohan May 04 '15 at 05:27
  • Hello Rohan, I have added user as owner, so he himself can exit and other user can also remove him, when user left or someone remove him the set affiliation none and that user will not be able to post message in group, i have kept group persistent and member only. sample is the iq to set for member list. – Satish May 05 '15 at 07:36
  • thanks a lot for your response. i did the same same thing to which you did. now i am able to exit group – Rohan May 11 '15 at 08:32

2 Answers2

0

Leaving a room in XMPP (0045) is accomplished by sending an unavailable presence to that room (see XMPPRoom.leaveRoom() in the XMPPFramework) - that should remove them from the occupants of that room (we do this with our app regularly).

0

"Members list" - is a MUC feature for moderator use cases, it is not related to user. Just leave room as described in XEP, you no need to modify members list. In fact, you no need to add user in this list too, simple chat application should only tracks <presence> stanzas from and to room JID.

vitalyster
  • 4,980
  • 3
  • 19
  • 27