mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-30 16:36:29 +01:00
Allow node creation without configure item
SVN Revision: 1964
This commit is contained in:
parent
592c98fd7a
commit
ab2dc5877f
@ -929,8 +929,10 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, _Lang, Access, Plugins) ->
|
||||
end,
|
||||
case {IQType, Name} of
|
||||
{set, 'create'} ->
|
||||
case Configuration of
|
||||
[#xmlel{name = 'configure', children = Config}] ->
|
||||
Config = case Configuration of
|
||||
[#xmlel{name = 'configure', children = C}] -> C;
|
||||
_ -> []
|
||||
end,
|
||||
%% Get the type of the node
|
||||
Type = case exmpp_xml:get_attribute_from_list_as_list(Attrs, 'type', "") of
|
||||
[] -> hd(Plugins);
|
||||
@ -947,13 +949,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, 'bad-request'}
|
||||
end;
|
||||
{set, 'publish'} ->
|
||||
case exmpp_xml:remove_cdata_from_list(Els) of
|
||||
[#xmlel{name = 'item', attrs = ItemAttrs, children = Payload}] ->
|
||||
|
Loading…
Reference in New Issue
Block a user