diff options
Diffstat (limited to 'src/mod_pubsub/mod_pubsub_odbc.erl')
-rw-r--r-- | src/mod_pubsub/mod_pubsub_odbc.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mod_pubsub/mod_pubsub_odbc.erl b/src/mod_pubsub/mod_pubsub_odbc.erl index 3396570a..d803395d 100644 --- a/src/mod_pubsub/mod_pubsub_odbc.erl +++ b/src/mod_pubsub/mod_pubsub_odbc.erl @@ -1633,7 +1633,7 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang, Access, Plugins) -> [#xmlel{name = <<"item">>, attrs = ItemAttrs, children = Payload}] -> ItemId = xml:get_attr_s(<<"id">>, ItemAttrs), - publish_item(Host, ServerHost, Node, From, ItemId, Payload); + publish_item(Host, ServerHost, Node, From, ItemId, Payload, Access); [] -> {error, extended_error(?ERR_BAD_REQUEST, <<"item-required">>)}; @@ -2610,8 +2610,10 @@ unsubscribe_node(Host, Node, From, Subscriber, SubId) -> | {error, xmlel()} ). publish_item(Host, ServerHost, Node, Publisher, <<>>, Payload) -> - publish_item(Host, ServerHost, Node, Publisher, uniqid(), Payload); + publish_item(Host, ServerHost, Node, Publisher, uniqid(), Payload, all); publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> + publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, all). +publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, Access) -> Action = fun (#pubsub_node{options = Options, type = Type, id = NodeId}) -> Features = features(Type), PublishFeature = lists:member(<<"publish">>, Features), @@ -2704,7 +2706,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> Type = select_type(ServerHost, Host, Node), case lists:member("auto-create", features(Type)) of true -> - case create_node(Host, ServerHost, Node, Publisher, Type) of + case create_node(Host, ServerHost, Node, Publisher, Type, Access, []) of {result, [#xmlel{name = <<"pubsub">>, attrs = [{<<"xmlns">>, ?NS_PUBSUB}], children = @@ -4238,9 +4240,6 @@ node_options(Type) -> jlib:binary_to_atom(<<(?PLUGIN_PREFIX)/binary, Type/binary>>), case catch Module:options() of -%% @spec (Host, Type, NodeId) -> [ljid()] -%% NodeId = pubsubNodeId() -%% @doc <p>Return list of node owners.</p> {'EXIT', {undef, _}} -> DefaultModule = jlib:binary_to_atom(<<(?PLUGIN_PREFIX)/binary, |