25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Fix pubsub_publish_item_ hook call parameter and jid conversion on node_hometree.

published messages are delivered to subscribers (flat nodes).

SVN Revision: 2537
This commit is contained in:
Pablo Polvorin 2009-08-25 20:03:28 +00:00
parent a1a6469ed0
commit 4d5bfe2ee8
2 changed files with 3 additions and 2 deletions

View File

@ -2037,7 +2037,8 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
node_call(Type, publish_item, [NodeId, Publisher, PublishModel, MaxItems, ItemId, Payload])
end
end,
ejabberd_hooks:run(pubsub_publish_item, ServerHost, [ServerHost, Node, Publisher, service_jid(Host), ItemId, Payload]),
ServerHostB = list_to_binary(ServerHost),
ejabberd_hooks:run(pubsub_publish_item, ServerHostB, [ServerHost, Node, Publisher, service_jid(Host), ItemId, Payload]),
Reply = #xmlel{ns = ?NS_PUBSUB, name = 'pubsub', children =
[#xmlel{ns = ?NS_PUBSUB, name = 'publish', attrs = nodeAttr(Node), children =
[#xmlel{ns = ?NS_PUBSUB, name = 'item', attrs = itemAttr(ItemId)}]}]},

View File

@ -460,7 +460,7 @@ delete_subscription(SubKey, NodeID, {Subscription, SubId}, SubState) ->
%% <p>In the default plugin module, the record is unchanged.</p>
publish_item(NodeId, Publisher, PublishModel, MaxItems, ItemId, Payload) ->
SubKey = jlib:short_prepd_jid(Publisher),
GenKey = jlib:short_prepd_bare_jid(SubKey),
GenKey = jlib:short_prepd_bare_jid(Publisher),
GenState = get_state(NodeId, GenKey),
SubState = case SubKey of
GenKey -> GenState;