Question

My app used to be able to send Facebook chat messages via the Facebook XMPP chat API.

As pointed out in this question, the expected message format is

<message from="-sender_ID@chat.facebook.com" to="-receiver_ID@chat.facebook.com">
    <body>message body</body>
</message>

About two weeks ago, the Facebook XMPP server suddenly started rejecting messages, returning

<stream:error>
  <invalid-from xmlns="urn:ietf:params:xml:ns:xmpp-streams"/>
</stream:error>

The invalid-from seems to indicate that the format of the sender ID has changed.

One change I noticed: during the various handshakes to establish the xmpp connection, Facebook now returns a Jabber ID in the following format:

<jid>-0@chat.facebook.com/fb_xmpp_script_<somehexstring></jid>

Using this jid as the sender ID doesn't work either though.

Has anyone else encountered this issue and figured out the new format?

Was it helpful?

Solution

Try not putting a from address on your message. The server should add that for you.

OTHER TIPS

The received message is simply an indicator of the users chat state, as defined in XEP-0085 and has no direct relationship to the message you sent. That doesn't mean that the first didn't potentially trigger the second, whatever library you are using may have sent the chatstate as well when you sent the message. This type of message is commonly used in chat clients to indicate that someone you are chatting with is typing a message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top