SHARE
TWEET

Untitled

a guest Nov 5th, 2018 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!--
  2.     Bob invites Alice to 'awesome_room'. He can list any number of users here.
  3. -->
  4. <iq
  5.     id='invite1'
  6.     to='awesome_room@muclight.localhost'
  7.     type='set'>
  8.     <query xmlns='urn:xmpp:muclight:0#invite'>
  9.         <user affiliation='member'>alice@localhost</user>
  10.     </query>
  11. </iq>
  12.  
  13. <!--
  14.     Bob gets confirmation that invite has been sent Alice.
  15.     If Bob don't have permissions to add more people to the room
  16.     or the target users are blocking the room, they won't appear on the list below
  17. -->
  18. <iq type="result" from="awesome_room@muclight.localhost" to="bob@localhost/RafalSlota-MBPlocal" id="invite1">
  19.     <query xmlns="urn:xmpp:muclight:0#invite">
  20.         <user affiliation="member">test2@localhost</user>
  21.     </query>
  22. </iq>
  23.  
  24.  
  25. <!-- Alice receives the invite. She can check who has invited her (Bob). -->
  26. <message to="alice@localhost" from="awesome_room@muclight.localhost">
  27.     <x xmlns="urn:xmpp:muclight:0#invite">
  28.         <user affiliation="owner" invite_id="invite1">bob@localhost</user>
  29.     </x>
  30.     <body/>
  31. </message>
  32.  
  33.  
  34. <!-- Now alice has a choice. -->
  35.  
  36. <!-- She can accept the invite. -->
  37. <iq
  38.     id='join1'
  39.     to='awesome_room@muclight.localhost'
  40.     type='set'>
  41.     <query xmlns='urn:xmpp:muclight:0#invite_response'>
  42.         <accept invite_id='invite1' />
  43.     </query>
  44. </iq>
  45. <!-- In which case she gets confirmation of the acceptance. -->
  46. <iq to="alice@localhost/Psi+" type="result" id="join1" from="awesome_room@muclight.localhost"/>
  47. <!--
  48.     AND she gets notification that she's been aded to the room as the original XEP describes
  49.     in case of user being added to the room.
  50. -->
  51. <message to="alice@localhost" type="groupchat" id="join1" from="awesome_room@muclight.localhost">
  52.     <x xmlns="urn:xmpp:muclight:0#affiliations">
  53.         <version>1541-452317-768713</version>
  54.         <user affiliation="member">alice@localhost</user>
  55.     </x>
  56.     <body/>
  57. </message>
  58. <!--
  59.     Bob also gets update to the state of the room (also according to standard XEP).
  60. -->
  61. <message type="groupchat" from="coven@muclight.localhost" to="test1@localhost" id="join1">
  62.     <x xmlns="urn:xmpp:muclight:0#affiliations">
  63.         <prev-version>1541-451846-782563</prev-version>
  64.         <version>1541-452317-768713</version>
  65.         <user affiliation="member">test2@localhost</user>
  66.     </x>
  67. <body/>
  68. </message>
  69.  
  70.  
  71. <!-- Alternatively Alice can decline the invitation. -->
  72. <iq
  73.     id='join1'
  74.     to='awesome_room@muclight.localhost'
  75.     type='set'>
  76.     <query xmlns='urn:xmpp:muclight:0#invite_response'>
  77.         <decline invite_id='invite1' />
  78.     </query>
  79. </iq>
  80. <!-- In which case she gets confirmation of the decline. -->
  81. <iq to="alice@localhost/Psi+" type="result" id="join1" from="awesome_room@muclight.localhost"/>
  82. <!--
  83.     Meanwhile Bob gets notificationa that his invitation got rejected (identified by invitation ID).
  84. -->
  85. <message type="groupchat" from="coven@muclight.localhost" to="bob@localhost" id="join1">
  86.     <x xmlns="urn:xmpp:muclight:0#invite_response">
  87.         <decline invite_id='invite1' />
  88.     </x>
  89.     <body/>
  90. </message>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top