Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Bob invites Alice to 'awesome_room'. He can list any number of users here.
- -->
- <iq
- id='invite1'
- to='awesome_room@muclight.localhost'
- type='set'>
- <query xmlns='urn:xmpp:muclight:0#invite'>
- <user affiliation='member'>alice@localhost</user>
- </query>
- </iq>
- <!--
- Bob gets confirmation that invite has been sent Alice.
- If Bob don't have permissions to add more people to the room
- or the target users are blocking the room, they won't appear on the list below
- -->
- <iq type="result" from="awesome_room@muclight.localhost" to="bob@localhost/RafalSlota-MBPlocal" id="invite1">
- <query xmlns="urn:xmpp:muclight:0#invite">
- <user affiliation="member">test2@localhost</user>
- </query>
- </iq>
- <!-- Alice receives the invite. She can check who has invited her (Bob). -->
- <message to="alice@localhost" from="awesome_room@muclight.localhost">
- <x xmlns="urn:xmpp:muclight:0#invite">
- <user affiliation="owner" invite_id="invite1">bob@localhost</user>
- </x>
- <body/>
- </message>
- <!-- Now alice has a choice. -->
- <!-- She can accept the invite. -->
- <iq
- id='join1'
- to='awesome_room@muclight.localhost'
- type='set'>
- <query xmlns='urn:xmpp:muclight:0#invite_response'>
- <accept invite_id='invite1' />
- </query>
- </iq>
- <!-- In which case she gets confirmation of the acceptance. -->
- <iq to="alice@localhost/Psi+" type="result" id="join1" from="awesome_room@muclight.localhost"/>
- <!--
- AND she gets notification that she's been aded to the room as the original XEP describes
- in case of user being added to the room.
- -->
- <message to="alice@localhost" type="groupchat" id="join1" from="awesome_room@muclight.localhost">
- <x xmlns="urn:xmpp:muclight:0#affiliations">
- <version>1541-452317-768713</version>
- <user affiliation="member">alice@localhost</user>
- </x>
- <body/>
- </message>
- <!--
- Bob also gets update to the state of the room (also according to standard XEP).
- -->
- <message type="groupchat" from="coven@muclight.localhost" to="test1@localhost" id="join1">
- <x xmlns="urn:xmpp:muclight:0#affiliations">
- <prev-version>1541-451846-782563</prev-version>
- <version>1541-452317-768713</version>
- <user affiliation="member">test2@localhost</user>
- </x>
- <body/>
- </message>
- <!-- Alternatively Alice can decline the invitation. -->
- <iq
- id='join1'
- to='awesome_room@muclight.localhost'
- type='set'>
- <query xmlns='urn:xmpp:muclight:0#invite_response'>
- <decline invite_id='invite1' />
- </query>
- </iq>
- <!-- In which case she gets confirmation of the decline. -->
- <iq to="alice@localhost/Psi+" type="result" id="join1" from="awesome_room@muclight.localhost"/>
- <!--
- Meanwhile Bob gets notificationa that his invitation got rejected (identified by invitation ID).
- -->
- <message type="groupchat" from="coven@muclight.localhost" to="bob@localhost" id="join1">
- <x xmlns="urn:xmpp:muclight:0#invite_response">
- <decline invite_id='invite1' />
- </x>
- <body/>
- </message>
Add Comment
Please, Sign In to add comment