多播服务并不是将所有“到”属性传递给地址节的所有收件人。
UserA向UserB和UserC发送数据包
<message type="chat" to="multicast.example.com" id="">
<addresses xmlns="http://jabber.org/protocol/address">
<address type="to" jid="UserB@example.com"/>
<address type="to" jid="UserC@example.com"/>
</addresses>
<body>One</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
</message>然而,UserB接收
<message xmlns="jabber:client" from="UserA@example.com/iPhone" to="UserB@example.com" type="chat" id="">
<addresses xmlns="http://jabber.org/protocol/address">
<address type="to" jid="UserB@example.com"/>
</addresses>
<body>One</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
</message>而UserC接收
<message xmlns="jabber:client" from="UserA@example.com/iPhone" to="UserC@example.com" type="chat" id="">
<addresses xmlns="http://jabber.org/protocol/address">
<address type="to" jid="UserC@example.com"/>
</addresses>
<body>One</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
</message>因此,UserB和UserC在address节中相互缺少'to'属性。
我使用ejabberd 16.01,我使用https://docs.ejabberd.im/admin/guide/configuration/#modmulticast来配置
发布于 2016-03-09 12:13:36
试试这个零钱。这很奇怪,因为这些台词很多年前就没变过了。也许这个bug在别的地方,而这只是一个解决办法:
--- a/src/mod_multicast.erl
+++ b/src/mod_multicast.erl
@@ -599,7 +599,7 @@ add_addresses(Delivereds, Groups) ->
add_addresses2(_, [], Res, _, []) -> Res;
add_addresses2(Delivereds, [Group | Groups], Res, Pa,
[Pi | Pz]) ->
- Addresses = lists:append([Delivereds] ++ Pa ++ Pz),
+ Addresses = lists:append([Delivereds] ++ Pa ++ [Pi] ++ Pz),
Group2 = Group#group{addresses = Addresses},
add_addresses2(Delivereds, Groups, [Group2 | Res],
[Pi | Pa], Pz).
@@ -655,7 +655,7 @@ route_packet_multicast(From, ToS, Packet, AAttrs, Dests,
route_packet2(From, ToS, Dests, Packet, AAttrs,
Addresses) ->
#xmlel{name = T, attrs = A, children = C} = Packet,
- C2 = case append_dests(Dests, Addresses) of
+ C2 = case Addresses of
[] -> C;
ACs ->
[#xmlel{name = <<"addresses">>, attrs = AAttrs,https://stackoverflow.com/questions/35851353
复制相似问题