Code format
Some checks failed
Release Workflow / release (push) Failing after 23s

This commit is contained in:
2025-05-04 15:09:34 +02:00
parent 304fbcbaae
commit 1da1e7bf9f
30 changed files with 4620 additions and 4241 deletions

View File

@@ -29,16 +29,12 @@ function shared.Noter.Init()
if #currentChunk + #word + 1 <= size then
currentChunk = currentChunk .. (currentChunk == "" and word or " " .. word)
else
if #currentChunk > 0 then
ret[#ret + 1] = currentChunk
end
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
currentChunk = word
end
end
if #currentChunk > 0 then
ret[#ret + 1] = currentChunk
end
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
return ret
end
@@ -65,8 +61,7 @@ function shared.Noter.Init()
end
local indices = shared.Split(range, "..")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Indices for range deletion: %s", ModuleName,
table.concat(indices, ", ")))
print(string.format("[%s] Indices for range deletion: %s", ModuleName, table.concat(indices, ", ")))
shared.dumpTable(indices)
end
local start = tonumber(indices[1])
@@ -74,8 +69,7 @@ function shared.Noter.Init()
if not start then
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Invalid start range for delete note: %s", ModuleName,
tostring(start)))
print(string.format("[%s] Invalid start range for delete note: %s", ModuleName, tostring(start)))
end
return
end
@@ -118,7 +112,7 @@ function shared.Noter.Init()
local msg = {
channel = "C",
data = channel,
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note)
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note),
}
--table.insert(shared.messenger.queue, msg)
table.insert(shared.networkMessenger.queue, msg)
@@ -132,8 +126,13 @@ function shared.Noter.Init()
local range = args[3]
if not range then
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] No range specified for print note, defaulting to last %d notes", ModuleName,
Heimdall_Data.config.noter.lastNotes))
print(
string.format(
"[%s] No range specified for print note, defaulting to last %d notes",
ModuleName,
Heimdall_Data.config.noter.lastNotes
)
)
end
local notes = Heimdall_Data.config.notes[name] or {}
local start = math.max(1, #notes - Heimdall_Data.config.noter.lastNotes + 1)
@@ -152,8 +151,7 @@ function shared.Noter.Init()
end
local indices = shared.Split(range, "..")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Indices for range printing: %s", ModuleName,
table.concat(indices, ", ")))
print(string.format("[%s] Indices for range printing: %s", ModuleName, table.concat(indices, ", ")))
shared.dumpTable(indices)
end
local start = tonumber(indices[1])
@@ -161,8 +159,7 @@ function shared.Noter.Init()
if not start then
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Invalid start range for print note: %s", ModuleName,
tostring(start)))
print(string.format("[%s] Invalid start range for print note: %s", ModuleName, tostring(start)))
end
return
end
@@ -212,7 +209,7 @@ function shared.Noter.Init()
local note = {
source = sender,
date = date("%Y-%m-%dT%H:%M:%S"),
note = msg
note = msg,
}
if Heimdall_Data.config.noter.debug then
@@ -284,9 +281,7 @@ function shared.Noter.Init()
print(string.format("[%s] Note command received for: %s", ModuleName, name))
end
local note = strtrim(args[3] or "")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Note: %s", ModuleName, note))
end
if Heimdall_Data.config.noter.debug then print(string.format("[%s] Note: %s", ModuleName, note)) end
if note == "delete" then
DeleteNotes(name, args)
elseif string.find(note, "^[%d%.]*$") then