From 9e60b2b0a651488d2a7b1362d1eb082e6b95b63e Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Fri, 21 Mar 2008 16:05:42 +0000 Subject: [PATCH] Pubsub subscription is now wrapped in pubsub tags (EJAB-580) SVN Revision: 1245 --- ChangeLog | 3 +++ src/mod_pubsub/mod_pubsub.erl | 13 ++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 175dd9b63..59c134e58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ * src/ejabberdctl.template: Likewise * tools/ejabberdctl: Likewise + * src/mod_pubsub/mod_pubsub.erl: Pubsub subscription is now wrapped in + pubsub tags (EJAB-580) + 2008-03-21 Badlop * src/cyrsasl_digest.erl: Rewrite io:format calls to loglevel diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index a27656c7a..b9ba6b866 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -1351,13 +1351,12 @@ subscribe_node(Host, Node, From, JID) -> [{"node", node_to_string(Node)}, {"jid", jlib:jid_to_string(Subscriber)}, {"subscription", subscription_to_string(Subscription)}], - case Subscription of - subscribed -> - [{xmlelement, "subscription", - Fields ++ [{"subid", SubId}], []}]; - _ -> - [{xmlelement, "subscription", Fields, []}] - end + [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB}], + [{xmlelement, "subscription", + case Subscription of + subscribed -> [{"subid", SubId}|Fields]; + _ -> Fields + end, []}]}] end, case transaction(Host, Node, Action, sync_dirty) of {error, Error} ->