merge upstream

This commit is contained in:
Akamaru 2015-06-02 21:52:42 +02:00
parent a474a1f940
commit 975334f28b
2 changed files with 6 additions and 7 deletions

View File

@ -2,9 +2,8 @@ language: erlang
before_install: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -qq libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make unzip git - sudo apt-get install -qq libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make unzip git libjansson-dev python2.7-dev
- ./launch.sh install - ./launch.sh install
- ./launch.sh update
script: script:
- luac -p bot/*.lua - luac -p bot/*.lua

View File

@ -94,7 +94,6 @@ function pre_process_service_msg(msg)
local action = msg.action or {type=""} local action = msg.action or {type=""}
-- Double / to discriminate of normal actions -- Double / to discriminate of normal actions
msg.text = "//tgservice " .. action.type msg.text = "//tgservice " .. action.type
msg.realservice = true
-- wipe the data to allow the bot to read service messages -- wipe the data to allow the bot to read service messages
if msg.out then if msg.out then
@ -112,6 +111,7 @@ end
function pre_process_msg(msg) function pre_process_msg(msg)
for name,plugin in pairs(plugins) do for name,plugin in pairs(plugins) do
if plugin.pre_process and msg then if plugin.pre_process and msg then
-- print('Preprocess', name)
msg = plugin.pre_process(msg) msg = plugin.pre_process(msg)
end end
end end
@ -134,9 +134,9 @@ local function is_plugin_disabled_on_chat(plugin_name, receiver)
-- Checks if plugin is disabled on this chat -- Checks if plugin is disabled on this chat
for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
if disabled_plugin == plugin_name and disabled then if disabled_plugin == plugin_name and disabled then
local warning = '' local warning = 'Plugin '..disabled_plugin..' ist in diesem Chat deaktiviert'
print(warning) print(warning)
send_msg(receiver, warning, ok_cb, false) -- send_msg(receiver, warning, ok_cb, false)
return true return true
end end
end end
@ -173,7 +173,7 @@ function match_plugin(plugin, plugin_name, msg)
end end
end end
end end
-- One pattern matches -- One patterns matches
return return
end end
end end
@ -194,7 +194,7 @@ end
-- If file doesn't exist, create it. -- If file doesn't exist, create it.
function load_config( ) function load_config( )
local f = io.open('./data/config.lua', "r") local f = io.open('./data/config.lua', "r")
-- If config.lua doesnt exists -- If config.lua doesn't exist
if not f then if not f then
print ("Neue Config-Datei erstellt: data/config.lua") print ("Neue Config-Datei erstellt: data/config.lua")
create_config() create_config()