Comparison

plugins/mod_pep.lua @ 4394:676b0845eae4

mod_pep: Always include a 'from' attribute on service discovery requests to local clients (compatibility fix for OneTeam).
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Oct 2011 00:13:49 +0500
parent 4207:06eb75d071ec
child 5002:7a0b17118987
comparison
equal deleted inserted replaced
4393:7958680c459a 4394:676b0845eae4
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.type == "c2s" and 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 -- COMPAT from ~= stanza.attr.to because OneTeam can't deal with missing from attribute
139 origin.send( 140 origin.send(
140 st.stanza("iq", {from=stanza.attr.to, to=stanza.attr.from, id="disco", type="get"}) 141 st.stanza("iq", {from=user, to=stanza.attr.from, id="disco", type="get"})
141 :query("http://jabber.org/protocol/disco#info") 142 :query("http://jabber.org/protocol/disco#info")
142 ); 143 );
143 end 144 end
144 end 145 end
145 end 146 end