mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-26 19:01:43 -04:00
implement sending messages to group
This commit is contained in:
parent
2a5152ea67
commit
d084bbc73d
4 changed files with 99 additions and 4 deletions
16
database.py
16
database.py
|
|
@ -158,3 +158,19 @@ class GroupMember(BaseModel):
|
|||
# only allow a single row per group_destination_hash/member_identity_hash pair
|
||||
SQL('UNIQUE (group_destination_hash, member_identity_hash)'),
|
||||
]
|
||||
|
||||
|
||||
class GroupMessage(BaseModel):
|
||||
|
||||
id = BigAutoField()
|
||||
hash = CharField(unique=True)
|
||||
group_destination_hash = CharField(index=True)
|
||||
member_identity_hash = CharField()
|
||||
content = TextField()
|
||||
|
||||
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 = "group_messages"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue