The message_id tdlib gives me seems pretty large. How can I get the (shorter) id relative to a channel/supergroup without using the nasty getPublicMessageLink?
What database holds the access_hash? I briefly scanned the issues and find it probably located in the message database, but I am looking for a waybto move it to chat info db as message db accumulates along time and there is no way to purge it.
Hmm I'm trying to reimplement an Bot API to gain more performance.
Well it is ok to use getPublicMessageLink as long as it doesn't involve more network activity.
And, anyway to prevent tdlib from automatically downloading avatar and thumbnails?
Yes, in Bot API we have these conversions:
int64 Client::as_tdlib_message_id(int32 message_id) {
return static_cast<int64>(message_id) << 20;
}
int32 Client::as_client_message_id(int64 message_id) {
int32 result = static_cast<int32>(message_id >> 20);
CHECK(as_tdlib_message_id(result) == message_id);
return result;
}
In Bot API we don't use even file database to not use SQLite at all and achieve maximum performance.
Avatars aren't downloaded automatically. Thumbnails are part of a message and always sent by the server, so they are always received.
Between, Bot API source code will be open some time.
I thought of disabling file database but I have to persist access_hash between restarts.
Actually, I found that even database is on, my identity become unknown after restart.
BTW, a few more questions:
langpack methods in the future?sendCustomRequestOK, my question is done.
Hmm tests indicate access hashes drop (Chat not found) when message database is disabled.
BTW as you disable sqlite database, how do you persist these data?
If message database is disabled, there is no data about chats in the local database, but information about users/basic groups/supergroups/secret chats is still stored in the database. So you need to use getUser + createPrivateChat to obtain a corresponding private chat or getSupergroup + createSupergroupChat for a supergroup chat instead of getChat.
@wfjsw
ignore_inline_thumbnails option.Shouldn't this be a TDLib parameter?
Since TDLib 1.3.0 you can call setOption before call to setTdlibParameters to achieve exactly the same behavior. We can't add all supported options to setTdlibParameters because it will blow up the method. Even ignore_file_names and enable_storage_optimizer are likely to be removed from setTdlibParameters in the future in favor of corresponding options.
It is better if setOption could accept an array of options.
There are no usability or performance reasons to do that.
Between, Bot API source code will be open some time.
any update?
@mugavri Not yet.