From 81f46446226f81f10e7a188732c7a4c78f461eee Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 1 Sep 2009 08:19:14 +0000 Subject: [PATCH] Fix missing tag when configuring subscription option (thanks to Clochix) SVN Revision: 2577 --- src/mod_pubsub/mod_pubsub.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 88262c93e..bb86236e7 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -2512,7 +2512,17 @@ read_sub(Subscriber, NodeID, SubID, Lang) -> {error, notfound} -> {error, extended_error('not-acceptable', "invalid-subid")}; {result, #pubsub_subscription{options = Options}} -> - pubsub_subscription:get_options_xform(Lang, Options) + {result, XdataEl} = pubsub_subscription:get_options_xform(Lang, Options), + [N] = mnesia:dirty_match_object({pubsub_node,'_',NodeID,'_','_','_','_'}), + {_, Node} = N#pubsub_node.nodeid, + NodeIDStr = node_to_string(Node), + OptionsEl = #xmlel{ns = ?NS_PUBSUB, name = 'options', + attrs = [?XMLATTR('node', NodeIDStr), + ?XMLATTR('jid', exmpp_jid:to_binary(Subscriber)), + ?XMLATTR('Subid', SubID)], + children = [XdataEl]}, + PubsubEl = #xmlel{ns = ?NS_PUBSUB, name = 'pubsub', children = [OptionsEl]}, + {result, PubsubEl} end. set_options(Host, Node, JID, SubID, Configuration) ->