which is only recommended for a small server with just a few hundred users.
The special member directive \term{@online@}
represents the online users in the virtual host.
-\item[Displayed groups] A list of groups that will be in the rosters of this
- group's members.
+\item[Displayed groups]
+ A list of groups that will be in the rosters of this group's members.
+ A group of other vhost can be identified with \term{groupid@vhost}
\end{description}
Examples:
[]
end ++ get_special_users_groups(Host).
-is_group_enabled(Host, Group) ->
+is_group_enabled(Host1, Group1) ->
+ {Host, Group} = split_grouphost(Host1, Group1),
case catch mnesia:dirty_read(sr_group, {Group, Host}) of
[#sr_group{opts = Opts}] ->
not lists:member(disabled, Opts);
get_group_users(HostB, Group) when is_binary(HostB) ->
get_group_users(binary_to_list(HostB), Group);
-get_group_users(Host, Group) ->
+get_group_users(Host1, Group1) ->
+ {Host, Group} = split_grouphost(Host1, Group1),
case get_group_opt(Host, Group, all_users, false) of
true ->
ejabberd_auth:get_vh_registered_users(Host);
[]
end.
-get_group_name(Host, Group) ->
+get_group_name(Host1, Group1) ->
+ {Host, Group} = split_grouphost(Host1, Group1),
get_group_opt(Host, Group, name, Group).
%% @spec(Host::string)
us_to_list({User, Server}) ->
exmpp_jid:bare_to_list(User, Server).
+
+split_grouphost(Host, Group) ->
+ case string:tokens(Group, "@") of
+ [GroupName, HostName] ->
+ {HostName, GroupName};
+ [_] ->
+ {Host, Group}
+ end.