Skip to content

Community chats are cached as groups without an access hash #45

Closed

Description

@neoromantic

Found while fixing #18. mtcute 0.32 has community and communityForbidden chats. They have channel IDs and need an access hash, like channels, but the chat cache treats them as basic groups:

  • rawChatType and getChatType (src/commands/chats/helpers.ts) store their type as group.
  • rawChatToCacheInput and dialogToCacheInput keep the access hash only for channel and channelForbidden, so a community row has access_hash = NULL and its sync jobs build inputPeerChannel with hash 0.

Since #18 the row's ID is right (-100…, from the raw peer), so only the type and the hash are wrong.

Fix: give communities their own handling: keep the access hash, and either a community type or the closest existing one, documented in docs/database-schema.md.

Done when unit tests show a community from a dialog and from a raw chat cached with its access hash and a type that tg chats list --type can filter on, and buildInputPeer builds its peer with that hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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