From 442709319ebb85ab068074f0552c691da134c9a1 Mon Sep 17 00:00:00 2001 From: Lacustat Date: Sun, 1 Nov 2026 22:37:55 +0100 Subject: [PATCH] 0.1.228: Kanaele: Ereignis-Handler ohne Owner (Mitglieder kamen leer an), Chatausgabe der Liste zusaetzlich ueber AddMessage unterdruecken [ungeprueft] Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- Core/Channels.lua | 28 ++++++++++++++++++++++++---- Freewood-OctoWoW-Core.toc | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Core/Channels.lua b/Core/Channels.lua index 524561b..52c866b 100644 --- a/Core/Channels.lua +++ b/Core/Channels.lua @@ -216,10 +216,10 @@ local function OnNotice(a1, a2, a3, a4, a5, a6, a7, a8, a9) end end -FW:RegisterEvent("CHAT_MSG_CHANNEL_LIST", OnList, Ch) -FW:RegisterEvent("CHAT_MSG_CHANNEL_JOIN", OnJoin, Ch) -FW:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE", OnLeave, Ch) -FW:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE", OnNotice, Ch) +FW:RegisterEvent("CHAT_MSG_CHANNEL_LIST", OnList) +FW:RegisterEvent("CHAT_MSG_CHANNEL_JOIN", OnJoin) +FW:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE", OnLeave) +FW:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE", OnNotice) -- Die Listenausgabe des Spiels soll nicht im Chat landen, solange wir selbst abfragen if type(G.ChatFrame_AddMessageEventFilter) == "function" then @@ -233,6 +233,26 @@ if type(G.ChatFrame_AddMessageEventFilter) == "function" then Ch.filter = true end +-- Zweiter Weg gegen die Chatausgabe: AddMessage der Chatfenster, solange das Listen-Ereignis laeuft +local function Suppressing() + if Ch.probe then return false end + local now = (G.GetTime and G.GetTime()) or 0 + return Ch.current ~= nil or (now - Ch.lastSend) < SUPPRESS +end +local ci = 1 +while ci <= 10 do + local cf = G["ChatFrame" .. ci] + if cf and cf.AddMessage and not cf.fwChanWrapped then + local orig = cf.AddMessage + cf.fwChanWrapped = true + cf.AddMessage = function(self, ...) + if G.event == "CHAT_MSG_CHANNEL_LIST" and Suppressing() then return end + return orig(self, ...) + end + end + ci = ci + 1 +end + -- Aktionen (geschuetzt) function Ch.Whisper(name) if type(G.ChatFrame_SendTell) == "function" then pcall(G.ChatFrame_SendTell, name) end diff --git a/Freewood-OctoWoW-Core.toc b/Freewood-OctoWoW-Core.toc index aadaccd..8096998 100644 --- a/Freewood-OctoWoW-Core.toc +++ b/Freewood-OctoWoW-Core.toc @@ -3,7 +3,7 @@ ## Notes: Base addon of the Freewood family: data storage, UI kit, export/import and the main window. ## Notes-deDE: Basis-Addon der Freewood-Familie: Datenspeicher, UI-Bausteine, Export/Import und Hauptfenster. ## Author: Lacustat -## Version: 0.1.227 +## Version: 0.1.228 ## SavedVariables: FreewoodDB ## SavedVariablesPerCharacter: FreewoodCharDB