Mercurial > prosody-modules
comparison mod_muc_log/mod_muc_log.lua @ 1134:0664f8b783fd
mod_muc_log: Clean up some unused imports and variables
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Aug 2013 17:32:28 +0200 |
| parents | 11e2598baafb |
| children | 723367b5de8c |
comparison
equal
deleted
inserted
replaced
| 1133:11e2598baafb | 1134:0664f8b783fd |
|---|---|
| 1 local prosody = prosody; | |
| 2 local hosts = prosody.hosts; | 1 local hosts = prosody.hosts; |
| 3 local tostring = tostring; | 2 local tostring = tostring; |
| 4 local split_jid = require "util.jid".split; | 3 local split_jid = require "util.jid".split; |
| 5 local cm = require "core.configmanager"; | 4 local datamanager = require"core.storagemanager".olddm; |
| 6 local storagemanager = storagemanager; | 5 local data_load, data_store = datamanager.load, datamanager.store; |
| 7 local datamanager = storagemanager.olddm; | |
| 8 local data_load, data_store, data_getpath = datamanager.load, datamanager.store, datamanager.getpath; | |
| 9 local datastore = "muc_log"; | 6 local datastore = "muc_log"; |
| 10 local error_reply = require "util.stanza".error_reply; | |
| 11 local muc_form_config_option = "muc#roomconfig_enablelogging" | 7 local muc_form_config_option = "muc#roomconfig_enablelogging" |
| 12 | 8 |
| 13 local mod_host = module:get_host(); | |
| 14 local log_presences = module:get_option_boolean("muc_log_presences", true); | 9 local log_presences = module:get_option_boolean("muc_log_presences", true); |
| 15 | 10 |
| 16 -- Module Definitions | 11 -- Module Definitions |
| 17 | 12 |
| 18 function log_if_needed(e) | 13 function log_if_needed(event) |
| 19 local stanza, origin = e.stanza, e.origin; | 14 local stanza = event.stanza; |
| 20 | 15 |
| 21 if (stanza.name == "presence") or | 16 if (stanza.name == "presence") or |
| 22 (stanza.name == "iq") or | 17 (stanza.name == "iq") or |
| 23 (stanza.name == "message" and tostring(stanza.attr.type) == "groupchat") | 18 (stanza.name == "message" and tostring(stanza.attr.type) == "groupchat") |
| 24 then | 19 then |
