1
votes

We are trying to customize the friend request in XMPP (Ejabberd) so that we can send additional metadata in friend request as shown below(shows the request as logged in ejabberd.log file). The issue is when the friend is offline, XMPP does not send the additional metadata (jidValue, profileImageURL etc.) when the friend request is eventually delivered to end user when they come online. But if the friend is online, when the request is sent, all the additional metadata is indeed delivered. Does anybody know why for offline users, the additional metadata is not sent and how it can possibly be resolved?

Here is the log file content:

2015-12-06 18:07:35.127 [debug] <0.1763.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"https://jabber.chatter.io/profiles/chatapp_profile56646b3323232.232323232.png\" age=\"0\" gender=\"\" message=\"\">">>

packet {xmlel,<<"presence">>,[{<<"type">>,<<"subscribe">>},{<<"to">>,<<"[email protected]">>},{<<"jidValue">>,<<"[email protected]/MCRJ">>},{<<"profileImageURL">>,<<"https://jabber.chatter.io/profiles/chatapp_profile56646b3323232.232323232.png">>},{<<"age">>,<<"0">>},{<<"gender">>,<<>>},{<<"message">>,<<>>}],[{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]}]}

2

2 Answers

0
votes

When the friend is not online the friend request is not stored as is: Presence are not store for offline delivery. Instead, ejabberd looks for pending request and generate a new one when the user connects.

I created a ticket to support the feature on ejabberd Github: https://github.com/processone/ejabberd/issues/870

Note that your packet is wrong, as you seem to put your extension on attribute for convenience. They should be on custom subtag, with custom xmlns. What you do is not valid anyway. Customization should look similar the the x xmlns vcard content. The attribute you add are not expected by XMPP in the jabber:client namespace.

0
votes

I had the following XML send from my iOS client code to the other user who was offline

<presence type="subscribe" to="[email protected]">
<profile xmlns="custom:data">
<profileImageURL>https://jabber.domain.io/profiles/slocamo_profile5667ec5aea78e2.08175827.png</profileImageURL>
<age>0</age>
<gender/>
<message/>
<jidValue>[email protected]/jitu</jidValue>
</profile>
<x xmlns="vcard-temp:x:update"><photo/></x>
</presence>

but when the user come's online he only receives the following XML

<presence xmlns="jabber:client" from="[email protected]" to="[email protected]" type="subscribe">
<status/>
</presence>

let me know how to fix this