Fixed: Self-references could be added to rosters via presence subscriptions

Mon, 03 Aug 2009 21:48:51 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 03 Aug 2009 21:48:51 +0500
changeset 1626
7f17d0d00fbb
parent 1625
b6645fe7d89f
child 1627
6b2109012688
child 1632
4a70cbb0fad7

Fixed: Self-references could be added to rosters via presence subscriptions

plugins/mod_presence.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_presence.lua	Mon Aug 03 21:47:32 2009 +0500
+++ b/plugins/mod_presence.lua	Mon Aug 03 21:48:51 2009 +0500
@@ -165,6 +165,7 @@
 
 function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza)
 	local node, host = jid_split(from_bare);
+	if node == origin.username and host == origin.host then return; end -- No self contacts
 	local st_from, st_to = stanza.attr.from, stanza.attr.to;
 	stanza.attr.from, stanza.attr.to = from_bare, to_bare;
 	log("debug", "outbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);

mercurial