Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 20:49
· 180 commits to main since this release
9d36da6

Added

  • TELEGRAM_PROXY routes CLI and daemon connections through a proxy using
    mtcute's URL parser: socks4://, socks5://, http://, https:// and
    MTProxy links. Credentials go in the URL; socks5h:// and addresses without
    a scheme are unsupported. Invalid URLs fail with a configuration error
    without printing the URL. Unset keeps direct TCP; ALL_PROXY and
    HTTPS_PROXY are ignored (#48).

Changed

  • Breaking: id in tg chats list, get, search and sync is now the
    chat's marked peer ID, the one tg messages search and tg sql print: the
    user ID for a private chat, -N for basic group N, -100… for a supergroup
    or channel. chats_cache.chat_id in tg sql holds the same IDs, so it
    joins messages_cache.chat_id. tg chats sync still prints peerId, now
    equal to id. The bare group or channel ID that 0.2.0 printed still works
    in tg send --to, tg messages list and get --chat, tg chats get --id
    and tg chats sync when the cache knows the chat; one that names both a
    cached basic group and a cached channel fails with INVALID_ARGS and lists
    both marked IDs. A positive ID the cache knows as a user (a private chat,
    a cached user, a DM with sync state or cached messages) names that user in
    every command, never a group or channel.
    To upgrade, stop the daemon, upgrade, then start it. The first run of the
    new version converts the cache and rebuilds the search index once. A 0.2.0
    daemon left running fails group and channel sync jobs until it is
    restarted, and the chats it caches are converted on the next run. The
    group and channel senders and forward sources in the messages that it, or
    a second 0.2.0 install, caches after the upgrade keep their bare IDs in
    fromId and forwardFromId, and may show the name of the user with that
    ID, until the message is fetched again (tg messages list --fresh).
    Downgrading after that is not supported.
  • Breaking: fromId, sender.id and forwardFromId in
    tg messages search, list and get hold the marked ID of a group or
    channel that posts as itself or that a message was forwarded from (-N,
    -100…), as messages_cache.from_id and forward_from_id store them
    now. History pages, tg send and live forwards stored the bare ID before;
    the first run converts the cached messages. tg messages search --sender
    takes the marked ID for such a sender (--sender -1001234567890), so a
    script that passes or matches the bare ID stops matching.

Fixed

  • tg messages search, list and get printed null for the title,
    username and type of every group and channel chat, because chats_cache
    stored those chats under bare IDs and messages_cache under marked ones.
    --chat @username, SQL joins between the two tables and a search for a
    chat's title now find group and channel messages too (#18).
  • User N and basic group N were stored under the same chats_cache key and
    overwrote each other, so the daemon could build a user peer for the group's
    sync jobs. They are now separate rows.
  • A message that a channel or group posted as itself got the name of the
    user whose ID equals the chat's bare ID, in sender and in the search
    index. It now has no user name.
  • tg chats sync -1001234567890 --format pretty (or -f pretty) took
    pretty for the chat and failed with "Chat not found in the cache:
    pretty", so the ID copied from tg chats list failed for every group and
    channel with that flag. The marked ID now wins.
  • tg chats get --id <ID> for a chat the cache doesn't hold failed with
    "No active account" or a missing-credentials error, though Telegram is
    asked by @username only. It now fails with INVALID_ARGS: the chat isn't
    in the cache, with the suggestion to start the daemon or use @username.