From 3a1fc6fb664aa19360d7bdb4ecbb72fe2dc214dc Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 3 Jun 2016 19:02:26 +0200 Subject: Ignore when checking for chat states Ignore XEP-0203 elements when checking whether a message stanza is a standalone chat state. --- src/jlib.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/jlib.erl b/src/jlib.erl index bad46898d..8fe2b9774 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -532,8 +532,10 @@ rsm_encode_count(Count, Arr) -> -spec is_standalone_chat_state(xmlel()) -> boolean(). is_standalone_chat_state(#xmlel{name = <<"message">>, children = Els}) -> + IgnoreNS = [?NS_CHATSTATES, ?NS_DELAY], Stripped = [El || #xmlel{name = Name, attrs = Attrs} = El <- Els, - fxml:get_attr_s(<<"xmlns">>, Attrs) /= ?NS_CHATSTATES, + not lists:member(fxml:get_attr_s(<<"xmlns">>, Attrs), + IgnoreNS), Name /= <<"thread">>], Stripped == []; is_standalone_chat_state(_El) -> false. -- cgit v1.2.3