Google chat server archive (XEP-0136)

2020-06-30 05:46发布

问题:

I am looking for a way how to retrieve archive of chat messages from google server via using XEP-0136 standard, but I got these results just trying to ask for the feature.

Request:

<iq type="get"><pref xmlns="urn:xmpp:archive"/></iq>

Response:

<iq xmlns="jabber:client" type="error" to="myEmail@gmail.com/9FF72CA7">
    <pref xmlns="urn:xmpp:archive"/>
        <error code="501" type="cancel">
            <feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
        </error>
</iq>

So it looks like google does not implement this feature, but is it true? I don't think so.

The same happened with trying to set invisibility which is definitely supported by Google server.

Request:

<iq type="set" id="invisible1" from="myEmail@gmail.com/00230F07">
    <query xmlns="jabber:iq:privacy">
        <active name="invisible"/>
    </query>
</iq>

Response:

<iq xmlns="jabber:client" type="error" id="invisible1" to="myEmail@gmail.com/00230F07">
    <query xmlns="jabber:iq:privacy">
        <active name="invisible"/>
    </query>
    <error code="501" type="cancel">
        <feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
</iq>

So probably I am doing something wrong. Any help will be appreciated.

回答1:

I've also been looking into this for quite some time now. It appears, as JoSo already pointed out, that there is no way to access the chat history through any XMPP standard. The only interaction with the chat history that is possible via XMPP is enabling or disabling Off-the-Record through a non-standard XMPP extension.

That being said, the official Google Chat clients such as the Chrome extension, their kind of abandoned Windows client and the Android application are able to sync chats. Thus, there must be at least some way to access the chat history from the outside. However, there is no documentation on this feature anywhere and all questions in the Google forums go unanswered. Quite a few people guess that it might be implemented through XEP-0136 as it would make sense, but without any official word it might also be a completely proprietary XMPP extension.

For invisibility, it is supported but Google again goes their own way instead of using the XEP-0016 extension. At least their way is documented here in this case. Thus, just use their google:shared-status namespace to set yourself invisible.

That all being said, trying out any XMPP extensions with Google's chat servers is a real pain as many features are proprietary, use their own awkward extensions instead of the standard or simply are not implemented. At least the documentation for the hand-full of public extensions is quite good.

In case you're looking for official answers from Google, you're also quite of luck. Most of the Google Talk features of third party clients such as Pidgin have been reverse engineered by the developers. Before you ask, their audio/video and filetransfer extensions are also quite some miles off the current standard.



回答2:

Google does safe your chat history. But it is stored in your Google Mail account and not on the XMPP Server, thus XEP-0136 is not available.

As for the status. You are trying to set privacy which is different from presence status as defined in rfc3921 (See http://xmpp.org/rfcs/rfc3921.html). Google does not implement privacy as defined in XEP-0126.



回答3:

Invisibility is actually set through Google-specific "shared status" extension.

Message retrieval is not exposed through XMPP.