aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2016-04-24 17:16:28 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2016-04-24 17:16:28 +0200
commitb79f09d0ebee207c8c9ca0d5865c5aa63a27e3c4 (patch)
treecad4c5411a8ac8ddeaef3aad5839d69c344b8177
parentFix check for standalone chat state notifications (diff)
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.
-rw-r--r--src/jlib.erl6
1 files changed, 2 insertions, 4 deletions
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.