Software /
code /
prosody
Comparison
plugins/mod_presence.lua @ 1626:7f17d0d00fbb
Fixed: Self-references could be added to rosters via presence subscriptions
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 03 Aug 2009 21:48:51 +0500 |
parent | 1606:bbadcaab0036 |
child | 1641:af962e6ae781 |
comparison
equal
deleted
inserted
replaced
1625:b6645fe7d89f | 1626:7f17d0d00fbb |
---|---|
163 return count; | 163 return count; |
164 end | 164 end |
165 | 165 |
166 function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza) | 166 function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza) |
167 local node, host = jid_split(from_bare); | 167 local node, host = jid_split(from_bare); |
168 if node == origin.username and host == origin.host then return; end -- No self contacts | |
168 local st_from, st_to = stanza.attr.from, stanza.attr.to; | 169 local st_from, st_to = stanza.attr.from, stanza.attr.to; |
169 stanza.attr.from, stanza.attr.to = from_bare, to_bare; | 170 stanza.attr.from, stanza.attr.to = from_bare, to_bare; |
170 log("debug", "outbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare); | 171 log("debug", "outbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare); |
171 if stanza.attr.type == "subscribe" then | 172 if stanza.attr.type == "subscribe" then |
172 -- 1. route stanza | 173 -- 1. route stanza |