110 lines
5.6 KiB
Raw Normal View History

2011-03-21 15:18:12 -04:00
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Best Practices for Resource Locking</title>
<abstract>This document specifies best practices to be followed by Jabber/XMPP clients about when to lock into, and unlock away from, resources.</abstract>
2011-04-11 18:26:37 -04:00
2011-03-21 15:18:12 -04:00
<spec>XMPP Core</spec>
<spec>XMPP IM</spec>
<firstname>Matthew </firstname>
2011-04-11 18:26:37 -04:00
<remark><p>Initial published version.</p></remark>
2011-03-21 15:18:12 -04:00
<remark><p>Initial draft</p></remark>
<section1 topic='Introduction' anchor='intro'>
2011-05-11 11:36:22 -04:00
<p>Section 5.1 of &xmppim; defines the concept of a "one-to-one chat session" and recommends that clients support the behavior described there, including:</p>
2011-03-21 15:18:12 -04:00
<li>Send the first message in a chat session to the bare JID &LOCALBARE; of the intended recipient</li>
<li>Send messages to the full JID &LOCALFULL; only after receiving a reply from the recipient (this is called "locking" into that full JID).</li>
<li>Send messages to the bare JID again if the presence of the recipient changes in any way (this is called "unlocking" from the full JID).</li>
<p>This specification reinforces the recommendations from XMPP-IM and provides additional implementation guidance to developers of XMPP clients. It is hoped that wider deployment of clients that adhere to the advice provided here will result in an improved user experience.</p>
<section1 topic='General Rules' anchor='general'>
<!-- <p>TODO: simple state chart</p> -->
<section2 topic='Initial Conversation State' anchor='general-nolock'>
<p>A client MUST start conversations in the unlocked state. In this state, a client MUST send &MESSAGE;s to a conversee's bare JID.</p>
<section2 topic='Locking a Conversation' anchor='general-lock'>
<p>Once a client receives a chat &MESSAGE; from the conversee, whether or not this client initiated the conversation, it MUST lock the conversation. The client MUST remember the conversee's full JID and send further correspondence to this full JID until one of the unlocking conditions are met.</p>
<section2 topic='Unlocking a Conversation' anchor='general-unlock'>
<p>A client MUST unlock a chat session from a resource when one of the following conditions is met:</p>
<li>A &MESSAGE; from the same bare JID, but a different resource, is received. In this case, the client MAY lock to the new resource; or the client MAY revert to the initial state, sending any following correspondence to the conversee's bare JID.</li>
<li>A &MESSAGE; with a &lt;gone xmlns='http://jabber.org/protocol/chatstates'/&gt; chat state. In this case, the client MUST consider the conversation ended. Any further correspondence MUST be sent with a new threadID and to the bare JID.</li>
<li>any &PRESENCE; update from any resource for the conversee's bare JID, including &lt;presence type='unavailable'/&gt;. The client SHOULD revert to the initial state, sending any following correspondence to the conversee's bare JID.</li>
<section1 topic='User Agent Implementation Notes' anchor='impl'>
<p>This section is non-normative, but provides additional guidelines for clients that interact directly with users.</p>
<section2 topic='User Experience Considerations' anchor='experience'>
<p>To further improve the user experience, clients are strongly encouraged to implement &xep0085; and adhere to the recommendations from &xep0201;.</p>
<section2 topic='Idle Conversations' anchor='idle-chat'>
<p>A client MAY take into account the lack of activity of a conversation. Exactly how much inactivity constitutes an idle conversation is left to implementations to determine.</p>
<section2 topic='Overall Inactivity' anchor='idle-user'>
<p>A client MAY take into account the overall lack of activity of a user, in which case it is RECOMMENDED the client send a &PRESENCE; update to trigger any conversations to unlock. The exact conditions and &PRESENCE; information conveyed is left to implementations to determine.</p>
<!-- <section2 topic='Mobile Considerations' anchor='mobile'>
<p>TODO: notes on mobile clients (aggressiveness of unlocking, interactions with &xep0273;?)</p>
</section2> -->
<section1 topic='Business Rules' anchor='rules'>
<section1 topic='Accessibility Considerations' anchor='access'>
<section1 topic='Internationalization Considerations' anchor='i18n'>
<section1 topic='Security Considerations' anchor='security'>
<section1 topic='IANA Considerations' anchor='iana'>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section1 topic='XML Schema' anchor='schema'>
<p>REQUIRED for protocol specifications.</p>