aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2019-06-18 11:09:35 +0200
committerBadlop <badlop@process-one.net>2019-06-19 09:30:53 +0200
commitfb77e2e8c0a63e5ac3a3888dfbde92f1057c3089 (patch)
tree8e26287da0e79e429921fdfcec531a69f3b07b43 /src/ejabberd_commands.erl
parentFix support for nonexistent or empty access_commands in ejabberd_xmlrpc (diff)
Add support for backwards compatibility in command argument names (#2908)
Diffstat (limited to '')
-rw-r--r--src/ejabberd_commands.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl
index 921047e9f..d01a88595 100644
--- a/src/ejabberd_commands.erl
+++ b/src/ejabberd_commands.erl
@@ -353,7 +353,7 @@ list_commands(Version) ->
args = Args,
desc = Desc} <- Commands].
--spec get_command_format(atom()) -> {[aterm()], rterm()}.
+-spec get_command_format(atom()) -> {[aterm()], [{atom(),atom()}], rterm()}.
%% @doc Get the format of arguments and result of a command.
get_command_format(Name) ->
@@ -363,19 +363,20 @@ get_command_format(Name, Version) when is_integer(Version) ->
get_command_format(Name, Auth) ->
get_command_format(Name, Auth, ?DEFAULT_VERSION).
--spec get_command_format(atom(), noauth | admin | auth(), integer()) -> {[aterm()], rterm()}.
+-spec get_command_format(atom(), noauth | admin | auth(), integer()) -> {[aterm()], [{atom(),atom()}], rterm()}.
get_command_format(Name, Auth, Version) ->
Admin = is_admin(Name, Auth, #{}),
#ejabberd_commands{args = Args,
result = Result,
+ args_rename = Rename,
policy = Policy} =
get_command_definition(Name, Version),
case Policy of
user when Admin;
Auth == noauth ->
- {[{user, binary}, {server, binary} | Args], Result};
+ {[{user, binary}, {server, binary} | Args], Rename, Result};
_ ->
- {Args, Result}
+ {Args, Rename, Result}
end.
-spec get_command_definition(atom()) -> ejabberd_commands().