Mercurial > prosody-hg
comparison plugins/mod_privacy.lua @ 4232:582fe508214f
mod_privacy: Remove several unused variable declarations
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 29 Mar 2011 15:07:14 +0100 |
| parents | a99f82db692a |
| children | 7838acadb0fa |
comparison
equal
deleted
inserted
replaced
| 4231:a99f82db692a | 4232:582fe508214f |
|---|---|
| 99 return true; | 99 return true; |
| 100 end | 100 end |
| 101 return {"modify", "bad-request", "Not existing list specifed to be deleted."}; | 101 return {"modify", "bad-request", "Not existing list specifed to be deleted."}; |
| 102 end | 102 end |
| 103 | 103 |
| 104 function createOrReplaceList (privacy_lists, origin, stanza, name, entries, roster) | 104 function createOrReplaceList (privacy_lists, origin, stanza, name, entries) |
| 105 local bare_jid = origin.username.."@"..origin.host; | 105 local bare_jid = origin.username.."@"..origin.host; |
| 106 | 106 |
| 107 if privacy_lists.lists == nil then | 107 if privacy_lists.lists == nil then |
| 108 privacy_lists.lists = {}; | 108 privacy_lists.lists = {}; |
| 109 end | 109 end |
| 299 if is_from_user and is_to_user then | 299 if is_from_user and is_to_user then |
| 300 --module:log("debug", "Not blocking communications between user's resources"); | 300 --module:log("debug", "Not blocking communications between user's resources"); |
| 301 return; -- from one of a user's resource to another => HANDS OFF! | 301 return; -- from one of a user's resource to another => HANDS OFF! |
| 302 end | 302 end |
| 303 | 303 |
| 304 local item; | |
| 305 local listname = session.activePrivacyList; | 304 local listname = session.activePrivacyList; |
| 306 if listname == nil then | 305 if listname == nil then |
| 307 listname = privacy_lists.default; -- no active list selected, use default list | 306 listname = privacy_lists.default; -- no active list selected, use default list |
| 308 end | 307 end |
| 309 local list = privacy_lists.lists[listname]; | 308 local list = privacy_lists.lists[listname]; |
| 390 if node == nil or host == nil then | 389 if node == nil or host == nil then |
| 391 return; | 390 return; |
| 392 end | 391 end |
| 393 if resource == nil then | 392 if resource == nil then |
| 394 local prio = 0; | 393 local prio = 0; |
| 395 local session_; | |
| 396 if bare_sessions[node.."@"..host] ~= nil then | 394 if bare_sessions[node.."@"..host] ~= nil then |
| 397 for resource, session_ in pairs(bare_sessions[node.."@"..host].sessions) do | 395 for resource, session_ in pairs(bare_sessions[node.."@"..host].sessions) do |
| 398 if session_.priority ~= nil and session_.priority > prio then | 396 if session_.priority ~= nil and session_.priority > prio then |
| 399 session = session_; | 397 session = session_; |
| 400 prio = session_.priority; | 398 prio = session_.priority; |
