mod_multicast 没有向接收者发送正确的地址节

mod_multicast not delivering correct address stanza to receivers

多播服务未将所有 "to" 属性传递给地址节的所有接收者。

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 在地址节中缺少彼此的 'to' 属性。

我使用 ejabberd 16.01,我使用 https://docs.ejabberd.im/admin/guide/configuration/#modmulticast 配置

试试这个改变。这很奇怪,因为这些台词从很多年前就没有改变过。也许错误在其他地方,这只是一个解决方法:

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