Chat message edit, feature parity with flutter interface

This commit is contained in:
Shivering Ocelot committed 2025-07-14 16:11:17 -05:00
1 parent 569242b459
commit 0eab9ac111
5 files changed
+245 -16

No files matched your search

+3 -3
View File
@@ -39,6 +39,7 @@ class ChatMixin:
with self.sql_session() as session:
session.execute(db.Membership.__table__.delete().where(db.Membership.chat_id == chat_id))
session.execute(db.Chat.__table__.delete().where(db.Chat.id == chat_id))
# TODO: Delete messages from the chat
session.commit()
print(f"Deleted chat #{chat_id} and its memberships.")
@@ -103,9 +104,8 @@ class ChatMixin:
session.refresh(message)
# Notify chat owner
if sender != 'user':
chat_owner = session.execute(select(db.Chat.user_id).where(db.Chat.id == chat_id)).scalar()
self.notify_message_to_user(chat_owner, message)
chat_owner = session.execute(select(db.Chat.user_id).where(db.Chat.id == chat_id)).scalar()
self.notify_message_to_user(chat_owner, message)
# Notify participant agents
agent_ids = session.execute(select(db.Membership.agent_id).where(db.Membership.chat_id == chat_id)).scalars().all()
+1 -1
View File
@@ -82,7 +82,7 @@ class Message(Base):
# Identifier of the sender: user / system / user-$ID / agent-$ID
sender: Mapped[str]
# Timestamp of this message
# Timestamp when this message was sent
time: Mapped[int]
# Timestamp of this message's last edit
#last_edit: Mapped[int]