Google chat server archive (XEP-0136) - xmpp

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.

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.

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.

Invisibility is actually set through Google-specific "shared status" extension.
Message retrieval is not exposed through XMPP.

Related

Does Facebook XMPP Chat server implement message archiving? (XEP-0136)

I'm working with Facebook's XMPP chat service, and I need to fetch older messages from the server. Can I use XEP-0136 on the client to do that or is there another more used way?
Just figured out myself Facebook does not implement that feature. I got this reply sending an IQ:
<iq xmlns='jabber:client' from='chat.facebook.com' to='my.facebook.username#chat.facebook.com/Mac-Pro-di-Michele_65563c5f_4D689E59FB8A5' type='error' id='pref1'>
<pref xmlns='urn:xmpp:archive'/>
<error code='501' type='cancel'>
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
there's no way of knowing and most likely it does not support because facebook is not xmpp compliant. majority of xmpp servers do not support this feature.

Whats the best way to extend XMPP Presence stanza

We were using openfire 3.7.1 as our XMPP server, and we wanted to extend the Presence stanza to include some extra information like:
<presence from="you#MyServer.com">
<body>...</body>
<custom_element>
<custom_data/>
</custom_element>
</presence>
Could you please show me some pointers as what would be a better approach to do so? E.g., should I modify or extend some XMPP schema so that openfire will process the above presence packet as usual (currently if I send message like above, openfire seems not taking it as a Presence packet)? And should I create a plugin to intercept all packets so as to process our custom elements?
Thanks in Advance!
This is how it is normally done:
<presence from="you#MyServer.com">
<x xmlms="http://mycompany.com/mycustomnamespace1>
<custom_data/>
</x>
</presence>
Openfire will route such a packet without any problems.
You only need a server plugin when the server has to process any action on this custom elements. When the server should route the presence only to your contacts then nothing is required on the server.

Facebook Chat, XMPP, Setting presence?

When changing the presence in Browser (offline/online) in Facebook Chat, the chat system sends the XMPP message in form:
<presence to="-myidhere#chat.facebook.com/adfskjfskjdfh" from="-otheridhere#chat.facebook.com" type="unavailable">
When I send my own presence from non-browser side (xmpp client) to the browser side with exactly same syntax, it seem not to effect. What I am missing here ?
Thanks a lot,
-Mika
It seems like you can't do that with the facebook xmpp implementation, as they write in the documentation:
Facebook Chat should be compatible with every XMPP client, but is not
a full XMPP server. It should be thought of as a proxy into the world
of Facebook Chat on www.facebook.com. As a result, it has several
behaviors that differ slightly from what you would expect from a
traditional XMPP service
There's an open bug on this matter: XMPP: can't change availability, and also this thread also talks about it: Xmpp chat invisible presence.
Also, don't expect the fb apis to have the same functionality as you get using the fb webpage.
They obviously don't open everything they have to the apis.

Problem creating a chat room with XMPP in an iOS app

I have an iphone app where I want to use chat rooms. I've installed an XMPP server (ejabberd) and downloaded the XMPP framework for iOS from google code (http://code.google.com/p/xmppframework/). The server and client work as expected, since I'm able to log in and send chat messages between two users.
However, when I try to create a chat room using the createOrJoinRoom method of the XMPPRoom class (in XEP-0045), I don't get any reply from the server and the chat room is not created.
I've debugged to see what kind of package is sent to the server and it looks like this:
<presence from="test2#beta.bogus.net/mynick" to="muumit15#conference.beta.bogus.net">
<x xmlns="http://jabber.org/protocol/muc"/>
</presence>
I get no error message back but the chat room (muumit15) is not created. At the same time I can use e.g. Adium client to create a chat room and it succeeds. The server has been configured so that every user has a right to create chat rooms.
Any ideas? I even tried sniffing the TCP/IP traffic sent by the Adium client but that was encrypted/compressed/binary so I couldn't see what kind of packages it is sending.
See section 7.2.2 of XEP-0045, particularly Example 18:
<presence
from='hag66#shakespeare.lit/pda'
to='coven#chat.shakespeare.lit/thirdwitch'>
<x xmlns='http://jabber.org/protocol/muc'/>
</presence>
Note that the to address MUST contain a resource, and yours doesn't. The resource is the string after the /, which is used as your nickname in the room. For more information on the XMPP address format, see RFC 6122.

user profile from XMPP iPhone

I am using XMPP for chatting in my iPhone application, I need to retrieve the profile of every user in buddy list, like phone number, street address etc.
How can I get started?
While XEP-54 can be used for this purpose, PLEASE do not spam the network by making vcard-temp requests for everyone on your roster every time your client logs in. Since you haven't told us what client library you're using, all we can do is provide you with the protocol you need to send:
<iq id='v1'
type='get'>
<vCard xmlns='vcard-temp'/>
</iq>
Note that XEP-54 is about to be obsoleted by XEP-292, but it will take several years for that transition to take place.