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