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-0351.xml 8.6KB

  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>Recipient Server Side Notifications Filtering</title>
  10. <abstract>This specification defines a modern efficient way to deliver PubSub notifications.</abstract>
  12. <number>0351</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0001</spec>
  20. <spec>XEP-0060</spec>
  21. <spec>XEP-0115</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>NOT_YET_ASSIGNED</shortname>
  26. <author>
  27. <firstname>Sergey</firstname>
  28. <surname>Dobrov</surname>
  29. <email></email>
  30. <jid></jid>
  31. </author>
  32. <revision>
  33. <version>0.2</version>
  34. <date>2017-09-11</date>
  35. <initials>XEP Editor (jwi)</initials>
  36. <remark>Defer due to lack of activity.</remark>
  37. </revision>
  38. <revision>
  39. <version>0.1</version>
  40. <date>2014-08-28</date>
  41. <initials>XEP Editor(aw)</initials>
  42. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  43. </revision>
  44. <revision>
  45. <version>0.0.2</version>
  46. <date>2014-07-20</date>
  47. <initials>sd</initials>
  48. <remark><p>Updated based on Council feedback.</p></remark>
  49. </revision>
  50. <revision>
  51. <version>0.0.1</version>
  52. <date>2014-05-20</date>
  53. <initials>sd</initials>
  54. <remark><p>First draft.</p></remark>
  55. </revision>
  56. </header>
  57. <section1 topic='Introduction' anchor='intro'>
  58. <p>&xep0060; in conjuction with &xep0115; defines a way for a client to get rid of unwanted pubsub notifications and hence save significant amount of traffic. The protocol is quite flexible and reliable and is able to work even with servers that don't support filtering. Unfortunately, this reliability has its costs and the protocol has the following disadvantages:</p>
  59. <ul>
  60. <li>it's impossible to be subscribed to a person's feed if the person is not subscribed to you because in this case his server doesn't know your presence information and your capabilities and hence it can't filter the messages appropriately, so you won't receive any notifications at all;</li>
  61. <li>servers need to know not only their users' capabilities but also the capabilities of all the users that it wants to communicate;</li>
  62. <li>clients can't decide what kind of notifications they want to receive; node owner decides instead, but clients might not be interested in some of notifications or vice versa.</li>
  63. </ul>
  64. <p>The most actual example of the problems that are beget with these disadvantages is the &xep0277;: you won't be able to subscribe to a user's blog if he doesn't want to read your blog as well. This will be a big problem for popular bloggers that can't read all the feeds of their readers.</p>
  65. <p>Another one is a bot which want to gather information from a lot of users. For instance, we can want to write a bot which gather geo-location from a lot of devices, then it will subscribe to these devices but they may not want to do so. The new protocol will allow such bots to operate this way.</p>
  66. <p>Also, some clients may want to receive retract items events to appropriately update their feed data storage but some other clients may not want to store feeds at all and just show the recent events and corollary don't need in these events. This standard allows the first one to receive those events and the last one to get rid of them saving traffic, regardless of node settings which can be configured solely by the node's owner.</p>
  67. </section1>
  68. <section1 topic='Requirements' anchor='reqs'>
  69. <p>The new protocol is needed to solve the stated problems that will allow to move the notifications filtering process from the sender side to the recipient side, that will allow us to filter them in a more flexible way. Also, we must care of:</p>
  70. <ul>
  71. <li>backwards-compatibility: users of servers that don't support this XEP should be able to receive the notifications through the old protocol;</li>
  72. <li>users should be able to control what kind of events they want to receive besides the nodes types.</li>
  73. </ul>
  74. </section1>
  75. <section1 topic='Use Cases' anchor='usecases'>
  76. <p>This document should cover the following use cases:</p>
  77. <ul>
  78. <li>switching to the new protocol if the recipient's server support it;</li>
  79. <li>sending a notification;</li>
  80. <li>receiving a notification by server and broadcasting it to its users;</li>
  81. <li>advertising client's filtering preferences.</li>
  82. </ul>
  83. <section2 topic="Switching protocols">
  84. <p>Since we require the implementations to be backwards compatible, we need a mechanism for a sender to know if the recipient's server supports the modern protocol or not.</p>
  85. <p>To know this, sender's server should check recipient's capabilities as described at &xep0115; in the "Stream Feature" section: if the server supports the "urn:xmpp:rsf:0" feature then the server SHOULD use the protocol that's described here, if the server lacks support of this feature or doesn't provide its capabilities at all then the sender MUST NOT use this protocol.</p>
  86. </section2>
  87. <section2 topic="Sending and receiving a notification">
  88. <p>When using this protocol to deliver notifications, the server MUST follow these rules:</p>
  89. <ul>
  90. <li>send all the notifications that can be generated by the pubsub node without any care of node settings to make it possible for users to choose which notifications they want to receive instead.</li>
  91. </ul>
  92. <example caption='Sending the notification'>
  93. <![CDATA[
  94. <message from=''
  95. to=''>
  96. <event xmlns=''>
  97. <items node='n48ad4fj78zn38st734'>
  98. <item id='i1s2d3f4g5h6bjeh936'>
  99. <geoloc xmlns=''>
  100. <description>Venice</description>
  101. <lat>45.44</lat>
  102. <lon>12.33</lon>
  103. </geoloc>
  104. </item>
  105. </items>
  106. </event>
  107. </message>
  108. <message from=''
  109. to=''>
  110. <event xmlns=''>
  111. <items node='n48ad4fj78zn38st734'>
  112. <item id='i1s2d3f4g5h6bjeh936'>
  113. <geoloc xmlns=''>
  114. <description>Venice</description>
  115. <lat>45.44</lat>
  116. <lon>12.33</lon>
  117. </geoloc>
  118. </item>
  119. </items>
  120. </event>
  121. </message>
  122. ... and so on
  123. ]]>
  124. </example>
  125. <p>Recipient server is responsible now to filter out and broadcast that messages with events that were request by each user's resource.</p>
  126. </section2>
  127. <section2 topic="Advertising client's filtering preferences">
  128. <p>As described at &xep0060;'s "Filtered notifications" section, client should add payload's NodeID and "+notify" postfix to tell which types of content it can and want to process.</p>
  129. <p>This document extends this filtering feature to allow clients also select which event types it wants to receive.</p>
  130. <p>To advertise user's preferences it should add a feature in its capabilities that MUST consist of payload's NodeID with appended "+events-" postfix and then append a list of necessary payload types. Here are the rules of generating this list:</p>
  131. <ul>
  132. <li>list should contain payload types those can be one of the following: config, delete, retract, sub as described in &xep0060;;</li>
  133. <li>order the list ascending;</li>
  134. <li>concatenate the items through the "-" sign.</li>
  135. </ul>
  136. <p>For example, the following string will mean that user wants to receive new items, node configuration changes and new subscriptions geolocation events, it should add the following features in its capabilities:</p>
  137. <ul>
  138. <li></li>
  139. <li></li>
  140. </ul>
  141. <p>The recipient's server MUST drop the notifications that are not in the list. New items notifications are implied by the "+notify" filter. If user doesn't specify the "+events" filter then the server SHOULD treat it as absence of any filtering at all.</p>
  142. </section2>
  143. </section1>
  144. <section1 topic='Security Considerations' anchor='security'>
  145. <p>PENDING</p>
  146. </section1>
  147. <section1 topic='IANA Considerations' anchor='iana'>
  148. <p>This document requires no interaction with the Internet Assigned Numbers Authority (IANA).</p>
  149. </section1>
  150. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  151. <p>REQUIRED.</p>
  152. </section1>
  153. <section1 topic='XML Schema' anchor='schema'>
  154. <p>This protocol doesn't define any XML stanzas.</p>
  155. </section1>
  156. </xep>