aboutsummaryrefslogtreecommitdiff
path: root/src/mod_push.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_push.erl')
-rw-r--r--src/mod_push.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mod_push.erl b/src/mod_push.erl
index a6e871375..2cf34f65f 100644
--- a/src/mod_push.erl
+++ b/src/mod_push.erl
@@ -682,8 +682,13 @@ get_body_text(#message{body = Body} = Msg) ->
end.
-spec body_is_encrypted(message()) -> boolean().
-body_is_encrypted(#message{sub_els = SubEls}) ->
- lists:keyfind(<<"encrypted">>, #xmlel.name, SubEls) /= false.
+body_is_encrypted(#message{sub_els = MsgEls}) ->
+ case lists:keyfind(<<"encrypted">>, #xmlel.name, MsgEls) of
+ #xmlel{children = EncEls} ->
+ lists:keyfind(<<"payload">>, #xmlel.name, EncEls) /= false;
+ false ->
+ false
+ end.
-spec inspect_error(iq()) -> {atom(), binary()}.
inspect_error(IQ) ->