diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-09-14 00:18:17 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-09-14 00:18:17 +0200 |
commit | adf0d7de91fe0b4ecce53838ed2aecca602566ca (patch) | |
tree | 288186b4c0e55d8884b56b4a1e2be8ddee8cc14f /src/mod_muc_room.erl | |
parent | Merge pull request #2605 from af8a524db1/remove_unused_error (diff) |
mod_muc_room: Fix the room's CAPS hash
Don't forget the room's xdata when calculating the CAPS hash.
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index a8811f58a..9983d95ae 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2174,7 +2174,9 @@ send_initial_presences_and_messages(From, Nick, Presence, NewState, OldState) -> send_self_presence(JID, State) -> AvatarHash = (State#state.config)#config.vcard_xupdate, DiscoInfo = make_disco_info(JID, State), - DiscoHash = mod_caps:compute_disco_hash(DiscoInfo, sha), + Extras = iq_disco_info_extras(<<"en">>, State, true), + DiscoInfo1 = DiscoInfo#disco_info{xdata = [Extras]}, + DiscoHash = mod_caps:compute_disco_hash(DiscoInfo1, sha), Els1 = [#caps{hash = <<"sha-1">>, node = ejabberd_config:get_uri(), version = DiscoHash}], @@ -3897,10 +3899,11 @@ process_iq_disco_info(From, #iq{type = get, lang = Lang, try true = mod_caps:is_valid_node(Node), DiscoInfo = make_disco_info(From, StateData), - Hash = mod_caps:compute_disco_hash(DiscoInfo, sha), - Node = <<(ejabberd_config:get_uri())/binary, $#, Hash/binary>>, Extras = iq_disco_info_extras(Lang, StateData, true), - {result, DiscoInfo#disco_info{node = Node, xdata = [Extras]}} + DiscoInfo1 = DiscoInfo#disco_info{xdata = [Extras]}, + Hash = mod_caps:compute_disco_hash(DiscoInfo1, sha), + Node = <<(ejabberd_config:get_uri())/binary, $#, Hash/binary>>, + {result, DiscoInfo1#disco_info{node = Node}} catch _:{badmatch, _} -> Txt = <<"Invalid node name">>, {error, xmpp:err_item_not_found(Txt, Lang)} |