aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2017-08-25 12:44:53 +0200
committerBadlop <badlop@process-one.net>2017-08-25 12:44:53 +0200
commit68dee8cbb3d6d60dc9607d28037c40cf545d8dbc (patch)
tree556bf03c2da82ffefbd48cda7a43d0b659807f79 /src
parentFix a typo (diff)
Fix deletion of multiple offline messages using WebAdmin (#1962)
Diffstat (limited to 'src')
-rw-r--r--src/mod_offline.erl27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/mod_offline.erl b/src/mod_offline.erl
index 0be61f71f..5b95fe4b4 100644
--- a/src/mod_offline.erl
+++ b/src/mod_offline.erl
@@ -706,22 +706,25 @@ user_queue_parse_query(LUser, LServer, Query) ->
Mod = gen_mod:db_mod(LServer, ?MODULE),
case lists:keysearch(<<"delete">>, 1, Query) of
{value, _} ->
- case lists:keyfind(<<"selected">>, 1, Query) of
- {_, Seq} ->
- case catch binary_to_integer(Seq) of
- I when is_integer(I), I>=0 ->
- Mod:remove_message(LUser, LServer, I),
- ok;
- _ ->
- nothing
- end;
- false ->
- nothing
- end;
+ user_queue_parse_query(LUser, LServer, Query, Mod);
_ ->
nothing
end.
+user_queue_parse_query(LUser, LServer, Query, Mod) ->
+ case lists:keytake(<<"selected">>, 1, Query) of
+ {value, {_, Seq}, Query2} ->
+ case catch binary_to_integer(Seq) of
+ I when is_integer(I), I>=0 ->
+ Mod:remove_message(LUser, LServer, I);
+ _ ->
+ nothing
+ end,
+ user_queue_parse_query(LUser, LServer, Query2, Mod);
+ false ->
+ nothing
+ end.
+
us_to_list({User, Server}) ->
jid:encode({User, Server, <<"">>}).