25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Allow node creation without configure item

SVN Revision: 1963
This commit is contained in:
Christophe Romain 2009-03-04 01:12:10 +00:00
parent 965585eb56
commit b3c39d120f
2 changed files with 24 additions and 24 deletions

View File

@ -1,3 +1,8 @@
2009-03-04 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Allow node creation without configure
iem
2009-03-03 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Add roster subscriptions handling

View File

@ -925,8 +925,10 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, _Lang, Access, Plugins) ->
end,
case {IQType, Name} of
{set, "create"} ->
case Configuration of
[{xmlelement, "configure", _, Config}] ->
Config = case Configuration of
[{xmlelement, "configure", _, C}] -> C;
_ -> []
end,
%% Get the type of the node
Type = case xml:get_attr_s("type", Attrs) of
[] -> hd(Plugins);
@ -943,13 +945,6 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, _Lang, Access, Plugins) ->
create_node(Host, ServerHost, Node, From,
Type, Access, Config)
end;
_ ->
%% this breaks backward compatibility!
%% can not create node without <configure/>
%% but this is the new spec anyway
?INFO_MSG("Node ~p ; invalid configuration: ~p", [Node, Configuration]),
{error, ?ERR_BAD_REQUEST}
end;
{set, "publish"} ->
case xml:remove_cdata(Els) of
[{xmlelement, "item", ItemAttrs, Payload}] ->