From beb82282707cec64f528f1ca32e3c27aee74ff3c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 5 Dec 2023 20:51:43 +0000 Subject: [PATCH] Update content of files --- .../corefork.telegram.org/api/takeout.html | 73 ++++++++++++++++++- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/data/web/corefork.telegram.org/api/takeout.html b/data/web/corefork.telegram.org/api/takeout.html index 62d47f5f70..b4eeb05624 100644 --- a/data/web/corefork.telegram.org/api/takeout.html +++ b/data/web/corefork.telegram.org/api/takeout.html @@ -2,10 +2,10 @@ - Takeout + Takeout API - + @@ -39,8 +39,8 @@
- -

Takeout

+ +

Takeout API

@@ -72,6 +72,71 @@ invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X;Then, when invoking methods that require message range pagination, wrap the method using invokeWithMessagesRange, before also wrapping it in an invokeWithTakeout as usual.

Start by passing the first message range; continue passing the same message range while paginating using the usual offset_*, limit, etc parameters; once there are no more results left, switch to the next message range, re-starting offset_*, limit pagination from the beginning.
Repeat until you've finished all the message ranges that were returned by messages.getSplitRanges.

+

Procedure

+

Example implementation: tdesktop.

+

Here's an overview of the steps required to export account information.

+

All requests must be wrapped in an invokeWithTakeout constructors, including upload.getFile calls to save files.

+

Unless otherwise specified, all requests do not require pagination using split ranges.

+
    +
  • +

    If the user wants to download messages from chats, groups or channels:

    +
      +
    • +

      First of all, fetch and save the dialog list using split ranges and messages.getDialogs; at the beginning of each split range, make an initial request with all offsets set to 0 and limit=1 to fetch total dialog count to display a proper progress bar.

      +
    • +
    • +

      Request and save info about left channels and supergroups if the user wants to export channel and group messages.

      +
    • +
    • +

      For all dialogs, check if they match the dialog types chosen by the user, and if yes download all messages using split ranges and messages.getHistory; for each split range, make an initial request with all offsets set to 0 and limit=1 to fetch the initial message count to display a proper progress bar.
      +Use the single message returned by the initial limit=1 request to also skip ranges that don't have any messages, because an empty messages vector or a single messageEmpty is returned.
      +If the user also chose to download only messages within a specific date interval, skip ranges whose:

      +
        +
      • First message (returned by that same initial limit=1 call) has a date smaller than the bottom of the specified date interval.
      • +
      • Last message (returned by a new call to messages.getHistory with limit=1, offset_id=1, add_offset=-1) has a date bigger than tha top of the specified date interval.
      • +
      +

      For each downloaded and saved message, also download and save all attached media, including custom emojis present in messages and captions, respecting the download filesize limits imposed by the user.

      +

      If the user chose to download only their own messages, not messages sent by other users, use messages.search with peer set to inputPeerSelf instead of messages.getHistory.

      +
    • +
    +
  • +
  • +

    If the user wants to export their stories:

    + +
  • +
  • +

    If the user wants to export personal info:

    + +
  • +
  • +

    If the user wants to export their own profile pictures:

    + +
  • +
  • +

    If the user wants to export their contact list:

    + +
  • +
  • +

    If the user wants to export their sessions:

    + +
  • +
  • +

    If the user wants to export any other data not mentioned above, like for example personal data related to new Telegram features, that do not have any specific takeout methods in the Takeout API yet.

    + +
  • +

Contacts

savedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;