1

i read the XMPP doc : XEP-0045: Multi-User Chat

in the doc, there is a such paragraph:

An admin can grant membership to a user; this is done by changing the affiliation for the user's bare JID to "member" (if a nick is provided, that nick becomes the user's default nick in the room if that functionality is supported by the implementation):

    Example 120. Admin Grants Membership

<iq from='crone1@shakespeare.lit/desktop'
    id='member1'
    to='coven@chat.shakespeare.lit'
    type='set'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
    <item affiliation='member'
          jid='hag66@shakespeare.lit'
          nick='thirdwitch'/>
  </query>
</iq>

The <reason/> element is OPTIONAL.

So the user who the admin want to grant membership should must be online or not? In other words,can admin make unilateral decision of granting the role(membership) of the new user regardless of its current login status(online or offline)?

1 Answers1

1

Correct, the user does not need to be online or in the room to change their affiliation. For example this is required to add new members to members-only rooms.

The same is not generally true of roles, which are temporary privileges associated with a user in the room, and not their JID.

MattJ
  • 7,924
  • 1
  • 28
  • 33
  • Hi, thank you for your answer firstly, I posted another question still about XMPP MUC, would you please check that? http://stackoverflow.com/questions/20209235/how-to-keep-the-groupchat-room-muc-existing-all-the-time-even-if-disconnected – programmingIdiot Nov 27 '13 at 02:42