Mercurial > prosody-modules
comparison mod_privacy/mod_privacy.lua @ 41:0381d5d38c37
mod_privacy: fix bug where priority was nil and compared to a number (Thx flo for reporting!)
author | Thilo Cestonaro <thilo@cestona.ro> |
---|---|
date | Thu, 15 Oct 2009 09:41:13 +0200 |
parents | b84b2b026eb4 |
children | bbb3d3a90a70 |
comparison
equal
deleted
inserted
replaced
40:4c4daa1f8ae7 | 41:0381d5d38c37 |
---|---|
351 end | 351 end |
352 if jid_bare(stanza.attr.from) == bare_jid and jid_bare(stanza.attr.to) == bare_jid then | 352 if jid_bare(stanza.attr.from) == bare_jid and jid_bare(stanza.attr.to) == bare_jid then |
353 module:log("debug", "Never block communications from one of a user's resources to another."); | 353 module:log("debug", "Never block communications from one of a user's resources to another."); |
354 return; -- from one of a user's resource to another => HANDS OFF! | 354 return; -- from one of a user's resource to another => HANDS OFF! |
355 end | 355 end |
356 | 356 |
357 local idx; | 357 local idx; |
358 local list; | 358 local list; |
359 local item; | 359 local item; |
360 local listname = session.activePrivacyList; | 360 local listname = session.activePrivacyList; |
361 if listname == nil or listname == "" then | 361 if listname == nil or listname == "" then |
463 if resource == nil then | 463 if resource == nil then |
464 local prio = 0; | 464 local prio = 0; |
465 local session_; | 465 local session_; |
466 if bare_sessions[node.."@"..host] ~= nil then | 466 if bare_sessions[node.."@"..host] ~= nil then |
467 for resource, session_ in pairs(bare_sessions[node.."@"..host].sessions) do | 467 for resource, session_ in pairs(bare_sessions[node.."@"..host].sessions) do |
468 if session_.priority > prio then | 468 if session_.priority ~= nil and session_.priority > prio then |
469 session = session_; | 469 session = session_; |
470 prio = session_.priority; | 470 prio = session_.priority; |
471 end | 471 end |
472 end | 472 end |
473 end | 473 end |