Closed wowka1319 closed 1 year ago
UpdateMessageContent
is sent for all messages, received by the application since instance launch, and which weren't unloaded with updateDeleteMessages
. For the last chat messages updateChatLastMessage
is always sent additionally.
I observe updateDeleteMessages
of two types: (is_permanent, not from_cache) and (not is_permanent, from_cache).
is_permanent == not from_cache
always? I hasn't seen the different case.is_permanent == not from_cache always? I hasn't seen the different case.
No. If a message is removed from cache, then the action isn't permanent, but not vice versa. Messages can became inaccessible without actual deletion.
is_permanent
and from_cache
will be false.is_permanent == true
means that the message is deleted forever.updateChatLastMessage
is sent only when the last message is replaced by another one: a) received new message or b) actual deletion of the last message and the previous one become last ? I.e. updateChatLastMessage
is not sent if its content has changed only?updateChatLastMessage
is sent whenever last chat message is changed in any way. It must not be used for anything besides last message preview in chat list and handling of situation when last message become unknown.What does this "some time" depend on? Sometimes deletion from cache happens too early (in 2 minutes for example), before the next updateMessageEdited
, that makes updateMessageContent
impossible (if i understand correctly TDLib when unloading a message notifies the server not to send updateMessageContent
for it anymore). How can I increase this timeout?
TDLib has "message_unload_delay" option. See https://core.telegram.org/tdlib/options.
Thank you! Docs: The maximum time messages are stored in memory before they are unloaded. Does the documentation mean disk or RAM?
It is RAM.
Docs: If updateChatLastMessage.last_message
is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case.
What causes a message to become unknown?
The last message can be deleted, or some other unknown messages can be added to the chat.
I am seeing the following case. A new message has been posted. Since then it has been edited 6 times. I got 6 UpdateMessageContent
and 6 UpdateMessageEdited
(last events ~20 minutes after posting). But I only got one UpdateChatLastMessage
(~5 second after posting and with edit_date=0
). The message is still the last one. Why aren't UpdateChatLastMessage
s coming? What could be causing this?
Send TDLib log to https://t.me/tdlib_bot.
I thought UpdateMessageContent always came if the edited message was last in the chat. But I was wrong. What do guarantees exist for that?