Added
TELEGRAM_PROXYroutes 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_PROXYand
HTTPS_PROXYare ignored (#48).
Changed
- Breaking:
idintg chats list,get,searchandsyncis now the
chat's marked peer ID, the onetg messages searchandtg sqlprint: the
user ID for a private chat,-Nfor basic group N,-100…for a supergroup
or channel.chats_cache.chat_idintg sqlholds the same IDs, so it
joinsmessages_cache.chat_id.tg chats syncstill printspeerId, now
equal toid. The bare group or channel ID that 0.2.0 printed still works
intg send --to,tg messages listandget --chat,tg chats get --id
andtg chats syncwhen the cache knows the chat; one that names both a
cached basic group and a cached channel fails withINVALID_ARGSand 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
fromIdandforwardFromId, 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.idandforwardFromIdin
tg messages search,listandgethold the marked ID of a group or
channel that posts as itself or that a message was forwarded from (-N,
-100…), asmessages_cache.from_idandforward_from_idstore them
now. History pages,tg sendand 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,listandgetprintednullfor the title,
username and type of every group and channel chat, becausechats_cache
stored those chats under bare IDs andmessages_cacheunder 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_cachekey 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, insenderand in the search
index. It now has no user name. tg chats sync -1001234567890 --format pretty(or-f pretty) took
prettyfor the chat and failed with "Chat not found in the cache:
pretty", so the ID copied fromtg chats listfailed 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 withINVALID_ARGS: the chat isn't
in the cache, with the suggestion to start the daemon or use @username.