Skip to content

Commit

Permalink
Update several commands for recent ejabberd_commands changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyshch committed Sep 28, 2015
1 parent 846b520 commit cf975da
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ejabberd_s2s.erl
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,15 @@ commands() ->
desc =
"Number of incoming s2s connections on "
"the node",
policy = admin,
module = ?MODULE, function = incoming_s2s_number,
args = [], result = {s2s_incoming, integer}},
#ejabberd_commands{name = outgoing_s2s_number,
tags = [stats, s2s],
desc =
"Number of outgoing s2s connections on "
"the node",
policy = admin,
module = ?MODULE, function = outgoing_s2s_number,
args = [], result = {s2s_outgoing, integer}}].

Expand Down
5 changes: 4 additions & 1 deletion src/ejabberd_sm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -763,18 +763,21 @@ commands() ->
[#ejabberd_commands{name = connected_users,
tags = [session],
desc = "List all established sessions",
policy = admin,
module = ?MODULE, function = connected_users, args = [],
result = {connected_users, {list, {sessions, string}}}},
#ejabberd_commands{name = connected_users_number,
tags = [session, stats],
desc = "Get the number of established sessions",
policy = admin,
module = ?MODULE, function = connected_users_number,
args = [], result = {num_sessions, integer}},
#ejabberd_commands{name = user_resources,
tags = [session],
desc = "List user's connected resources",
policy = user,
module = ?MODULE, function = user_resources,
args = [{user, binary}, {host, binary}],
args = [],
result = {resources, {list, {resource, string}}}},
#ejabberd_commands{name = kick_user,
tags = [session],
Expand Down
15 changes: 14 additions & 1 deletion src/mod_admin_extra.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ commands() ->

#ejabberd_commands{name = num_active_users, tags = [accounts, stats],
desc = "Get number of users active in the last days",
policy = admin,
module = ?MODULE, function = num_active_users,
args = [{host, binary}, {days, integer}],
result = {users, integer}},
Expand Down Expand Up @@ -173,11 +174,13 @@ commands() ->
result = {res, rescode}},
#ejabberd_commands{name = status_num_host, tags = [session, stats],
desc = "Number of logged users with this status in host",
policy = admin,
module = ?MODULE, function = status_num,
args = [{host, binary}, {status, binary}],
result = {users, integer}},
#ejabberd_commands{name = status_num, tags = [session, stats],
desc = "Number of logged users with this status",
policy = admin,
module = ?MODULE, function = status_num,
args = [{status, binary}],
result = {users, integer}},
Expand Down Expand Up @@ -361,8 +364,9 @@ commands() ->
}}},
#ejabberd_commands{name = get_roster, tags = [roster],
desc = "Get roster of a local user",
policy = user,
module = ?MODULE, function = get_roster,
args = [{user, binary}, {host, binary}],
args = [],
result = {contacts, {list, {contact, {tuple, [
{jid, string},
{nick, string},
Expand Down Expand Up @@ -456,6 +460,13 @@ commands() ->
args = [{user, binary}, {host, binary}, {group, binary}, {grouphost, binary}],
result = {res, rescode}},

#ejabberd_commands{name = get_offline_count,
tags = [offline],
desc = "Get the number of unread offline messages",
policy = user,
module = mod_offline, function = get_queue_length,
args = [],
result = {res, integer}},
#ejabberd_commands{name = send_message, tags = [stanza],
desc = "Send a message to a local or remote bare of full JID",
module = ?MODULE, function = send_message,
Expand All @@ -475,11 +486,13 @@ commands() ->

#ejabberd_commands{name = stats, tags = [stats],
desc = "Get statistical value: registeredusers onlineusers onlineusersnode uptimeseconds",
policy = admin,
module = ?MODULE, function = stats,
args = [{name, binary}],
result = {stat, integer}},
#ejabberd_commands{name = stats_host, tags = [stats],
desc = "Get statistical value for this host: registeredusers onlineusers",
policy = admin,
module = ?MODULE, function = stats,
args = [{name, binary}, {host, binary}],
result = {stat, integer}}
Expand Down
1 change: 1 addition & 0 deletions src/mod_muc_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ commands() ->
[
#ejabberd_commands{name = muc_online_rooms, tags = [muc],
desc = "List existing rooms ('global' to get all vhosts)",
policy = admin,
module = ?MODULE, function = muc_online_rooms,
args = [{host, binary}],
result = {rooms, {list, {room, string}}}},
Expand Down

0 comments on commit cf975da

Please sign in to comment.