summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2008-06-18 16:19:18 +0000
committerChristophe Romain <christophe.romain@process-one.net>2008-06-18 16:19:18 +0000
commit638d789ae6dd8c7a39eaa907503cf40e560e9bbb (patch)
treecaf2e533c6edbdf816451360985e2997edcf16f1 /src
parent* src/mod_muc/mod_muc_room.erl: Allow admins to send messages to (diff)
pubsub get_default bugfix (EJAB-656)
SVN Revision: 1358
Diffstat (limited to 'src')
-rw-r--r--src/mod_pubsub/mod_pubsub.erl26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl
index b1a9639b..ffd77009 100644
--- a/src/mod_pubsub/mod_pubsub.erl
+++ b/src/mod_pubsub/mod_pubsub.erl
@@ -2351,22 +2351,14 @@ get_configure(Host, Node, From, Lang) ->
end,
transaction(Host, Node, Action, sync_dirty).
-get_default(Host, Node, From, Lang) ->
- Action =
- fun(#pubsub_node{owners = Owners, type = Type}) ->
- case node_call(Type, get_affiliation, [Host, Node, From]) of
- {result, owner} ->
- Options = node_options(Type),
- {result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB_OWNER}],
- [{xmlelement, "default", [],
- [{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
- get_configure_xfields(Type, Options, Lang, Owners)
- }]}]}]};
- _ ->
- {error, ?ERR_FORBIDDEN}
- end
- end,
- transaction(Host, Node, Action, sync_dirty).
+get_default(Host, _Node, _From, Lang) ->
+ Type = hd(plugins(Host)), % first configured plugin is default
+ Options = node_options(Type),
+ {result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB_OWNER}],
+ [{xmlelement, "default", [],
+ [{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
+ get_configure_xfields(Type, Options, Lang, [])
+ }]}]}]}.
%% Get node option
%% The result depend of the node type plugin system.
@@ -2435,7 +2427,7 @@ max_items(Options) ->
atom_to_list(get_option(Options, Var)),
[atom_to_list(O) || O <- Opts])).
-get_configure_xfields(_Type, Options, _Owners, Lang) ->
+get_configure_xfields(_Type, Options, Lang, _Owners) ->
[?XFIELD("hidden", "", "FORM_TYPE", ?NS_PUBSUB_NODE_CONFIG),
?BOOL_CONFIG_FIELD("Deliver payloads with event notifications", deliver_payloads),
?BOOL_CONFIG_FIELD("Deliver event notifications", deliver_notifications),