24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-18 22:15:20 +02:00

Ignore <delay/> when checking for chat states

Ignore XEP-0203 elements when checking whether a message stanza is a
standalone chat state.
This commit is contained in:
Holger Weiss 2016-06-03 19:02:26 +02:00
parent 5c1db176a9
commit 3a1fc6fb66

View File

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