%ents; ]>
Best Practices for Message Threads This specification defines recommended handling of XMPP message threads. &LEGALNOTICE; 0201 Proposed 2010-07-30 Informational Standards Council XMPP Core N/A &stpeter; &ianpaterson; &ksmith; 0.7 2010-07-12 psa

Removed definition of ThreadID syntax, semantics, and uniqueness because rfc3921bis covers those topics.

0.6 2010-05-21 psa

Simplified several handling rules; removed ThreadID SHIM header for IQ stanzas; removed implementation note about In-Reply-To SHIM header; removed references to XEP-0155; corrected some errors; harmonized text with rfc3921bis in coordination with editor's review.

0.5 2008-02-06 psa

Defined parent attribute and provided recommendations regarding creation of new threads and child threads.

0.4 2007-08-30 psa

Specified handling of thread IDs on groupchat messages.

0.3 2007-01-29 ip

Described handling of unavailable presence and chat messages without thread IDs; minor changes.

0.2 2007-01-23 psa/ks

Equalized treatment of different message types (chat and groupchat not preferred over normal); required the use of UUIDs; specified use of In-Reply-To header; added Kevin Smith as co-author.

0.1 2006-12-20 psa

Initial version.

0.0.2 2006-12-14 psa Corrected SHIM example; added XMPP Registrar considerations. 0.0.1 2006-12-13 psa/ip First draft.

Although message threads are re-used in XMPP extension protocols such as &xep0085;, best practices for generating and handling message threads have never been well specified (e.g., in &rfc3921; or &rfc3921bis;). This document attempts to clearly specify those matters for implementation by XMPP clients.

Threads matter because they enable XMPP clients to:

Depending on the type of the message (i.e., the value of the 'type' attribute), the <thread/> should be included as follows:

Message Type Inclusion
chat RECOMMENDED
groupchat RECOMMENDED
headline OPTIONAL
normal OPTIONAL

Unless a <message/> stanza is written in direct reply to another <message/> stanza, if a ThreadID is included then its value SHOULD be newly generated when a human user initiates a chat conversation with another user (i.e., a <message/> stanza of type 'chat'), starts a new conversation in the context of a multi-user chat environment (i.e., a <message/> stanza of type 'groupchat'), or sends a normal message.

If the <message/> stanza is written in direct reply to another <message/> stanza, then the ThreadID SHOULD be the value from the the original <message/> stanza. (Determining what constitutes a <message/> stanza written in reply to another is a matter left to individual implementation, but it is envisaged that in most cases it would be the result of, e.g., the user clicking a 'reply' button when reading the contents of the previous stanza.)

In some situations, the conversation veers from the original topic. In this situation, it can be sensible to generate a new thread that is an offshoot or child of the original thread. The connection of the child thread to the parent thread SHOULD be indicated by including the original ThreadID as the value of the 'parent' attribute.

Art thou not Romeo, and a Montague? e0ffe42b28561960c6b12b944a092794b9683a38 ]]>

In the context of <message/> stanzas of type "chat" exchanged between two entities, the value of the <thread/> element shall be considered equivalent to a unique identifier for the chat session or conversation thread. If an entity receives such a message with a new or unknown ThreadID, it SHOULD treat the message as part of a session with unnegotiated parameters. A client MAY destroy the thread when it goes offline, but SHOULD NOT destroy the thread if a human user merely disengages from the chat session (e.g., by closing a window in a client interface).

If an entity receives an XMPP presence stanza of type "unavailable" from the other entity during a chat session, it SHOULD NOT destroy the thread; instead, it SHOULD assume that the other entity will still be able to continue the session (perhaps the other entity was temporarily disconnected by a network error or is persisting the state of the session until it reconnects and receives "offline" messages).

If an entity receives a message of type "chat" without a thread ID, then it SHOULD create a new session with a new thread ID (and include that thread ID in all the messages it sends within the new session).

In the context of <message/> stanzas of type "groupchat" exchanged between multiple entities in a &xep0045; room or similar environment, the value of the <thread/> element shall be considered equivalent to a unique identifier for a conversation thread in the multi-user environment.

When displaying a threaded groupchat conversation within a user interface, a client SHOULD provide a visual indication of the thread to which a message belongs. Methods for such indications include (non-exhaustively) the grouping together of all messages from the same thread, providing an index of threads, or formatting all messages within a thread in a cohesive manner, e.g. with uniform coloring.

There are no special handling requirements related to threads in the context of <message/> stanzas of type "headline".

There are no special handling requirements related to threads in the context of <message/> stanzas of type "normal".

When displaying historical conversations within a user interface, a client SHOULD provide a visual indication of the thread to which a message belongs. Methods for such indications include (non-exhaustively) the grouping together of all messages from the same thread, providing an index of threads, or formatting all messages within a thread in a cohesive manner, e.g. with uniform coloring.

An application that generates a UUID for use as the ThreadID MUST ensure that the UUID does not reveal identifying information about the entity (e.g., the MAC address of the device on which the XMPP application is running).

This document requires no interaction with &IANA;.

This document requires no interaction with the ®ISTRAR;.