mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
add database table and api to track read state of conversations
This commit is contained in:
parent
9290b3c7b4
commit
0795664d87
3 changed files with 63 additions and 0 deletions
14
database.py
14
database.py
|
|
@ -59,3 +59,17 @@ class LxmfMessage(BaseModel):
|
|||
# define table name
|
||||
class Meta:
|
||||
table_name = "lxmf_messages"
|
||||
|
||||
|
||||
class LxmfConversationReadState(BaseModel):
|
||||
|
||||
id = BigAutoField()
|
||||
destination_hash = CharField(unique=True) # unique destination hash
|
||||
last_read_at = DateTimeField()
|
||||
|
||||
created_at = DateTimeField(default=lambda: datetime.now(timezone.utc))
|
||||
updated_at = DateTimeField(default=lambda: datetime.now(timezone.utc))
|
||||
|
||||
# define table name
|
||||
class Meta:
|
||||
table_name = "lxmf_conversation_read_state"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue