diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2015-07-01 17:18:32 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-05-25 08:40:12 +0200 |
commit | c958fa2f0602bd98319c4d83f54ded8fb7623808 (patch) | |
tree | 651c22aa3a5d8ee73257089b7b37c8746ded65e6 /src/node_dispatch.erl | |
parent | mod_mam_mnesia: Clarify error message (diff) |
Add support for PubSub publishing options
Add code necessary to support publishing options as described in
XEP-0060, #7.1.5. A node plugin that expects publishing options must
add <<"publish-options">> to the features/0 list and then handle the
publishing options handed over to the publish_item/7 call.
Signed-off-by: Christian Ulrich <christian@rechenwerk.net>
Diffstat (limited to 'src/node_dispatch.erl')
-rw-r--r-- | src/node_dispatch.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/node_dispatch.erl b/src/node_dispatch.erl index 178292d3..b3af69cd 100644 --- a/src/node_dispatch.erl +++ b/src/node_dispatch.erl @@ -39,7 +39,7 @@ -export([init/3, terminate/2, options/0, features/0, create_node_permission/6, create_node/2, delete_node/1, purge_node/2, subscribe_node/8, unsubscribe_node/4, - publish_item/6, delete_item/4, remove_extra_items/3, + publish_item/7, delete_item/4, remove_extra_items/3, get_entity_affiliations/2, get_node_affiliations/1, get_affiliation/2, set_affiliation/3, get_entity_subscriptions/2, get_node_subscriptions/1, @@ -99,13 +99,14 @@ subscribe_node(_Nidx, _Sender, _Subscriber, _AccessModel, _SendLast, _PresenceSu unsubscribe_node(_Nidx, _Sender, _Subscriber, _SubId) -> {error, ?ERR_FORBIDDEN}. -publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload) -> +publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload, + PubOpts) -> case nodetree_tree:get_node(Nidx) of #pubsub_node{nodeid = {Host, Node}} -> lists:foreach(fun (SubNode) -> node_hometree:publish_item(SubNode#pubsub_node.id, Publisher, PublishModel, MaxItems, - ItemId, Payload) + ItemId, Payload, PubOpts) end, nodetree_tree:get_subnodes(Host, Node, Publisher)), {result, {default, broadcast, []}}; |