summaryrefslogtreecommitdiff
path: root/src/jlib.erl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2016-06-03 19:02:26 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2016-06-03 19:02:26 +0200
commit3a1fc6fb664aa19360d7bdb4ecbb72fe2dc214dc (patch)
tree77be405d812b00056426c5d126715f0bd6ce01e5 /src/jlib.erl
parentFix "unused variable" warning (diff)
Ignore <delay/> when checking for chat states
Ignore XEP-0203 elements when checking whether a message stanza is a standalone chat state.
Diffstat (limited to 'src/jlib.erl')
-rw-r--r--src/jlib.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jlib.erl b/src/jlib.erl
index bad46898..8fe2b977 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.