From: Holger Weiss Date: Sun, 24 Apr 2016 15:16:28 +0000 (+0200) Subject: Match namespace when checking for chat states X-Git-Tag: 16.04~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b79f09d0ebee207c8c9ca0d5865c5aa63a27e3c4;p=ejabberd Match namespace when checking for chat states When checking for standalone chat states, match the namespace rather than the names of the elements defined in the current XEP-0085 revision. --- diff --git a/src/jlib.erl b/src/jlib.erl index 407f43f17..7bea7bb11 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -531,10 +531,8 @@ rsm_encode_count(Count, Arr) -> -spec is_standalone_chat_state(xmlel()) -> boolean(). is_standalone_chat_state(#xmlel{name = <<"message">>, children = Els}) -> - ChatStates = [<<"active">>, <<"inactive">>, <<"gone">>, <<"composing">>, - <<"paused">>], - Stripped = [El || #xmlel{name = Name} = El <- Els, - not lists:member(Name, ChatStates), + Stripped = [El || #xmlel{name = Name, attrs = Attrs} = El <- Els, + fxml:get_attr_s(<<"xmlns">>, Attrs) /= ?NS_CHATSTATES, Name /= <<"thread">>], Stripped == []; is_standalone_chat_state(_El) -> false.