From 19f9d4bda91eb250284a381938ac1490799a956f Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 26 Jan 2025 18:03:31 +0100 Subject: [PATCH] Fix naming in echoer and emoter --- Modules/Echoer.lua | 31 +++++++++++++++++-------------- Modules/Emoter.lua | 32 ++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/Modules/Echoer.lua b/Modules/Echoer.lua index 9144765..ab837e0 100644 --- a/Modules/Echoer.lua +++ b/Modules/Echoer.lua @@ -9,27 +9,30 @@ function shared.Echoer.Init() local frame = CreateFrame("Frame") frame:RegisterEvent("CHAT_MSG_CHANNEL") frame:SetScript("OnEvent", function(self, event, msg, sender, ...) - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) - -- end + --if Heimdall_Data.config.echoer.debug then + -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) + --end if not Heimdall_Data.config.echoer.enabled then - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) - -- end + --if Heimdall_Data.config.echoer.debug then + -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) + --end return end local channelId = select(6, ...) local _, channelname = GetChannelName(channelId) - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname)) - -- end - - if channelname ~= Heimdall_Data.config.echoer.masterChannel then - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Ignoring message from non-master channel", ModuleName)) - -- end + local ok = false + for _, channel in pairs(Heimdall_Data.config.echoer.channels) do + if channel == channelname then + ok = true + break + end + end + if not ok then + if Heimdall_Data.config.echoer.debug then + print(string.format("[%s] Channel name does not match any of the channels", ModuleName)) + end return end if Heimdall_Data.config.echoer.debug then diff --git a/Modules/Emoter.lua b/Modules/Emoter.lua index 6033dc3..ac020ff 100644 --- a/Modules/Emoter.lua +++ b/Modules/Emoter.lua @@ -9,29 +9,33 @@ function shared.Emoter.Init() local frame = CreateFrame("Frame") frame:RegisterEvent("CHAT_MSG_CHANNEL") frame:SetScript("OnEvent", function(self, event, msg, sender, ...) - -- if Heimdall_Data.config.emoter.debug then - -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) - -- end + --if Heimdall_Data.config.emoter.debug then + -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) + --end if not Heimdall_Data.config.emoter.enabled then - -- if Heimdall_Data.config.emoter.debug then - -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) - -- end + --if Heimdall_Data.config.emoter.debug then + -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) + --end return end local channelId = select(6, ...) local _, channelname = GetChannelName(channelId) - -- if Heimdall_Data.config.emoter.debug then - -- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname)) - -- end - - if channelname ~= Heimdall_Data.config.emoter.masterChannel then - -- if Heimdall_Data.config.emoter.debug then - -- print(string.format("[%s] Ignoring message from non-master channel", ModuleName)) - -- end + local ok = false + for _, channel in pairs(Heimdall_Data.config.emoter.channels) do + if channel == channelname then + ok = true + break + end + end + if not ok then + if Heimdall_Data.config.emoter.debug then + print(string.format("[%s] Channel name does not match any of the channels", ModuleName)) + end return end + if Heimdall_Data.config.emoter.debug then print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender)) shared.dumpTable(Heimdall_Data.config.emoter)