Fix hotkeys reload and implement filters for console
This commit is contained in:
parent
44bf4dcb6e
commit
10a16169a4
|
@ -72,6 +72,7 @@ violationsChannelId = nil
|
|||
violationWindow = nil
|
||||
violationReportTab = nil
|
||||
ignoredChannels = {}
|
||||
filters = {}
|
||||
|
||||
local ignoreSettings = {
|
||||
privateMessages = false,
|
||||
|
@ -591,10 +592,24 @@ function sendCurrentMessage()
|
|||
sendMessage(message)
|
||||
end
|
||||
|
||||
function addFilter(filter)
|
||||
table.insert(filters, filter)
|
||||
end
|
||||
|
||||
function removeFilter(filter)
|
||||
table.removevalue(filters, filter)
|
||||
end
|
||||
|
||||
function sendMessage(message, tab)
|
||||
local tab = tab or getCurrentTab()
|
||||
if not tab then return end
|
||||
|
||||
for k,func in pairs(filters) do
|
||||
if func(message) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- when talking on server log, the message goes to default channel
|
||||
local name = tab:getText()
|
||||
if tab == serverTab or tab == getRuleViolationsTab() then
|
||||
|
|
|
@ -76,6 +76,8 @@ function init()
|
|||
onGameStart = online,
|
||||
onGameEnd = offline
|
||||
})
|
||||
|
||||
load()
|
||||
end
|
||||
|
||||
function terminate()
|
||||
|
@ -96,6 +98,7 @@ end
|
|||
function configure(savePerServer, savePerCharacter)
|
||||
perServer = savePerServer
|
||||
perCharacter = savePerCharacter
|
||||
reload()
|
||||
end
|
||||
|
||||
function online()
|
||||
|
|
Loading…
Reference in New Issue