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:
parent
f7e8d287d5
commit
68dee8cbb3
@ -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, <<"">>}).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user