Software /
code /
prosody-modules
Comparison
mod_privacy/mod_privacy.lua @ 45:3f5bbd7c90d4
mod_privacy: it says "from" not "form" (thx flo for reporting!)
author | Thilo Cestonaro <thilo@cestona.ro> |
---|---|
date | Fri, 16 Oct 2009 20:51:14 +0200 |
parent | 42:bbb3d3a90a70 |
child | 46:ea756d96584f |
comparison
equal
deleted
inserted
replaced
44:00f96207693a | 45:3f5bbd7c90d4 |
---|---|
321 function checkIfNeedToBeBlocked(e, session) | 321 function checkIfNeedToBeBlocked(e, session) |
322 local origin, stanza = e.origin, e.stanza; | 322 local origin, stanza = e.origin, e.stanza; |
323 local privacy_lists = datamanager.load(session.username, session.host, "privacy") or {}; | 323 local privacy_lists = datamanager.load(session.username, session.host, "privacy") or {}; |
324 local bare_jid = session.username.."@"..session.host; | 324 local bare_jid = session.username.."@"..session.host; |
325 | 325 |
326 module:log("debug", "stanza: %s, to: %s, form: %s", stanza.name, stanza.attr.to or "nil", stanza.attr.from or "nil"); | 326 module:log("debug", "stanza: %s, to: %s, from: %s", stanza.name, stanza.attr.to or "nil", stanza.attr.from or "nil"); |
327 | 327 |
328 if stanza.attr.to ~= nil and stanza.attr.from ~= nil then | 328 if stanza.attr.to ~= nil and stanza.attr.from ~= nil then |
329 if privacy_lists.lists == nil or | 329 if privacy_lists.lists == nil or |
330 (session.activePrivacyList == nil or session.activePrivacyList == "") and | 330 (session.activePrivacyList == nil or session.activePrivacyList == "") and |
331 (privacy_lists.default == nil or privacy_lists.default == "") | 331 (privacy_lists.default == nil or privacy_lists.default == "") |
454 end | 454 end |
455 | 455 |
456 function preCheckOutgoing(e) | 456 function preCheckOutgoing(e) |
457 local session = e.origin; | 457 local session = e.origin; |
458 if e.stanza.attr.from == nil then | 458 if e.stanza.attr.from == nil then |
459 e.stanza.attr.form = session.username .. "@" .. session.host; | 459 e.stanza.attr.from = session.username .. "@" .. session.host; |
460 if session.resource ~= nil then | 460 if session.resource ~= nil then |
461 e.stanza.attr.from = e.stanza.attr.form .. "/" .. session.resource; | 461 e.stanza.attr.from = e.stanza.attr.from .. "/" .. session.resource; |
462 end | 462 end |
463 end | 463 end |
464 return checkIfNeedToBeBlocked(e, session); | 464 return checkIfNeedToBeBlocked(e, session); |
465 end | 465 end |
466 | 466 |