No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0316.xml 15KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>MUC Eventing Protocol</title>
  10. <abstract>This specification defines semantics for using the XMPP publish-subscribe protocol to broadcast state change events associated with a Multi-User Chat (MUC) room. This profile of pubsub therefore enables a chatroom to function as a virtual pubsub service, easing the discovery of syndicated data and event notifications associated with such a room.</abstract>
  12. <number>0316</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards JIG</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XMPP IM</spec>
  20. <spec>XEP-0030</spec>
  21. <spec>XEP-0045</spec>
  22. <spec>XEP-0060</spec>
  23. <spec>XEP-0115</spec>
  24. </dependencies>
  25. <supersedes/>
  26. <supersededby/>
  27. <shortname>mep</shortname>
  28. &stpeter;
  29. <revision>
  30. <version>0.1</version>
  31. <date>2013-01-03</date>
  32. <initials>psa</initials>
  33. <remark><p>Initial published version approved for publication by the XMPP Council.</p></remark>
  34. </revision>
  35. <revision>
  36. <version>0.0.2</version>
  37. <date>2012-12-09</date>
  38. <initials>psa</initials>
  39. <remark><p>Added description of occupant publishing.</p></remark>
  40. </revision>
  41. <revision>
  42. <version>0.0.1</version>
  43. <date>2012-12-06</date>
  44. <initials>psa</initials>
  45. <remark><p>First draft.</p></remark>
  46. </revision>
  47. </header>
  48. <section1 topic='Introduction' anchor='intro'>
  49. <p>Just as &xep0163; defines a profile of &xep0060; that enables an instant messaging user to send updates or "events" to other users, this specification defines a profile that enables a room occupant or the chatroom itself to send notifications in the context of &xep0045; chatroom.</p>
  50. <p class='em'>Note: Any use cases, error flows, and other protocols details not described herein are described in <cite>XEP-0060</cite>. This document merely defines a "subset" or "profile" of XMPP publish-subscribe.</p>
  51. </section1>
  52. <section1 topic='Room Notifications' anchor='room'>
  53. <p>Using the chatroom example from XEP-0045, imagine that the room itself wants to notify the occupants of the coven@chat.shakespeare.lit chatroom about events of interest to the group (say, notifications about multimedia aspects of the multi-user session, such as described in &xep0298;).</p>
  54. <p>When new information is available about the multimedia session (say, calling into a conference "bridge" or starting a &xep0166; session to add a video feed), a multimedia engine might capture that event and inform the chatroom by means of a backend API. The chatroom itself then generates an event notification. That is, a chatroom does not publish events, instead it simply generates them based on data of interest. As a result, everyone in the room who is interested in that kind of data will receive a notification about the event:</p>
  55. <example caption='Interested occupants receive event notification'><![CDATA[
  56. <message from='coven@chat.shakespeare.lit'
  57. to='crone1@shakespeare.lit/desktop'
  58. type='headline'
  59. id='zns61f38'>
  60. <event xmlns=''>
  61. <items node='urn:ietf:params:xml:ns:conference-info'>
  62. <item id='ehs51f40'>
  63. <conference-info
  64. xmlns='urn:ietf:params:xml:ns:conference-info'>
  65. <conference-description>
  66. <available-media label='4'>
  67. <type>video</type>
  68. <status>sendonly</status>
  69. </available-media>
  70. </conference-description>
  71. </conference-info>
  72. </item>
  73. </items>
  74. </event>
  75. </message>
  76. <message from='coven@chat.shakespeare.lit'
  77. to='wiccarocks@shakespeare.lit/laptop'
  78. type='headline'
  79. id='uh4gs519'>
  80. <event xmlns=''>
  81. <items node='urn:ietf:params:xml:ns:conference-info'>
  82. <item id='ehs51f40'>
  83. <conference-info
  84. xmlns='urn:ietf:params:xml:ns:conference-info'>
  85. <conference-description>
  86. <available-media label='4'>
  87. <type>video</type>
  88. <status>sendonly</status>
  89. </available-media>
  90. </conference-description>
  91. </conference-info>
  92. </item>
  93. </items>
  94. </event>
  95. </message>
  96. ]]></example>
  97. <p>But how do the occupants tell the room that they are interested in knowing what about conference-info events? Whereas generic pubsub services require an explicit subscription to a conference-info node, MEP services support the "filtered-notification" feature from XEP-0060 and obviously share presence (since MUC is based on directed presence in the room) so the "auto-subscribe" feature also applies.</p>
  98. <example caption='Occupant sends directed presence to join the room, with caps'><![CDATA[
  99. <presence from='crone1.shakespeare.lit/desktop'
  100. to='coven@chat.shakespeare.lit/firstwitch'>
  101. <x xmlns=''/>
  102. <c xmlns=''
  103. hash='sha-1'
  104. node=''
  105. ver='054H4A7280JuT6+IroVYxgCAjZo='/>
  106. </presence>
  107. ]]></example>
  108. <p>That chatroom knows to send conference-info notifications to crone1@shakespeare.lig because when the room unpacks the value of the 'ver' attribute ("054H4A7280JuT6+IroVYxgCAjZo=") in accordance with <cite>XEP-0115</cite>, it discovers that her client advertises a service discovery feature of "urn:ietf:params:xml:ns:conference-info+notify", where the "+notify" suffix indicates interest in receiving notifications related to the protocol that precedes the suffix. The server can verify this support if needed by sending a service discovery request to crone1's full JID (see XEP-0115 for details).</p>
  109. </section1>
  110. <section1 topic='Occupant Notifications' anchor='occupant'>
  111. <p>The foregoing section described how the room itself can inform the occupants about data of interest. However, in MEP any particular occupant can also publish information. An occupant does so by sending a publish-subscribe publish request to the occupant's Occupant JID &lt;room@service/nick&gt; (similar to the way in which publishing via PEP happens by sending a request to the user's bare JID &lt;user@host&gt;). For instance, the following example shows how a room occupant would inform the other occupants about an event of interest.</p>
  112. <example caption='Occupant Publishes Activity'><![CDATA[
  113. <iq from='wiccarocks@shakespeare.lit/laptop'
  114. id='vlk3h264'
  115. to='coven@chat.shakespeare.lit/secondwitch'
  116. type='set'>
  117. <pubsub xmlns=''>
  118. <publish node=''>
  119. <item>
  120. <activity xmlns=''>
  121. <other/>
  122. <text xml:lang='en'>I'll give thee a wind.</text>
  123. </activity>
  124. </item>
  125. </publish>
  126. </pubsub>
  127. </iq>
  128. ]]></example>
  129. <p class='box'>Note: Publishing to an occupant's MEP node happens by sending an explicit publish request to the Occupant JID. Publishing to a user's PEP node MUST NOT trigger a MEP publish request, because PEP and MEP are separate pubsub contexts.</p>
  130. <p>As a result, everyone in the room who is interested in that kind of data will receive a notification about the event (note that even the publisher receives the event, if they have advertised interest in the payload type):</p>
  131. <example caption='Interested occupants receive event notification'><![CDATA[
  132. <message from='coven@chat.shakespeare.lit/secondwitch'
  133. to='crone1@shakespeare.lit/desktop'
  134. type='headline'
  135. id='hs7bx143'>
  136. <event xmlns=''>
  137. <items node=''>
  138. <item id='bxg1c27r'>
  139. <activity xmlns=''>
  140. <other/>
  141. <text xml:lang='en'>I'll give thee a wind.</text>
  142. </activity>
  143. </item>
  144. </items>
  145. </event>
  146. </message>
  147. <message from='coven@chat.shakespeare.lit'
  148. to='wiccarocks@shakespeare.lit/laptop'
  149. type='headline'
  150. id='ke2v1c95'>
  151. <event xmlns=''>
  152. <items node=''>
  153. <item id='bxg1c27r'>
  154. <activity xmlns=''>
  155. <other/>
  156. <text xml:lang='en'>I'll give thee a wind.</text>
  157. </activity>
  158. </item>
  159. </items>
  160. </event>
  161. </message>
  162. ]]></example>
  163. </section1>
  164. <section1 topic='Concepts and Approach' anchor='approach'>
  165. <p>MUC eventing via pubsub ("MEP") is based on the following principles:</p>
  166. <ol start='1'>
  167. <li>Every room JID and occupant JID a pubsub service.</li>
  168. <li>One publisher per node (the chatroom or occupant itself).</li>
  169. <li>Use presence (implicit in multi-user chat).</li>
  170. <li>Filter notifications based on expressed interest.</li>
  171. <li>Smart defaults.</li>
  172. </ol>
  173. <p>These principles are described more fully below.</p>
  174. <section2 topic='Every Room JID and Occupant JID a Pubsub Service' anchor='approach-every'>
  175. <p>Treating every MEP-enabled chatroom as a pubsub service simplifies the task of discovering and subscribing to information of interest in or about the room.</p>
  176. </section2>
  177. <section2 topic='One Publisher Per Node' anchor='approach-publisher'>
  178. <p>There is no need for multiple publishers to a MEP service, since by definition only the chatroom itself or the occupant itself publishes information.</p>
  179. </section2>
  180. <section2 topic='Use Presence' anchor='approach-presence'>
  181. <p>By definition, a chatroom has presence information about the occupants, because they use directed presence to join the room.</p>
  182. </section2>
  183. <section2 topic='Filtered Notifications' anchor='approach-filter'>
  184. <p>By default, the use of directed presence is used to establish a MEP subscription to the chatroom's eventing data. In order to filter which notifications are sent by the MEP service, the contact's client includes extended &xep0115; information in the directed presence notifications it sends to the chatroom. Because the MEP-enabled room supports the "filtered-notifications" feature, it sends only those notifications that match the occupant's expressed notification preferences.</p>
  185. </section2>
  186. <section2 topic='Smart Defaults' anchor='approach-defaults'>
  187. <p>Most pubsub configuration options and metadata are not needed for MUC eventing. Instead, MEP services offer smart defaults to simplify node creation and management.</p>
  188. </section2>
  189. </section1>
  190. <section1 topic='Recommended Defaults' anchor='defaults'>
  191. <p>A MEP service MUST:</p>
  192. <ul>
  193. <li>Support the node discovery, node creation, node deletion, publish item, subscribe, unsubscribe, and item retrieval use cases specified in <cite>XEP-0060</cite>.</li>
  194. <li>Support the "auto-create", "auto-subscribe", and "filtered-notifications" features.</li>
  195. <li>Support the "owner" and "subscriber" affiliations.</li>
  196. <li>Support the "presence" access model and set it to the default.</li>
  197. <li>Treat the room JID and each occupant JID as a collection node (i.e., as the root collection node for the virtual pubsub service associated with the chatroom or with each occupant JID).</li>
  198. <li>Default the 'deliver_notifications' configuration option to true (i.e., deliver payloads by default).</li>
  199. <li>Default the 'send_last_published_item' configuration option to on_sub_and_presence (i.e., send the last published item on subscription and on receipt of presence), treating the receipt of directed presence as equivalent to a subscription.</li>
  200. </ul>
  201. <p>A PEP service MAY support other use cases, affiliations, access models, and features, but such support is OPTIONAL.</p>
  202. </section1>
  203. <section1 topic='Determining Support' anchor='support'>
  204. <p>If a chatroom supports MEP, it MUST advertise that fact in its responses to &xep0030; information ("disco#info") requests by returning an identity of "pubsub/mep" and the relevant pubsub features:</p>
  205. <example caption='A disco#info query'><![CDATA[
  206. <iq type='get'
  207. from='hag66@shakespeare.lit/pda'
  208. to='coven@chat.shakespeare.lit'
  209. id='k3hs5174'>
  210. <query xmlns=''/>
  211. </iq>
  212. ]]></example>
  213. <example caption='A disco#info response'><![CDATA[
  214. <iq type='result'
  215. from='coven@chat.shakespeare.lit'
  216. to='hag66@shakespeare.lit/pda'
  217. id='k3hs5174'>
  218. <query xmlns=''>
  219. <identity category='conference' type='text'/>
  220. <identity category='pubsub' type='mep'/>
  221. ...
  222. <feature var=''/>
  223. <feature var=''/>
  224. <feature var=''/>
  225. <feature var=''/>
  226. <feature var=''/>
  227. <feature var=''/>
  228. <feature var=''/>
  229. <feature var=''/>
  230. <feature var=''/>
  231. <feature var=''/>
  232. <feature var=''/>
  233. <feature var=''/>
  234. <feature var=''/>
  235. <feature var=''/>
  236. <feature var='muc_passwordprotected'/>
  237. <feature var='muc_hidden'/>
  238. <feature var='muc_temporary'/>
  239. <feature var='muc_open'/>
  240. <feature var='muc_unmoderated'/>
  241. <feature var='muc_nonanonymous'/>
  242. ...
  243. </query>
  244. </iq>
  245. ]]></example>
  246. </section1>
  247. <section1 topic='Security Considerations' anchor='security'>
  248. <p>The security considerations of XEP-0045 and XEP-0163 apply.</p>
  249. </section1>
  250. <section1 topic='IANA Considerations' anchor='iana'>
  251. <p>This document requires no interaction with &IANA;.</p>
  252. </section1>
  253. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  254. <section2 topic='Service Discovery Category/Type' anchor='registrar-disco'>
  255. <p>The &REGISTRAR; includes a category of "pubsub" in its registry of Service Discovery identities (see &DISCOCATEGORIES;); as a result of this document, the Registrar includes a type of "pep" to that category.</p>
  256. <p>The registry submission is as follows:</p>
  257. <code><![CDATA[
  258. <category>
  259. <name>pubsub</name>
  260. <type>
  261. <name>mep</name>
  262. <desc>
  263. A MUC eventing service that supports the
  264. publish-subscribe subset defined herein.
  265. </desc>
  266. <doc>XEP-0316</doc>
  267. </type>
  268. </category>
  269. ]]></code>
  270. </section2>
  271. </section1>
  272. <section1 topic='XML Schema' anchor='schema'>
  273. <p>Because MEP simply reuses the protocol specified in <cite>XEP-0060</cite>, a separate schema is not needed.</p>
  274. </section1>
  275. <section1 topic='Acknowledgements' anchor='ack'>
  276. <p>Thanks to Joe Hildebrand, Matt Miller, and Matthew Wild for their input.</p>
  277. </section1>
  278. </xep>