feat(backend): feed lists name, username and photo changes of people and chat renames, merged per day

This commit is contained in:
hh committed 2026-10-19 03:25:43 +00:00
1 parent 9aa8690e33
commit 8e0f828dd4
4 files changed
+352 -12

No files matched your search

+12 -8
View File
@@ -78,7 +78,8 @@ Typical flows:
joins and leaves, deleted message count, the private chat.
- Forensics: `get_feed` lists what was deleted or edited in Telegram across
all chats, newest first, with the text before and after each edit; a bulk
deletion is one item with `message_count`. `get_deleted_messages` and
deletion is one item with `message_count`. Its `profile` kind lists name,
username and photo changes of people and renames of chats. `get_deleted_messages` and
`get_message_versions` recover the content of one chat or one message.
- Files: `download_media` gets any message attachment (photo, video, voice,
document, ...). It pulls the file from Telegram if the archive lacks it and
@@ -270,14 +271,17 @@ async def get_feed(
limit: int = DEFAULT_LIMIT,
cursor: str | None = None,
) -> dict[str, Any]:
"""Deleted and edited messages across chats, newest first.
"""Deleted and edited messages and profile changes across chats, newest first.
`kind` picks deleted, edited or all; `since` keeps items at or after that
time; `chat_id` or `chat_kind` (dm, group, channel) narrow it down. Edited
items carry `before` and `after` texts. A deleted item with
`message_count` above 1 is a bulk deletion in one chat; read its messages
with `get_deleted_messages` for that chat. Pass `next_cursor` back as
`cursor` for the next page.
`kind` picks deleted, edited, profile, messages (deleted and edited) or all;
`since` keeps items at or after that time; `chat_id` or `chat_kind` (dm,
group, channel) narrow it down. Edited items carry `before` and `after`
texts. A deleted item with `message_count` above 1 is a bulk deletion in
one chat; read its messages with `get_deleted_messages` for that chat.
Profile items cover people in private chats or contacts and chats in the
dialog list: `detail` maps `name`, `username`, `photo` (unique file ids) or
`title` to `[old, new]`, changes a day apart or closer are merged. Pass
`next_cursor` back as `cursor` for the next page.
"""
if cursor is not None and re.fullmatch(CURSOR_PATTERN, cursor) is None:
msg = "cursor must be a next_cursor returned by get_feed"