aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2010-11-10 15:15:03 +0100
committerChristophe Romain <christophe.romain@process-one.net>2010-11-10 15:15:03 +0100
commitdfaeb3bc888ba59d563a5b11d2582c0f62fee968 (patch)
tree6c341189ed289a587c6169286d7b384a985a522a /src
parentfix bad plugin order issue injected in previous patch (EJAB-1286) (diff)
populate pubsub#roster_groups_allowed in node configuration options (thanks to Karim Gemayel)(EJAB-1344)
Diffstat (limited to 'src')
-rw-r--r--src/mod_pubsub/mod_pubsub.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl
index d494ebcce..de919ba15 100644
--- a/src/mod_pubsub/mod_pubsub.erl
+++ b/src/mod_pubsub/mod_pubsub.erl
@@ -53,6 +53,7 @@
-include("adhoc.hrl").
-include("jlib.hrl").
-include("pubsub.hrl").
+-include("mod_roster.hrl").
-define(STDTREE, "tree").
-define(STDNODE, "flat").
@@ -3276,12 +3277,22 @@ user_resources(User, Server) ->
%%<li>The service does not support node configuration.</li>
%%<li>The service does not support retrieval of default node configuration.</li>
%%</ul>
-get_configure(Host, ServerHost, Node, From, Lang) ->
+get_configure(Host, ServerHost, Node, #jid{luser = User, lserver = Server} = From, Lang) ->
Action =
fun(#pubsub_node{options = Options, type = Type, id = NodeId}) ->
case node_call(Type, get_affiliation, [NodeId, From]) of
{result, owner} ->
- Groups = ejabberd_hooks:run_fold(roster_groups, ServerHost, [], [ServerHost]),
+ Groups = case lists:member(Server, ?MYHOSTS) of
+ true ->
+ %Roster_Items = ejabberd_hooks:run_fold(roster_get, ServerHost, [], [{User,Server}]),
+ Roster_Groups = lists:foldl(fun
+ (#roster{groups = []}, Acc) -> Acc;
+ (#roster{groups = Item_Groups}, Acc) -> [Item_Groups | Acc]
+ end, [], ejabberd_hooks:run_fold(roster_get, ServerHost, [], [{User,Server}])),
+ lists:usort(Roster_Groups);
+ false ->
+ []
+ end,
{result,
[{xmlelement, "pubsub",
[{"xmlns", ?NS_PUBSUB_OWNER}],