Skip to content

History pages store no sender for incoming DMs and channel posts #44

Closed

Description

@neoromantic

Found while fixing #18. parseRawMessage (src/daemon/sync-worker-real-helpers.ts) sets from_id only from the raw message's fromId. Telegram leaves fromId out of an incoming message in a private chat and out of most channel posts, so history pages, tg messages list and get store from_id = NULL for them. Live messages store msg.sender.id, which mtcute fills from the chat. The same message gets a different sender depending on how it was cached, and a DM hit in tg messages search from history has sender.firstName: null.

Fix: when fromId is missing, take the sender from the chat for an incoming private message (the user) and for a channel post (the channel's marked ID), as mtcute does for live messages.

Done when a unit test shows the history row and the live row of the same incoming DM and channel post with the same from_id, and a history DM hit in tg messages search has the sender's name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions