Changeset

4225:f8dc8b9e0bdd

mod_pubsub: Remove checks for whether the JID being (un)subscribed is the actor's own - it's possible to (un)subscribe another JID if you have the (un)subscribe_other capability, which is already checked in util.pubsub (thanks Andrew)
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 Mar 2011 10:32:55 +0000
parents 4223:9fb6e8ec15ed
children 4226:decfa487e1e8
files plugins/mod_pubsub.lua
diffstat 1 files changed, 0 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub.lua	Fri Mar 04 20:27:57 2011 +0000
+++ b/plugins/mod_pubsub.lua	Fri Mar 18 10:32:55 2011 +0000
@@ -108,9 +108,6 @@
 
 function handlers.set_subscribe(origin, stanza, subscribe)
 	local node, jid = subscribe.attr.node, subscribe.attr.jid;
-	if jid_bare(jid) ~= jid_bare(stanza.attr.from) then
-		return origin.send(pubsub_error_reply(stanza, "invalid-jid"));
-	end
 	local ok, ret = service:add_subscription(node, stanza.attr.from, jid);
 	local reply;
 	if ok then
@@ -129,9 +126,6 @@
 
 function handlers.set_unsubscribe(origin, stanza, unsubscribe)
 	local node, jid = unsubscribe.attr.node, unsubscribe.attr.jid;
-	if jid_bare(jid) ~= jid_bare(stanza.attr.from) then
-		return origin.send(pubsub_error_reply(stanza, "invalid-jid"));
-	end
 	local ok, ret = service:remove_subscription(node, stanza.attr.from, jid);
 	local reply;
 	if ok then