1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-25 10:42:19 -05:00

Sort update of preference and subscription

This commit is contained in:
Steve Kille 2016-09-30 17:28:52 +01:00
parent fe4b7c2725
commit 251199ba60

View File

@ -678,8 +678,8 @@
</join> </join>
</iq> </iq>
]]></example> ]]></example>
<p>The channel responds with an IQ-result. This stanza includes the nodes to which the user has been successfully subscribed, as well as the bare JID that will be used for the user in this channel and added to the participant list. If a user cannot be subscribed to one or more of the requested nodes (e.g., because the node does not exist), but can be subscribed to some the response simply lists the nodes successfully subscribed. If none of the nodes requested are successfully subscribed to, an error response is sent indicating the reason that the first node requested was not subscribed to. This response will also include other nodes requested where subscription failed for the same reason. A user may subsequently request subscription to nodes in a channel to which the user was not initially subscribed, by repeating the join operation. If the user is already joined to a channel, the join operation simply modifies the channel subscriptions and settings to new values.</p> <p>The channel responds with an IQ-result. This stanza includes the nodes to which the user has been successfully subscribed, as well as the bare JID that will be used for the user in this channel and added to the participant list. The following example shows the result of the above request when the request is completed in full. </p>
<example caption="Channel Successfully Processes Join"><![CDATA[ <example caption="Channel Processes Join Request in Full"><![CDATA[
<iq type='result' <iq type='result'
from='coven@mix.shakespeare.example' from='coven@mix.shakespeare.example'
to='hag66@shakespeare.example' to='hag66@shakespeare.example'
@ -693,8 +693,14 @@
</join> </join>
</iq> </iq>
]]></example> ]]></example>
<p>As noted, the participant might not be subscribed to all nodes associated with the channel (in this case only messages, participants, and subject).</p>
<example caption="Channel Processes Join With Modifications"><![CDATA[
<p>
If a user cannot be subscribed to one or more of the requested nodes (e.g., because the node does not exist), but can be subscribed to some the response simply lists the nodes successfully subscribed. If none of the nodes requested are successfully subscribed to, an error response is sent indicating the reason that the first node requested was not subscribed to. This response will also include other nodes requested where subscription failed for the same reason. The following response example shows a response to the initial request example where
the participant is not be subscribed to all nodes associated with the channel (in this case only messages, participants, and subject).</p>
<example caption="Channel Processes Join With Some Nodes Not Subscribed To"><![CDATA[
<iq type='result' <iq type='result'
from='hag66@shakespeare.example' from='hag66@shakespeare.example'
to='coven@mix.shakespeare.example' to='coven@mix.shakespeare.example'
@ -706,7 +712,7 @@
</join> </join>
</iq> </iq>
]]></example> ]]></example>
<p>The channel also adds the user to the participants node and sends a notification.</p> <p>The channel also adds the user to the participants node and sends a notification to subscribers to the participants node.</p>
<example caption="Channel Adds User to Participants Node"><![CDATA[ <example caption="Channel Adds User to Participants Node"><![CDATA[
<message from='coven@mix.shakespeare.example' <message from='coven@mix.shakespeare.example'
to='hecate@shakespeare.example' to='hecate@shakespeare.example'
@ -725,6 +731,30 @@
<p> <p>
Following the MIX server side processing, the user's server will usually add the MIX channel to the user's roster using one way presence. This means that the MIX channel will get presence information from the user. This roster entry will lead to correct handling of the user's presence in the MIX channel. If the user does not wish to publish presence and the channel permits this, then this roster addition does not happen. If the channel requires presence and the user removes the channel from the user's roster, the channel MAY remove the user as a channel participant. Following the MIX server side processing, the user's server will usually add the MIX channel to the user's roster using one way presence. This means that the MIX channel will get presence information from the user. This roster entry will lead to correct handling of the user's presence in the MIX channel. If the user does not wish to publish presence and the channel permits this, then this roster addition does not happen. If the channel requires presence and the user removes the channel from the user's roster, the channel MAY remove the user as a channel participant.
</p> </p>
<p>
A user may subsequently modify subscription to nodes in a channel by sending a subscription modification request, as shown in the following example.
</p>
<example caption="User Modifies Subscription Request"><![CDATA[
<iq type='set'
from='hag66@shakespeare.example'
to='coven@mix.shakespeare.example'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<update-subscription xmlns='urn:xmpp:mix:0'>
<subscribe node='urn:xmpp:mix:nodes:messages'/>
</update-subscription>
</iq>
<iq type='result'
from='hag66@shakespeare.example'
to='coven@mix.shakespeare.example'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<update-subscription xmlns='urn:xmpp:mix:0' jid='hag66@shakespeare.example'>
<subscribe node='urn:xmpp:mix:nodes:messages'/>
</update-subscription>
</iq>
]]></example>
</section3> </section3>
<section3 topic="User Preferences and Additional Information" anchor="usecase-visibilty-pref"> <section3 topic="User Preferences and Additional Information" anchor="usecase-visibilty-pref">
@ -784,7 +814,7 @@
<join xmlns='urn:xmpp:mix:0' jid='hag66@shakespeare.example'> <join xmlns='urn:xmpp:mix:0' jid='hag66@shakespeare.example'>
<subscribe node='urn:xmpp:mix:nodes:messages'/> <subscribe node='urn:xmpp:mix:nodes:messages'/>
<subscribe node='urn:xmpp:mix:nodes:presence'/> <subscribe node='urn:xmpp:mix:nodes:presence'/>
<x xmlns='jabber:x:data' type='submit'> <x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'> <field var='FORM_TYPE' type='hidden'>
<value>urn:xmpp:mix:0</value> <value>urn:xmpp:mix:0</value>
</field> </field>
@ -804,6 +834,56 @@
<p>The client may also query the channel in order to find out which user preferences are supported and the options available. This will allow users to set options not specified in the standard. The result is a form template.</p> <p>The client may also query the channel in order to find out which user preferences are supported and the options available. This will allow users to set options not specified in the standard. The result is a form template.</p>
<example caption="User Requests and Recieves Preferences Template Form"><![CDATA[ <example caption="User Requests and Recieves Preferences Template Form"><![CDATA[
<iq type='set'
from='hag66@shakespeare.example'
to='coven@mix.shakespeare.example'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<user-preference xmlns='urn:xmpp:mix:0'/>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>urn:xmpp:mix:0</value>
</field>
<field var='JID Visibility'>
<value>Never</value>
</field>
<field var='Private Messages'>
<value>Allow</value>
</field>
<field var='vCard'>
<value>Block</value>
</field>
</x>
</iq>
<iq type='result'
from='coven@mix.shakespeare.example'
to='hag66@shakespeare.example'
id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
<user-preference xmlns='urn:xmpp:mix:0'>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>urn:xmpp:mix:0</value>
</field>
<field var='JID Visibility'>
<value>Never</value>
</field>
<field var='Private Messages'>
<value>Allow</value>
</field>
<field var='vCard'>
<value>Block</value>
</field>
</x>
</user-preference>
</iq>
]]></example>
<p>
A user may modify preferences using the corresponding set operation.
</p>
<example caption="User Updates Preferences"><![CDATA[
<iq type='get' <iq type='get'
from='hag66@shakespeare.example' from='hag66@shakespeare.example'
to='coven@mix.shakespeare.example' to='coven@mix.shakespeare.example'
@ -833,7 +913,6 @@
</user-preference> </user-preference>
</iq> </iq>
]]></example> ]]></example>
</section3> </section3>
<section3 topic='Leaving a Channel' anchor='usecase-user-leaving'> <section3 topic='Leaving a Channel' anchor='usecase-user-leaving'>