Software / code / prosody
Comparison
plugins/mod_groups.lua @ 7129:e4c886946ecb
mod_groups: Move variable to smaller scope
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 04 Feb 2016 10:07:02 +0100 |
| parent | 7128:fccf340f4e1e |
| child | 8989:5a25c5d22fe5 |
| child | 8991:37ebcc7c6768 |
comparison
equal
deleted
inserted
replaced
| 7128:fccf340f4e1e | 7129:e4c886946ecb |
|---|---|
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 local groups; | 10 local groups; |
| 11 local members; | 11 local members; |
| 12 | |
| 13 local groups_file; | |
| 14 | 12 |
| 15 local jid, datamanager = require "util.jid", require "util.datamanager"; | 13 local jid, datamanager = require "util.jid", require "util.datamanager"; |
| 16 local jid_prep = jid.prep; | 14 local jid_prep = jid.prep; |
| 17 | 15 |
| 18 local module_host = module:get_host(); | 16 local module_host = module:get_host(); |
| 80 | 78 |
| 81 return username, host, datastore, data; | 79 return username, host, datastore, data; |
| 82 end | 80 end |
| 83 | 81 |
| 84 function module.load() | 82 function module.load() |
| 85 groups_file = module:get_option_path("groups_file", nil, "config"); | 83 local groups_file = module:get_option_path("groups_file", nil, "config"); |
| 86 if not groups_file then return; end | 84 if not groups_file then return; end |
| 87 | 85 |
| 88 module:hook("roster-load", inject_roster_contacts); | 86 module:hook("roster-load", inject_roster_contacts); |
| 89 datamanager.add_callback(remove_virtual_contacts); | 87 datamanager.add_callback(remove_virtual_contacts); |
| 90 | 88 |