mod_pep: Fixed a traceback when non-local users send presence.

Sun, 12 Dec 2010 15:42:00 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 12 Dec 2010 15:42:00 +0500
changeset 3858
b76ac6c3a037
parent 3857
57d88113e3a4
child 3859
f3216c4a34e8

mod_pep: Fixed a traceback when non-local users send presence.

plugins/mod_pep.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_pep.lua	Sun Dec 12 06:35:53 2010 +0500
+++ b/plugins/mod_pep.lua	Sun Dec 12 15:42:00 2010 +0500
@@ -134,7 +134,7 @@
 					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"})

mercurial