mod_presence: Fixed a traceback on outgoing subscriptions from offline users.
authorWaqas Hussain <waqas20@gmail.com>
Fri, 11 Jun 2010 15:45:00 +0000 (20:45 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Fri, 11 Jun 2010 15:45:00 +0000 (20:45 +0500)
plugins/mod_presence.lua

index 3735cf1d957495d905ddafc84614c5c6f2aaa170..8e6ef85a35ab97ab928f6a7e7a4dcbd6d9c5c492 100644 (file)
@@ -169,7 +169,7 @@ end
 
 function handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare)
        local node, host = jid_split(from_bare);
-       if to_bare == origin.username.."@"..origin.host then return; end -- No self contacts
+       if to_bare == from_bare 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);