Software /
code /
prosody
Comparison
plugins/mod_privacy.lua @ 3300:b651f8290e27
mod_privacy: Treat stanzas with no 'to' address as going to the user's bare JID (thanks KSid)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 29 Jun 2010 20:04:45 +0100 |
parent | 3085:cf01b0725272 |
child | 3301:772fb30b28fb |
child | 3313:9bcf8d612a52 |
comparison
equal
deleted
inserted
replaced
3299:4448789c19ca | 3300:b651f8290e27 |
---|---|
299 | 299 |
300 function checkIfNeedToBeBlocked(e, session) | 300 function checkIfNeedToBeBlocked(e, session) |
301 local origin, stanza = e.origin, e.stanza; | 301 local origin, stanza = e.origin, e.stanza; |
302 local privacy_lists = datamanager.load(session.username, session.host, "privacy") or {}; | 302 local privacy_lists = datamanager.load(session.username, session.host, "privacy") or {}; |
303 local bare_jid = session.username.."@"..session.host; | 303 local bare_jid = session.username.."@"..session.host; |
304 local to = stanza.attr.to; | 304 local to = stanza.attr.to or bare_jid; |
305 local from = stanza.attr.from; | 305 local from = stanza.attr.from; |
306 | 306 |
307 local is_to_user = bare_jid == jid_bare(to); | 307 local is_to_user = bare_jid == jid_bare(to); |
308 local is_from_user = bare_jid == jid_bare(from); | 308 local is_from_user = bare_jid == jid_bare(from); |
309 | 309 |