Comparison

mod_muc_log/mod_muc_log.lua @ 103:0491aa849c91

mod_muc_log: make that it logs again
author Thilo Cestonaro <thilo@cestona.ro>
date Wed, 02 Dec 2009 23:07:58 +0100
parent 94:941fd7d8b9b2
child 976:0428009c1127
comparison
equal deleted inserted replaced
102:a10ab09096e2 103:0491aa849c91
8 local splitJid = require "util.jid".split; 8 local splitJid = require "util.jid".split;
9 local config_get = require "core.configmanager".get; 9 local config_get = require "core.configmanager".get;
10 local datamanager = require "util.datamanager"; 10 local datamanager = require "util.datamanager";
11 local data_load, data_store, data_getpath = datamanager.load, datamanager.store, datamanager.getpath; 11 local data_load, data_store, data_getpath = datamanager.load, datamanager.store, datamanager.getpath;
12 local datastore = "muc_log"; 12 local datastore = "muc_log";
13 -- local mod_host = module:get_host(); 13 local mod_host = module:get_host();
14 local config = nil; 14 local config = nil;
15 15
16 --[[ LuaFileSystem 16 --[[ LuaFileSystem
17 * URL: http://www.keplerproject.org/luafilesystem/index.html 17 * URL: http://www.keplerproject.org/luafilesystem/index.html
18 * Install: luarocks install luafilesystem 18 * Install: luarocks install luafilesystem
19 * ]] 19 * ]]
20 local lfs = require "lfs"; 20 local lfs = require "lfs";
21 --[[ 21
22 local function checkDatastorePathExists(node, host, today, create) 22 local function checkDatastorePathExists(node, host, today, create)
23 create = create or false; 23 create = create or false;
24 local path = data_getpath(node, host, datastore, "dat", true); 24 local path = data_getpath(node, host, datastore, "dat", true);
25 path = path:gsub("/[^/]*$", ""); 25 path = path:gsub("/[^/]*$", "");
26 26
128 end 128 end
129 129
130 module:hook("message/bare", logIfNeeded, 500); 130 module:hook("message/bare", logIfNeeded, 500);
131 module:hook("iq/bare", logIfNeeded, 500); 131 module:hook("iq/bare", logIfNeeded, 500);
132 module:hook("presence/full", logIfNeeded, 500); 132 module:hook("presence/full", logIfNeeded, 500);
133 ]]-- 133
134 module:log("debug", "module mod_muc_log loaded!"); 134 module:log("debug", "module mod_muc_log loaded!");