mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-21 16:55:07 -05:00
135 lines
7.2 KiB
XML
135 lines
7.2 KiB
XML
<?xml version='1.0' encoding='UTF-8'?>
|
|
<!DOCTYPE xep SYSTEM 'xep.dtd' [
|
|
<!ENTITY % ents SYSTEM 'xep.ent'>
|
|
%ents;
|
|
]>
|
|
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
|
|
<xep>
|
|
<header>
|
|
<title>MUC Fast Reconnect</title>
|
|
<abstract>This document provides a protocol that can be used for limiting the amount of presence history needed when rejoining a MUC room.</abstract>
|
|
&LEGALNOTICE;
|
|
<number>0311</number>
|
|
<status>ProtoXEP</status>
|
|
<type>Standards Track</type>
|
|
<sig>Standards</sig>
|
|
<approver>Council</approver>
|
|
<dependencies>
|
|
<spec>XMPP Core</spec>
|
|
</dependencies>
|
|
<supersedes/>
|
|
<supersededby/>
|
|
<shortname>MFR</shortname>
|
|
&ksmithisode;
|
|
<revision>
|
|
<version>0.1</version>
|
|
<date>2012-01-10</date>
|
|
<initials>psa</initials>
|
|
<remark><p>Initial published version.</p></remark>
|
|
</revision>
|
|
<revision>
|
|
<version>0.0.1</version>
|
|
<date>2012-01-05</date>
|
|
<initials>kis</initials>
|
|
<remark><p>Initial published version.</p></remark>
|
|
</revision>
|
|
</header>
|
|
<section1 topic='Introduction' anchor='intro'>
|
|
<p>A client joining a &xep0045; room involves the receipt of a significant volume of data in the form of presence from the current room occupants, and past ("context" or "history") messages. If the client has recently been in the room (for example if it has needed to reconnect only because of a networking error) it may already know most of the current state, and receipt of these data will redundant. XEP-0045 provides a method for limiting the context messages received when joining but no method for limiting the duplication of known presence; this document expands slightly upon the former and provides the latter.</p>
|
|
</section1>
|
|
Appropriate action - alert user, attempt to rejoin MUC, whatever.
|
|
<section1 topic='Requirements' anchor='reqs'>
|
|
<p>Reduce the volume of data sent to a client .</p>
|
|
</section1>
|
|
|
|
<section1 topic='Discovery' anchor='discovery'>
|
|
<p>MUC Rooms supporting this should have a disco feature of "urn:xmpp:presence-session:0" in caps.</p>
|
|
<p>To avoid extra roundtrips for discovery, clients may speculatively send elements when initially joining a MUC, and treat the absense of appropriate elements in the responses to indicate a lack of support.</p>
|
|
</section1>
|
|
|
|
<section1 topic='Use Cases' anchor='usecases'>
|
|
<section2 topic='Initial Join' anchor='initial'>
|
|
<p>In this example, Romeo (romeo@montague.lit) is joining the MUC room orchard@chats.capulet.lit. To use MUC Fast Reconnect for future joins, the initial MUC join presence stanza must also contain a presence-session element in the namespace "urn:xmpp:presence-session:0" with no attributes.</p>
|
|
<example caption="Romeo sends 'room join' presence" ><![CDATA[
|
|
<presence
|
|
from='romeo@montague.lit/lane'
|
|
to='orchard@chat.capulet.lit/Romeo'>
|
|
<x xmlns='http://jabber.org/protocol/muc'/>
|
|
<presence-session xmlns="urn:xmpp:presence-session:0"/>
|
|
</presence>
|
|
]]></example>
|
|
<p>If a client has indicated that it's using MUC Fast Reconnect on its session, the MUC service MUST annotate the presence stanzas it sends with elements containing a presence-session element with namespace "urn:xmpp:presence-session:0", a "session" attribute and an "id" attribute, described below.</p>
|
|
<example caption="Romeo receives an occupant's presence" ><![CDATA[
|
|
<presence
|
|
from='orchard@chat.capulet.lit/Juliet'
|
|
to='romeo@montague.lit/lane'>
|
|
<x xmlns='http://jabber.org/protocol/muc#user'>
|
|
<item affiliation='owner' role='moderator'/>
|
|
</x>
|
|
<presence-session xmlns="urn:xmpp:presence-session:0" session="u8e8t2thu" id="893oehh"/>
|
|
</presence>
|
|
]]></example>
|
|
<p>Attributes:</p>
|
|
<ul>
|
|
<li>session: This is an opaque, string, identifier provider by the MUC room and may be used by the server to distinguish between stanzas that will potentially have the same id, but be for logically different rooms (e.g. because the room was deleted and another created with the same name).</li>
|
|
<li>id: This, paired with the session, gives a unique identifier for every presence update.</li>
|
|
</ul>
|
|
</section2>
|
|
<section2 topic="Fast rejoin" anchor = "rejoin">
|
|
<p>If Romeo then leaves the room and wants to rejoin, his client can attempt a fast rejoin by requesting only the presence changes since he was last an occupant, by including in his room join stanza a presence-session-resume element, again with namespace "urn:xmpp:presence-session:0", and the session and id attributes of the last presence it received from the room prior to leaving.</p>
|
|
<example caption="Romeo performs a fast rejoin on the room" ><![CDATA[
|
|
<presence
|
|
from='romeo@montague.lit/lane'
|
|
to='orchard@chat.capulet.lit/Romeo'>
|
|
<x xmlns='http://jabber.org/protocol/muc'/>
|
|
<presence-session-resume xmlns="urn:xmpp:presence-session:0" session="u8e8t2thu" id="893oehh"/>
|
|
</presence>
|
|
]]></example>
|
|
<p>When the MUC room receives a room fast rejoin request, it must either first send an 'unavailable' presence from the room's bare JID, followed by a normal full join, as above, or instead of sending the full presence list for all occupants, only send those stanzas needed to get from the state represented by the client-provided session and id to the current state. All the presence stanzas (apart from the unavailable one used to reset state before a clean join) MUST contain the presence-session element as described above.</p>
|
|
<example caption="Romeo receives an 'unavailable' presence from the room, indicating that it is a clean join." ><![CDATA[
|
|
<presence
|
|
to='romeo@montague.lit/lane'
|
|
from='orchard@chat.capulet.lit'
|
|
type='unavailable'/>
|
|
]]></example>
|
|
<p>The room SHOULD only send the unavailable presence, forcing a sending of all the occupants' presence, if it would either result in fewer transmitted stanzas than sending the necessary delta, or it is unable to provide the necessary delta (such as if too much time has past and it no longer has records of the old state).</p>
|
|
</section2>
|
|
|
|
<section2 topic='Requesting only unseen messages' anchor='unseenmessages'>
|
|
<p>XEP-0045 provides several ways to limit the history/context messages received on join, but none of these allow a client to accurately request only the messages they have yet to see. This is done by the MUC annotating each message with an id (like in presence, above), and the client using it instead of maxchars/maxstanzas/seconds/since from -45 when it joins. And here I've just stopped writing.</p>
|
|
<example caption="Romeo requests only unseen messages" ><![CDATA[
|
|
Here
|
|
]]></example>
|
|
|
|
</section2>
|
|
</section1>
|
|
|
|
|
|
<!--<section1 topic='Business Rules' anchor='rules'>
|
|
<ul>
|
|
<li>.</li>
|
|
</ul>
|
|
</section1>-->
|
|
<!--<section1 topic='Implementation Notes' anchor='impl'>
|
|
<p>OPTIONAL.</p>
|
|
</section1>
|
|
<section1 topic='Accessibility Considerations' anchor='access'>
|
|
<p>OPTIONAL.</p>
|
|
</section1>
|
|
<section1 topic='Internationalization Considerations' anchor='i18n'>
|
|
<p>OPTIONAL.</p>
|
|
</section1>-->
|
|
<section1 topic='Security Considerations' anchor='security'>
|
|
<p>To follow.</p>
|
|
</section1>
|
|
<section1 topic='IANA Considerations' anchor='iana'>
|
|
<p>None.</p>
|
|
</section1>
|
|
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
|
<p>Needs a namespace.</p>
|
|
</section1>
|
|
<section1 topic='XML Schema' anchor='schema'>
|
|
<p>When advanced.</p>
|
|
</section1>
|
|
</xep>
|