23 lines
584 B
Plaintext
23 lines
584 B
Plaintext
new_comment = function(parent_id, depth)
|
|
local id = new_comment_id(parent_id)
|
|
print('creating', id)
|
|
local comment = {
|
|
type='text',
|
|
id=id,
|
|
filename=comment_path(id),
|
|
data={{data=''}},
|
|
width=Width,
|
|
depth=depth+1,
|
|
metadata={parent=parent_id, replies={}},
|
|
border=Border_color,
|
|
}
|
|
save_metadata(comment)
|
|
local result = cols(20)
|
|
table.insert(result.data, indent(depth+1))
|
|
local item_stuff = rows()
|
|
table.insert(result.data, item_stuff)
|
|
table.insert(item_stuff.data, comment)
|
|
table.insert(item_stuff.data,
|
|
reply_button(comment.id, depth+1))
|
|
return result, id
|
|
end |