mod_pep: Fixed a traceback when non-local users send presence.
authorWaqas Hussain <waqas20@gmail.com>
Sun, 12 Dec 2010 10:42:00 +0000 (15:42 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sun, 12 Dec 2010 10:42:00 +0000 (15:42 +0500)
plugins/mod_pep.lua

index f215b8be77053964d274c41078980e5b3e8f8394..9ff6cac204d126304903a02bdaf28036cce73ff8 100644 (file)
@@ -134,7 +134,7 @@ module:hook("presence/bare", function(event)
                                        publish_all(user, recipient, origin);
                                else
                                        recipients[user][recipient] = hash;
-                                       local from_bare = origin.username.."@"..origin.host;
+                                       local from_bare = origin.type == "c2s" and origin.username.."@"..origin.host;
                                        if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then
                                                origin.send(
                                                        st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"})