From f1a73c831a2370e7a31bbeafcfddb822afa022df Mon Sep 17 00:00:00 2001 From: Lacustat Date: Mon, 2 Nov 2026 00:02:30 +0100 Subject: [PATCH] 0.1.230: Service-Kanal LFT wird nicht mehr gespeichert (nur Arbeitsspeicher), keine /who-Abfragen fuer LFT, alter LFT-Verlauf wird beim Login geloescht [ungeprueft] Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- Core/ChatLog.lua | 25 +++++++++++++++++++------ Freewood-OctoWoW-Core.toc | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Core/ChatLog.lua b/Core/ChatLog.lua index 7e98833..d1fa580 100644 --- a/Core/ChatLog.lua +++ b/Core/ChatLog.lua @@ -239,7 +239,15 @@ end -- Verlauf ------------------------------------------------------------------------ +-- Service-Kanaele (LFT) werden NICHT gespeichert: nur im Arbeitsspeicher, kurze Liste +CL.mem = {} +local MEM_CAP = 150 +local function Volatile(key) + return type(key) == "string" and string.lower(key) == "c:lft" +end + function CL.Lines(key) + if Volatile(key) then return CL.mem[key] end local c = DB() return c and c.lines[key] or nil end @@ -247,20 +255,22 @@ end function CL.Add(key, sender, text, out) local c = DB() if not c or not key then return end - local list = c.lines[key] - if not list then list = {}; c.lines[key] = list end + local vol = Volatile(key) + local store = vol and CL.mem or c.lines + local list = store[key] + if not list then list = {}; store[key] = list end local n = table.getn(list) + 1 list[n] = { t = Now(), s = sender, m = text, o = out and 1 or nil } - local cap = (string.sub(key, 1, 2) == "c:") and CAP_CH or CAP_OTHER - if n > cap + 50 then + local cap = vol and MEM_CAP or ((string.sub(key, 1, 2) == "c:") and CAP_CH or CAP_OTHER) + if n > cap + (vol and 20 or 50) then local new, i, j = {}, n - cap + 1, 1 while i <= n do new[j] = list[i]; i = i + 1; j = j + 1 end - c.lines[key] = new + store[key] = new end if not (CL.viewVisible and CL.viewKey == key) then CL.unread[key] = (CL.unread[key] or 0) + 1 end - if sender and not out then CL.Ask(sender) end + if sender and not out and not vol then CL.Ask(sender) end CL.version = CL.version + 1 end @@ -268,6 +278,9 @@ function CL.Prune() local c = DB() if c then local limit = Now() - KEEP + for key in pairs(c.lines) do + if Volatile(key) then c.lines[key] = nil end + end for key, list in pairs(c.lines) do local n = table.getn(list) local first = 1 diff --git a/Freewood-OctoWoW-Core.toc b/Freewood-OctoWoW-Core.toc index 026bbfb..55a7e27 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.229 +## Version: 0.1.230 ## SavedVariables: FreewoodDB ## SavedVariablesPerCharacter: FreewoodCharDB