telegramMessages: add Chat, Chat ID, and Thread ID columns#1623
Merged
Conversation
The message key (t7) already decodes to a MessageIndex whose peerId is the chat/conversation the message belongs to (distinct from the sender shown in 'Author ID'), and the intermediate-message parser already reads the ThreadId field off the wire but discarded it. Surface both: - Chat : resolved peer name via peer_str(idx.peerId) -> 'Name (@handle id)' - Chat ID : raw numeric peerId, for sorting/pivoting/correlation - Thread ID : forum-topic / discussion thread id (blank when not threaded) Capturing threadId only stores the int64 that was already being consumed, so no parse offsets change. Also cleared this file's pre-existing pylint debt (unused import/vars/args, generic raise->ValueError, dynamic-attr declarations, bad-indentation) so the CI lint-changed-files gate passes (10.00/10).
…ner id - Reorder columns for readability: Timestamp, Chat, Chat ID, Thread ID, Direction, Author ID, Text, Action Data, Thumbnail, Forward From, Forward Timestamp. Groups conversation identity together and trails the usually-empty Forward columns so the dense columns stay left. - peer_str: replace alarming 'WARN: UNK NAME' / 'unknown peer N' with a neutral 'Unknown (id)' for unresolved peers. - Document in the description that an Outgoing message's Author ID is the account owner, so the device owner's Telegram id is recoverable from any Outgoing row.
Mirror the Chat / Chat ID treatment for the sender: keep the resolved 'Author' name column and add a numeric 'Author ID' = raw authorId (the sender's Telegram user id; blank when absent). On Outgoing messages this is the account owner's id. New order: ... Direction, Author, Author ID, Text ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds three columns to the Telegram Messages report:
peer_str(idx.peerId)Name (@handle id), same resolver used for Author ID / Forward Fromidx.peerIdMessageDataFlags.ThreadIdfieldWhy
The message key in the
t7table already decodes to aMessageIndexwhosepeerIdis the chat the message belongs to — which is distinct from the sender shown in the existingAuthor IDcolumn (in a group they differ). That value was decoded but never surfaced. Likewise, the intermediate-message parser already read theThreadIdfield off the wire and discarded it:Capturing
threadIdonly stores the int64 that was already being consumed, so no parse offsets change — decode behavior is identical, the value is just no longer dropped.Lint
CI's
lint-changed-filesruns pylint with--disable=C,Rand no--exit-zero/--fail-under, so any W/E fails the job, and this file carried pre-existing debt (9.24/10). Cleared it as part of the change (unused import/vars/args, genericraise Exception→ValueErrorin decoder internals, dynamic-setattrattribute declarations forno-member, two bad-indentation lines). Now 10.00/10; header/row width verified 11/11.