25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Mark get_queue_length obsolete, and use count_offline_messages (#970)

This commit is contained in:
Badlop 2016-03-04 11:09:14 +01:00
parent 44978ce978
commit 9c3d57e63e
3 changed files with 6 additions and 6 deletions

View File

@ -1520,8 +1520,7 @@ get_offlinemsg_length(ModOffline, User, Server) ->
case ModOffline of case ModOffline of
none -> <<"disabled">>; none -> <<"disabled">>;
_ -> _ ->
pretty_string_int(ModOffline:get_queue_length(User, pretty_string_int(ModOffline:count_offline_messages(User,Server))
Server))
end. end.
get_offlinemsg_module(Server) -> get_offlinemsg_module(Server) ->

View File

@ -531,7 +531,7 @@ get_commands_spec() ->
tags = [offline], tags = [offline],
desc = "Get the number of unread offline messages", desc = "Get the number of unread offline messages",
policy = user, policy = user,
module = mod_offline, function = get_queue_length, module = mod_offline, function = count_offline_messages,
args = [], args = [],
result = {res, integer}}, result = {res, integer}},
#ejabberd_commands{name = send_message, tags = [stanza], #ejabberd_commands{name = send_message, tags = [stanza],

View File

@ -40,8 +40,6 @@
-behaviour(gen_mod). -behaviour(gen_mod).
-export([count_offline_messages/2]).
-export([start/2, -export([start/2,
start_link/2, start_link/2,
stop/1, stop/1,
@ -61,6 +59,7 @@
import/3, import/3,
export/1, export/1,
get_queue_length/2, get_queue_length/2,
count_offline_messages/2,
get_offline_els/2, get_offline_els/2,
webadmin_page/3, webadmin_page/3,
webadmin_user/4, webadmin_user/4,
@ -70,6 +69,8 @@
handle_info/2, terminate/2, code_change/3, handle_info/2, terminate/2, code_change/3,
mod_opt_type/1]). mod_opt_type/1]).
-deprecated({get_queue_length,2}).
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").
@ -1294,7 +1295,7 @@ get_messages_subset2(Max, Length, MsgsAll, odbc) ->
MsgsFirstN ++ [IntermediateMsg] ++ MsgsLastN. MsgsFirstN ++ [IntermediateMsg] ++ MsgsLastN.
webadmin_user(Acc, User, Server, Lang) -> webadmin_user(Acc, User, Server, Lang) ->
QueueLen = get_queue_length(jid:nodeprep(User), QueueLen = count_offline_messages(jid:nodeprep(User),
jid:nameprep(Server)), jid:nameprep(Server)),
FQueueLen = [?AC(<<"queue/">>, FQueueLen = [?AC(<<"queue/">>,
(iolist_to_binary(integer_to_list(QueueLen))))], (iolist_to_binary(integer_to_list(QueueLen))))],