mod_deny_omemo: Fix matching of devicelist queries

Devicelist queries don't include an <item/> element.
This commit is contained in:
Holger Weiss 2018-03-26 01:35:36 +02:00
parent d783cc7cca
commit 89c5bc0546
1 changed files with 8 additions and 6 deletions

View File

@ -164,16 +164,18 @@ maybe_reject(El, {#iq{type = Type, lang = Lang} = IQ,
end.
-spec find_omemo_nodes(ps_publish() | ps_items()) -> [binary()].
find_omemo_nodes(#ps_items{node = Node, items = [Item]}) ->
find_omemo_nodes(Node, Item);
find_omemo_nodes(#ps_publish{node = Node, items = [Item]}) ->
find_omemo_nodes(Node, Item);
find_omemo_nodes(#ps_items{node = Node, items = Items}) ->
find_omemo_nodes(Node, Items);
find_omemo_nodes(#ps_publish{node = Node, items = Items}) ->
find_omemo_nodes(Node, Items);
find_omemo_nodes(_) ->
[].
-spec find_omemo_nodes(binary(), ps_item()) -> [binary()].
find_omemo_nodes(<<?DEVICELIST_NODE>> = Node, Item) ->
-spec find_omemo_nodes(binary(), ps_items()) -> [binary()].
find_omemo_nodes(<<?DEVICELIST_NODE>> = Node, [Item]) ->
[Node | find_bundle_nodes(Item)];
find_omemo_nodes(<<?DEVICELIST_NODE>> = Node, []) ->
[Node];
find_omemo_nodes(_Node, _Item) ->
[].