Right, I'm clear on how to distinguish history messages from others.
And I realize that receiving _any_ non-history message should be a
reliable indicator that the history has finished. But what if after
the history comes in, there's no other message for a while? Is the
subject message (_without_ a <delay>) the right way to identify that?

dan

On Wed, Dec 14, 2011 at 2:53 PM, Peter Saint-Andre <[email protected]> wrote:
> On 12/14/11 12:42 PM, Daniel Dormont wrote:
>> Hi all,
>>
>> I am working on my MUC client and running into a situation where I
>> would like to detect programmatically when the "discussion history"
>> has been fully received. As far as I can tell there isn't a clear way
>> to do this. I've noticed, at least with ejabberd, that if the chat
>> room has a subject, then the subject message is the last message in
>> the history. But is this totally reliable? And what if the room
>> doesn't have a subject?
>
> The forthcoming version [1] of XEP-0045 clarifies this in Section
> 7.2.14. "Discussion History":
>
> ###
>
> Discussion history messages MUST be stamped with Delayed Delivery [14]
> information qualified by the 'urn:xmpp:delay' namespace to indicate that
> they are sent with delayed delivery and to specify the times at which
> they were originally sent. (Note: The 'urn:xmpp:delay' namespace defined
> in XEP-0203 supersedes the older 'jabber:x:delay' namespace defined in
> Legacy Delayed Delivery [15]; some implementations include both formats
> for backward compatibility.)
>
> In a non-anonymous room, the 'from' attribute of a discussion history
> message SHOULD be the full JID of the original sender. In a
> semi-anonymous room, the 'from' attribute MUST be set to the JID of the
> room itself.
>
> The service MUST send all discussion history messages before delivering
> the room subject and any "live" messages sent after the user enters the
> room.
>
> ###
>
> Section 7.2.16. Room Subject also says:
>
> ###
>
> If there is no subject set, the room SHOULD return an empty <subject/>
> element.
>
> Example 42. No Subject
>
> <message
>    from='[email protected]/secondwitch'
>    id='F437C672-D438-4BD3-9BFF-091050D32EE2'
>    to='[email protected]/desktop'
>    type='groupchat'>
>  <subject></subject>
> </message>
>
> ###
>
> It might be better to change that SHOULD to MUST.
>
> /psa
>
> [1] http://xmpp.org/extensions/tmp/xep-0045-1.25.html
>
>

Reply via email to