1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

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.
This commit is contained in:
Holger Weiss 2016-04-24 17:16:28 +02:00
parent beeb1c82d9
commit b79f09d0eb

View file

@ -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.