tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

TdLib Upgrade Questions #3061

Closed pranavkulkarni7 closed 1 week ago

pranavkulkarni7 commented 1 month ago

Hello, I am using 1.8.23 and want to upgrade to recent version. I have a few questions related to same:

  1. I can see 1.8.36 is created two weeks back. Is it safe to use it and is it production ready?
  2. There are some changes in some of the models:
    • TdApi.Message.forwardInfo.fromChatId is not available - can we replace it MessageForwardInfo.ForwardSource.chatId ?
    • FormattedText.webPage is not available it was referring to TdApi.WebPage. How can we get webpage from message content ?
    • TdApi.SetTdlibParameters had enableStorageOptimizer, which is not present now, is their any replacement for this? I was setting it as true.
  3. Any other changes I should be aware of?
levlam commented 1 month ago

I can see 1.8.36 is created two weeks back. Is it safe to use it and is it production ready?

Yes, all TDLib versions pushed to Github are production-ready.

TdApi.Message.forwardInfo.fromChatId is not available - can we replace it MessageForwardInfo.ForwardSource.chatId ?

Yes. Now ForwardSource contains information about the message, from which the message was forwarded last time if it is available.

FormattedText.webPage is not available it was referring to TdApi.WebPage. How can we get webpage from message content ?

The class was renamed to linkPreview and now can be of many strict types. The corresponding field is located in the class messageText.

TdApi.SetTdlibParameters had enableStorageOptimizer, which is not present now, is their any replacement for this? I was setting it as true

Set the option "use_storage_optimizer" instead before calling setTdlibParameters.

Any other changes I should be aware of?

There were much more changes since 1.8.23. The best way to find all of them is to use git diff <old_commit_hash> td/generate/scheme/td_api.tl. Also, see https://core.telegram.org/tdlib/options for new options.

pranavkulkarni7 commented 1 month ago

Thanks! Let me try this.