comparison src/lib/Post.luan @ 53:9298b04607ae

add unread
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 03 Mar 2025 19:39:30 -0700
parents af41be2dcdec
children b5a316575e64
comparison
equal deleted inserted replaced
52:c3fabb21b6c4 53:9298b04607ae
13 doc.type == "post" or error "wrong type" 13 doc.type == "post" or error "wrong type"
14 return Post.new { 14 return Post.new {
15 id = doc.id 15 id = doc.id
16 chat_id = doc.post_chat_id 16 chat_id = doc.post_chat_id
17 author_id = doc.author_id 17 author_id = doc.author_id
18 date = doc.date 18 date = doc.post_date
19 content = doc.content 19 content = doc.content
20 } 20 }
21 end 21 end
22 22
23 local function to_doc(post) 23 local function to_doc(post)
24 return { 24 return {
25 type = "post" 25 type = "post"
26 id = post.id 26 id = post.id
27 post_chat_id = long(post.chat_id) 27 post_chat_id = long(post.chat_id)
28 author_id = long(post.author_id) 28 author_id = long(post.author_id)
29 date = long(post.date) 29 post_date = long(post.date)
30 content = post.content or error() 30 content = post.content or error()
31 } 31 }
32 end 32 end
33 33
34 function Post.new(post) 34 function Post.new(post)