离线用户的好友请求中缺少元数据

Missing metadata in friend request for offline users

我们正在尝试在 XMPP (Ejabberd) 中自定义好友请求,以便我们可以在好友请求中发送额外的元数据,如下所示(显示 ejabberd.log 文件中记录的请求)。问题是,当朋友离线时,XMPP 不会发送额外的元数据(jidValue、profileImageURL 等),而当最终用户在线时,朋友请求最终会传递给最终用户。但是如果朋友在线,当请求被发送时,所有额外的元数据确实被传递了。有谁知道为什么离线用户不发送额外的元数据以及如何解决这个问题?

日志文件内容如下:

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">>,[],[]}]}]}

当朋友不在线时,朋友请求不会按原样存储:不存储状态以供离线传递。相反,ejabberd 会查找挂起的请求并在用户连接时生成一个新请求。

我创建了一个支持 ejabberd 功能的工单Github:https://github.com/processone/ejabberd/issues/870

请注意,您的数据包是错误的,因为您似乎为了方便而将扩展名放在属性上。它们应该位于带有自定义 xmlns 的自定义子标签上。无论如何,您所做的都是无效的。定制应该看起来类似于 x xmlns vcard 内容。 jabber:client 命名空间中的 XMPP 不需要您添加的属性。

我有以下 XML 从我的 iOS 客户端代码发送给离线的其他用户

<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>

但是当用户上线时他只收到以下内容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