Comparison

plugins/mod_pep.lua @ 3738:ae2ac97b23b1

mod_pep: Fixed a traceback when non-local users send presence.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 12 Dec 2010 15:42:00 +0500
parent 3737:659563b1db89
child 4207:06eb75d071ec
comparison
equal deleted inserted replaced
3737:659563b1db89 3738:ae2ac97b23b1
132 if hash_map[hash] then 132 if hash_map[hash] then
133 recipients[user][recipient] = hash_map[hash]; 133 recipients[user][recipient] = hash_map[hash];
134 publish_all(user, recipient, origin); 134 publish_all(user, recipient, origin);
135 else 135 else
136 recipients[user][recipient] = hash; 136 recipients[user][recipient] = hash;
137 local from_bare = origin.username.."@"..origin.host; 137 local from_bare = origin.type == "c2s" and origin.username.."@"..origin.host;
138 if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then 138 if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then
139 origin.send( 139 origin.send(
140 st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"}) 140 st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"})
141 :query("http://jabber.org/protocol/disco#info") 141 :query("http://jabber.org/protocol/disco#info")
142 ); 142 );