aboutsummaryrefslogtreecommitdiff
path: root/src/mod_offline.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-01-23 16:30:16 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-01-23 16:30:16 +0300
commit48d8498dbb7d0313b71a1a79999cfb3024918761 (patch)
tree9391395a6ce258640b10774c8af74ee571407610 /src/mod_offline.erl
parentFix calling to mod_offline:store_packet (diff)
Avoid using maps:get/2 to keep compatibility with OTP 17.5
Diffstat (limited to '')
-rw-r--r--src/mod_offline.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mod_offline.erl b/src/mod_offline.erl
index 43f13a629..61fa65bc5 100644
--- a/src/mod_offline.erl
+++ b/src/mod_offline.erl
@@ -565,10 +565,9 @@ c2s_self_presence({_Pres, #{resend_offline := false}} = Acc) ->
Acc;
c2s_self_presence({#presence{type = available} = NewPres, State} = Acc) ->
NewPrio = get_priority_from_presence(NewPres),
- LastPrio = try maps:get(pres_last, State) of
+ LastPrio = case maps:get(pres_last, State, error) of
+ error -> -1;
LastPres -> get_priority_from_presence(LastPres)
- catch _:{badkey, _} ->
- -1
end,
if LastPrio < 0 andalso NewPrio >= 0 ->
route_offline_messages(State);