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

update srg_create API to use label parameter instead of name

This commit is contained in:
Jindrich Sarson 2021-04-17 18:49:26 +02:00
parent e462f0a584
commit c10e4fa275

View File

@ -664,7 +664,8 @@ get_commands_spec() ->
"name desc \\\"group1\\\\ngroup2\\\"", "name desc \\\"group1\\\\ngroup2\\\"",
module = ?MODULE, function = srg_create, module = ?MODULE, function = srg_create,
args = [{group, binary}, {host, binary}, args = [{group, binary}, {host, binary},
{name, binary}, {description, binary}, {display, binary}], {label, binary}, {description, binary}, {display, binary}],
args_rename = [{name, label}],
args_example = [<<"group3">>, <<"myserver.com">>, <<"Group3">>, args_example = [<<"group3">>, <<"myserver.com">>, <<"Group3">>,
<<"Third group">>, <<"group1\\\\ngroup2">>], <<"Third group">>, <<"group1\\\\ngroup2">>],
args_desc = ["Group identifier", "Group server name", "Group name", args_desc = ["Group identifier", "Group server name", "Group name",
@ -1456,12 +1457,12 @@ private_set2(Username, Host, Xml) ->
%%% Shared Roster Groups %%% Shared Roster Groups
%%% %%%
srg_create(Group, Host, Name, Description, Display) -> srg_create(Group, Host, Label, Description, Display) ->
DisplayList = case Display of DisplayList = case Display of
<<>> -> []; <<>> -> [];
_ -> ejabberd_regexp:split(Display, <<"\\\\n">>) _ -> ejabberd_regexp:split(Display, <<"\\\\n">>)
end, end,
Opts = [{name, Name}, Opts = [{label, Label},
{displayed_groups, DisplayList}, {displayed_groups, DisplayList},
{description, Description}], {description, Description}],
{atomic, _} = mod_shared_roster:create_group(Host, Group, Opts), {atomic, _} = mod_shared_roster:create_group(Host, Group, Opts),