25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

Use MUC domain for 'by' attribute of <stanza-id/>

Let mod_mam specify only the domain part of the room JID in the 'by'
attribute of <stanza-id/> tags.
This commit is contained in:
Holger Weiss 2015-12-15 21:37:41 +01:00
parent 0e330da2a6
commit 11ad96fced

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