Smart Markers
This module allows the client to query for the most recent chat markers.
When a client enters a conversation after being offline for a while, such client might want to know what was the last message-id that was marked according to the rules defined in XEP-0333 - Chat Markers, in order to know where he left of, and build an enhanced UI.
MongooseIM provides such functionality, using mod_smart_markers
Namespace
1 |
|
Fetching a conversation's latest markers
Given a peer, i.e., another user or a muc room, we can fetch the marker we last sent, to the main thread or any other sub-thread, with an IQ like the following:
1 2 3 |
|
<peer-bare-jid>
MUST be the bare jid of the peer whose last marker wants to be checked. It can be the bare jid of a user, or of MUC room.<thread>
is an optional attribute that indicates if the check refers to specific a thread in the conversation. If not provided, defaults to the main conversation thread.<after>
is an optional attribute indicating whether markers sent only after a certain timestamp are desired. This most often makes sense for big groupchats, as a potential filter to reduce the amount of markers that will be returned.
Then the following would be received, was there to be any marker:
1 2 3 4 5 |
|
peer-bare-jid
matches the requested bare jid and the subelements are marker
xml payloads with the following attributes:
<id>
is the message id associated to this marker.<type>
is a marker as described in XEP-0333.<timestamp>
contains an RFC3339 timestamp indicating when the marker was sent<thread>
is an optional attribute that indicates if the marker refers to specific a thread in the conversation, or the main conversation if absent.<sender-bare-jid>
is the bare jid of the peer who sent the marker, which can be the requester itself, or any peer in the conversation, for both 1:1 chats or groupchats.
Example: 1:1
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Example: groupchats
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|