diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2015-11-25 00:05:24 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2015-11-25 00:05:24 +0100 |
commit | fee2530b1c2571a2c24e109d7c142889764eca9f (patch) | |
tree | a288c8df2bff25848d4df16ce0ae84b071650f83 /src/mod_muc_room.erl | |
parent | Make JID related functions from jlib.erl deprecated (diff) |
Always use occupant JID as 'from' for room subject
When sending the room subject to a new participant, always use the
occupant JID that corresponds to the subject author as the 'from'
address. It was already done this way when the subject was sent as part
of the room history.
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index aca32738..bc712b35 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2475,14 +2475,15 @@ send_history(JID, Shift, StateData) -> lqueue_to_list(StateData#state.history))). send_subject(_JID, #state{subject_author = <<"">>}) -> ok; -send_subject(JID, StateData) -> +send_subject(JID, #state{subject_author = Nick} = StateData) -> Subject = StateData#state.subject, Packet = #xmlel{name = <<"message">>, attrs = [{<<"type">>, <<"groupchat">>}], children = [#xmlel{name = <<"subject">>, attrs = [], children = [{xmlcdata, Subject}]}]}, - ejabberd_router:route(StateData#state.jid, JID, Packet). + ejabberd_router:route(jid:replace_resource(StateData#state.jid, Nick), JID, + Packet). check_subject(Packet) -> case xml:get_subtag(Packet, <<"subject">>) of |