25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

mod_client_state: Fix handling of chat states

Fix the check for chat states sent from other resources of the same
user.
This commit is contained in:
Holger Weiss 2016-06-05 22:04:38 +02:00
parent 4789ddf1ee
commit 5c3074c0fb

View File

@ -165,11 +165,10 @@ filter_presence(Acc, _Host, _Stanza) -> Acc.
filter_chat_states({C2SState, _OutStanzas} = Acc, Host,
#xmlel{name = <<"message">>} = Stanza) ->
Payload = jlib:unwrap_carbon(Stanza),
case jlib:is_standalone_chat_state(Payload) of
case jlib:is_standalone_chat_state(jlib:unwrap_carbon(Stanza)) of
true ->
From = fxml:get_tag_attr_s(<<"from">>, Payload),
To = fxml:get_tag_attr_s(<<"to">>, Payload),
From = fxml:get_tag_attr_s(<<"from">>, Stanza),
To = fxml:get_tag_attr_s(<<"to">>, Stanza),
case {jid:from_string(From), jid:from_string(To)} of
{#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}} ->
%% Don't queue (carbon copies of) chat states from other