diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index 00ff2d8f9..abbed635d 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -664,7 +664,8 @@ get_commands_spec() -> "name desc \\\"group1\\\\ngroup2\\\"", module = ?MODULE, function = srg_create, 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">>, <<"Third group">>, <<"group1\\\\ngroup2">>], args_desc = ["Group identifier", "Group server name", "Group name", @@ -1456,12 +1457,12 @@ private_set2(Username, Host, Xml) -> %%% Shared Roster Groups %%% -srg_create(Group, Host, Name, Description, Display) -> +srg_create(Group, Host, Label, Description, Display) -> DisplayList = case Display of <<>> -> []; _ -> ejabberd_regexp:split(Display, <<"\\\\n">>) end, - Opts = [{name, Name}, + Opts = [{label, Label}, {displayed_groups, DisplayList}, {description, Description}], {atomic, _} = mod_shared_roster:create_group(Host, Group, Opts), diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 3f200986e..16cc96a75 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -713,14 +713,14 @@ add_user_to_group2(Host, US, Group) -> push_user_to_displayed(LUser, LServer, Group, Host, both, DisplayedToGroups), push_displayed_to_user(LUser, LServer, Host, both, DisplayedGroups), Mod = gen_mod:db_mod(Host, ?MODULE), + Mod:add_user_to_group(Host, US, Group), case use_cache(Mod, Host) of true -> ets_cache:delete(?USER_GROUPS_CACHE, {Host, US}, cache_nodes(Mod, Host)), ets_cache:delete(?GROUP_EXPLICIT_USERS_CACHE, {Host, Group}, cache_nodes(Mod, Host)); false -> ok - end, - Mod:add_user_to_group(Host, US, Group) + end end. get_displayed_groups(Group, LServer) -> @@ -749,6 +749,7 @@ remove_user_from_group(Host, US, Group) -> set_group_opts(Host, Group, NewGroupOpts); nomatch -> Mod = gen_mod:db_mod(Host, ?MODULE), + Result = Mod:remove_user_from_group(Host, US, Group), case use_cache(Mod, Host) of true -> ets_cache:delete(?USER_GROUPS_CACHE, {Host, US}, cache_nodes(Mod, Host)), @@ -756,7 +757,6 @@ remove_user_from_group(Host, US, Group) -> false -> ok end, - Result = Mod:remove_user_from_group(Host, US, Group), DisplayedToGroups = displayed_to_groups(Group, Host), DisplayedGroups = get_displayed_groups(Group, LServer), push_user_to_displayed(LUser, LServer, Group, Host, remove, DisplayedToGroups),