Fix adding notes
This commit is contained in:
@@ -175,14 +175,29 @@ function shared.Noter.Init()
|
|||||||
---@param args string[]
|
---@param args string[]
|
||||||
local function AddNote(name, sender, args)
|
local function AddNote(name, sender, args)
|
||||||
if not Heimdall_Data.config.notes[name] then Heimdall_Data.config.notes[name] = {} end
|
if not Heimdall_Data.config.notes[name] then Heimdall_Data.config.notes[name] = {} end
|
||||||
|
if Heimdall_Data.config.noter.debug then
|
||||||
|
print(string.format("[%s] Adding note for: %s from: %s", ModuleName, name, sender))
|
||||||
shared.dumpTable(args)
|
shared.dumpTable(args)
|
||||||
|
end
|
||||||
|
local msgparts = {}
|
||||||
|
for i = 3, #args do
|
||||||
|
msgparts[#msgparts + 1] = args[i]
|
||||||
|
end
|
||||||
|
local msg = table.concat(msgparts, " ")
|
||||||
|
|
||||||
|
if Heimdall_Data.config.noter.debug then
|
||||||
|
print(string.format("[%s] Adding note for: %s from: %s", ModuleName, name, sender))
|
||||||
|
print(string.format("[%s] Note: %s", ModuleName, msg))
|
||||||
|
end
|
||||||
|
|
||||||
local note = {
|
local note = {
|
||||||
source = sender,
|
source = sender,
|
||||||
date = date("%Y-%m-%dT%H:%M:%S"),
|
date = date("%Y-%m-%dT%H:%M:%S"),
|
||||||
note = args[3]
|
note = msg
|
||||||
}
|
}
|
||||||
|
|
||||||
if Heimdall_Data.config.noter.debug then
|
if Heimdall_Data.config.noter.debug then
|
||||||
print(string.format("[%s] Adding note for: %s", ModuleName, name))
|
print(string.format("[%s] Adding note", ModuleName))
|
||||||
shared.dumpTable(note)
|
shared.dumpTable(note)
|
||||||
end
|
end
|
||||||
table.insert(Heimdall_Data.config.notes[name], note)
|
table.insert(Heimdall_Data.config.notes[name], note)
|
||||||
|
Reference in New Issue
Block a user