25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

pubsub get_default bugfix (EJAB-656)

SVN Revision: 1357
This commit is contained in:
Christophe Romain 2008-06-18 16:19:15 +00:00
parent d9241c9e75
commit ab310255d7
2 changed files with 13 additions and 17 deletions

View File

@ -1,3 +1,7 @@
2008-06-18 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: get_default bugfix (EJAB-656)
2008-06-13 Badlop <badlop@process-one.net> 2008-06-13 Badlop <badlop@process-one.net>
* src/ejabberd.cfg.example: Add registration_timeout (EJAB-653) * src/ejabberd.cfg.example: Add registration_timeout (EJAB-653)

View File

@ -2341,22 +2341,14 @@ get_configure(Host, Node, From, Lang) ->
end, end,
transaction(Host, Node, Action, sync_dirty). transaction(Host, Node, Action, sync_dirty).
get_default(Host, Node, From, Lang) -> get_default(Host, _Node, _From, Lang) ->
Action = Type = hd(plugins(Host)), % first configured plugin is default
fun(#pubsub_node{owners = Owners, type = Type}) ->
case node_call(Type, get_affiliation, [Host, Node, From]) of
{result, owner} ->
Options = node_options(Type), Options = node_options(Type),
{result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB_OWNER}], {result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB_OWNER}],
[{xmlelement, "default", [], [{xmlelement, "default", [],
[{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}], [{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
get_configure_xfields(Type, Options, Lang, Owners) get_configure_xfields(Type, Options, Lang, [])
}]}]}]}; }]}]}]}.
_ ->
{error, ?ERR_FORBIDDEN}
end
end,
transaction(Host, Node, Action, sync_dirty).
%% Get node option %% Get node option
%% The result depend of the node type plugin system. %% The result depend of the node type plugin system.
@ -2425,7 +2417,7 @@ max_items(Options) ->
atom_to_list(get_option(Options, Var)), atom_to_list(get_option(Options, Var)),
[atom_to_list(O) || O <- Opts])). [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), [?XFIELD("hidden", "", "FORM_TYPE", ?NS_PUBSUB_NODE_CONFIG),
?BOOL_CONFIG_FIELD("Deliver payloads with event notifications", deliver_payloads), ?BOOL_CONFIG_FIELD("Deliver payloads with event notifications", deliver_payloads),
?BOOL_CONFIG_FIELD("Deliver event notifications", deliver_notifications), ?BOOL_CONFIG_FIELD("Deliver event notifications", deliver_notifications),