plugins.pubsub: If no jid given to unsubscribe with, default to what was subscribed to (if given) or the bound jid

Fri, 10 May 2013 12:19:57 +0200

author
Kim Alvefur <zash@zash.se>
date
Fri, 10 May 2013 12:19:57 +0200
changeset 338
957704bbe9a1
parent 337
8dce8240a77c
child 339
72fbfb0367e9

plugins.pubsub: If no jid given to unsubscribe with, default to what was subscribed to (if given) or the bound jid

plugins/pubsub.lua file | annotate | diff | comparison | revisions
--- a/plugins/pubsub.lua	Fri May 10 12:13:36 2013 +0200
+++ b/plugins/pubsub.lua	Fri May 10 12:19:57 2013 +0200
@@ -215,6 +215,7 @@
 end
 
 function pubsub_node:unsubscribe(jid, callback)
+	jid = jid or self.subscribed_jid or self.stream.jid;
 	self.stream:send_iq(pubsub_iq("set", self.service, nil, "unsubscribe", self.node, jid)
 	, callback);
 end

mercurial