moved match_pattern to utils

This commit is contained in:
yago 2015-04-12 21:56:20 +02:00
parent 91aac0c138
commit 267f90d674
2 changed files with 9 additions and 9 deletions

View File

@ -63,15 +63,6 @@ function match_plugins(msg)
end
end
-- Returns a table with matches or nil
function match_pattern(pattern, text)
local matches = { string.match(text, pattern) }
if next(matches) then
return matches
end
-- nil
end
-- Check if plugin is on _config.disabled_plugin_on_chat table
local function is_plugin_disabled_on_chat(plugin_name, receiver)
local disabled_chats = _config.disabled_plugin_on_chat

View File

@ -438,3 +438,12 @@ function send_large_msg_callback(cb_extra, success, result)
send_msg(destination, my_text, send_large_msg_callback, cb_extra)
end
end
-- Returns a table with matches or nil
function match_pattern(pattern, text)
local matches = { string.match(text, pattern) }
if next(matches) then
return matches
end
-- nil
end