Long-press message selection + delete (message.delete frame, outbox removal, all-device sync)
This commit is contained in:
1 parent
60ec2b44a7
commit
6f4bf3cb7f
11 files changed
+417
-18
No files matched your search
@@ -42,6 +42,10 @@ TYPE_MESSAGE_START = "message.start"
|
||||
TYPE_MESSAGE_UPDATE = "message.update"
|
||||
TYPE_MESSAGE_STOP = "message.stop"
|
||||
|
||||
# Message deletion (app requests; broadcast to all devices)
|
||||
TYPE_MESSAGE_DELETE = "message.delete"
|
||||
TYPE_MESSAGE_DELETED = "message.deleted"
|
||||
|
||||
# Tool activity (M2)
|
||||
TYPE_TOOL_START = "tool.start"
|
||||
TYPE_TOOL_PROGRESS = "tool.progress"
|
||||
@@ -528,6 +532,33 @@ def history(
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Message deletion frames
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def message_deleted(
|
||||
chat_id: str,
|
||||
message_ids: List[str],
|
||||
*,
|
||||
thread_id: Optional[str] = None,
|
||||
id: Optional[int] = None,
|
||||
) -> Frame:
|
||||
"""Broadcast: the given message(s) were deleted from a chat/thread.
|
||||
|
||||
Carried by the response to a ``message.delete`` request (``id`` set) and
|
||||
broadcast to every device so all of them drop the message(s) from their
|
||||
cache. Also outboxed, so a device that was offline learns of the deletion
|
||||
on its next ``sync``.
|
||||
"""
|
||||
return Frame(
|
||||
type=TYPE_MESSAGE_DELETED,
|
||||
id=id,
|
||||
chat_id=chat_id,
|
||||
thread_id=thread_id,
|
||||
payload={"message_ids": list(message_ids)},
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Push / notification frames (M5)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user