aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-09-20 16:44:51 +0200
committerBadlop <badlop@process-one.net>2011-09-20 16:44:51 +0200
commit32fc36b17d5f1834b13a24c2256cf0803edd1a25 (patch)
treec43c3542713edb0d0d10fe6727c4c9f0be06eb3c /src
parentNew option support: ldap_deref_aliases (EJAB-639) (diff)
Add support for @online@ to add_user_to_group
Diffstat (limited to 'src')
-rw-r--r--src/mod_shared_roster.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl
index 4b2bd75e2..1043e86e3 100644
--- a/src/mod_shared_roster.erl
+++ b/src/mod_shared_roster.erl
@@ -617,14 +617,15 @@ add_user_to_group(Host, US, Group) ->
case regexp:match(LUser, "^@.+@$") of
{match,_,_} ->
GroupOpts = mod_shared_roster:get_group_opts(Host, Group),
- AllUsersOpt =
- case LUser == "@all@" of
- true -> [{all_users, true}];
- false -> []
+ MoreGroupOpts =
+ case LUser of
+ "@all@" -> [{all_users, true}];
+ "@online@" -> [{online_users, true}];
+ _ -> []
end,
mod_shared_roster:set_group_opts(
Host, Group,
- GroupOpts ++ AllUsersOpt);
+ GroupOpts ++ MoreGroupOpts);
nomatch ->
%% Push this new user to members of groups where this group is displayed
push_user_to_displayed(LUser, LServer, Group, both),
@@ -652,7 +653,9 @@ remove_user_from_group(Host, US, Group) ->
NewGroupOpts =
case LUser of
"@all@" ->
- lists:filter(fun(X) -> X/={all_users,true} end, GroupOpts)
+ lists:filter(fun(X) -> X/={all_users,true} end, GroupOpts);
+ "@online@" ->
+ lists:filter(fun(X) -> X/={online_users,true} end, GroupOpts)
end,
mod_shared_roster:set_group_opts(Host, Group, NewGroupOpts);
nomatch ->