How does Google Talk replicate messages across devices?

I'm wondering how (official) GTalk clients manage to show all messages received, even if they were originally used by another client. For example: I logged into GTalk at gmail.com on my laptop and, at the same time, through the official GTalk app on my Android device. A friend sends me a message that is displayed on both the gmail.com client and the Android client. (I think it was originally sent to only one of the clients, but the second client gets the message later)

I recently found out that there is a very similar XMPP feature called Carbons . However, after a quick request to discover the service, Google servers did not advertise this feature. XEP-0313 and XEP-0136 look good too, but the servers don't advertise them either.

Possibly related question: Provide Google Talk message to all registered customers using XMPPPY

+3


source to share


2 answers


When you start a new chat, you should send the first message to users who have a simple Jid. This is what most clients do. When the GTalk server retrieves a chat message on pure Jid, it routes the message to all available resources. For all the following messages in this conversation, clients usually pick up the Resource and send them in full Jids. Then messages should not be copied.

Many other servers do not route the bare Jids message to all resources, but to the most accessible resource, which is the client with the highest priority.



Here is a quote from the RFC:

If there is more than one resource with a non-negative presence priority then the
server MUST either
(a) deliver the message to the "most available" resource or
resources (according to the server implementation-specific algorithm, e.g., treating
the resource or resources with the highest presence priority as "most available") or
(b) deliver the message to all of the non-negative resources. 

      

+2


source


XEP-0280 defines this. As I understand it, it defines a mechanism for notifying all resources from the same user when one of them sends a message to someone. I mean, Alice / pda is sending a message to Bob, so Alice / mobile and Alice / PC will get a copy of the message sent with Alice / pda.

Hope this helps. I am currently looking for a server that implements this and also for a client library. If not, I will implement it myself in both jabberd2 and gloox xmpp libraries.



Greetings,

+1


source







All Articles