]> granicus.if.org Git - ejabberd/commitdiff
Use MUC domain for 'by' attribute of <stanza-id/>
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 15 Dec 2015 20:37:41 +0000 (21:37 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 15 Dec 2015 20:37:41 +0000 (21:37 +0100)
Let mod_mam specify only the domain part of the room JID in the 'by'
attribute of <stanza-id/> tags.

src/mod_mam.erl

index 3d81b0d6667e7b44fa047d205f42293a07442293..54572fb090110e927d71a41ac146b6a71322a82b 100644 (file)
@@ -200,12 +200,12 @@ user_send_packet(Pkt, C2SState, JID, Peer) ->
 muc_filter_message(Pkt, #state{config = Config} = MUCState,
                   RoomJID, From, FromNick) ->
     if Config#config.mam ->
-           By = jid:to_string(RoomJID),
-           NewPkt = strip_my_archived_tag(Pkt, By),
+           LServer = RoomJID#jid.lserver,
+           NewPkt = strip_my_archived_tag(Pkt, LServer),
            case store_muc(MUCState, NewPkt, RoomJID, From, FromNick) of
                {ok, ID} ->
                    StanzaID = #xmlel{name = <<"stanza-id">>,
-                                     attrs = [{<<"by">>, By},
+                                     attrs = [{<<"by">>, LServer},
                                                {<<"xmlns">>, ?NS_SID_0},
                                                {<<"id">>, ID}]},
                     NewEls = [StanzaID|NewPkt#xmlel.children],