From 5c3074c0fb28bb04a74cd9f44bf0a8ecc3bd8312 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 5 Jun 2016 22:04:38 +0200 Subject: mod_client_state: Fix handling of chat states Fix the check for chat states sent from other resources of the same user. --- src/mod_client_state.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mod_client_state.erl b/src/mod_client_state.erl index 84f501bb6..68a276ca7 100644 --- a/src/mod_client_state.erl +++ b/src/mod_client_state.erl @@ -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 -- cgit v1.2.3