25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Fix deletion of multiple offline messages using WebAdmin (#1962)

This commit is contained in:
Badlop 2017-08-25 12:44:53 +02:00
parent f7e8d287d5
commit 68dee8cbb3

View File

@ -706,20 +706,23 @@ 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} ->
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),
ok;
Mod:remove_message(LUser, LServer, I);
_ ->
nothing
end;
end,
user_queue_parse_query(LUser, LServer, Query2, Mod);
false ->
nothing
end;
_ ->
nothing
end.
us_to_list({User, Server}) ->