Missing metadata in friend request for offline users

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">>,<<"17032345678jinglebells@chat.chatter.io">>},{<<"jidValue">>,<<"1408123467abcd@chat.chatter.io/MCRJ">>},{<<"profileImageURL">>,<<"https://jabber.chatter.io/profiles/chatapp_profile56646b3323232.232323232.png">>},{<<"age">>,<<"0">>},{<<"gender">>,<<>>},{<<"message">>,<<>>}],[{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]}]}


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.


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

<presence type="subscribe" to="918054824047thj@chat.domain.io">
<profile xmlns="custom:data">
<profileImageURL>https://jabber.domain.io/profiles/slocamo_profile5667ec5aea78e2.08175827.png</profileImageURL>
<age>0</age>
<gender/>
<message/>
<jidValue>918054824047jitu@chat.domain.io/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="918054824047thj@chat.domain.io" to="918054824047jitu@chat.domain.io" type="subscribe">
<status/>
</presence>

let me know how to fix this
链接地址: http://www.djcxy.com/p/93530.html

上一篇: 无法使用xmpp接收群组消息

下一篇: 在离线用户的好友请求中缺少元数据