如何在 tdlib 中使用 getChats

how to use getChats in tdlib

我想在我的 android 项目中使用 TD Java API

方法"getchats"return聊天列表。我不知道如何使用这个方法

getchats 有 3 个参数: offset_order、offset_chat_id、限制

limit 是最大聊天数,由服务器发送到我的应用程序。 offset_order 和 offset_chat_id 是什么?

我只能找到关于此方法的简短文档

Returns list of chats in the right order, chats are sorted by (order, chat_id) in decreasing order. For example, to get list of chats from the beginning, the offset_order should be equal 2^63 - 1 
@offset_order Chat order to return chats from 
@offset_chat_id Chat identifier to return chats from 
@limit Maximum number of chats to be returned

(Google 已翻译) answer 来自官方技术支持:

Chats sorted in descending order a pair (offsetOrder, offsetChatId). offsetOrder - a parameter for sorting of chats, controlled library. When Order equality, chat to sort in descending order of ChatId. The first request to get a list from the beginning, you need to transfer very large offsetOrder, for example, 2 ^ 63 - 1.

if offsetOrder is 2 ^ 63 - 1, offsetChatId does not matter, you can pass 0. Request new GetChats (9223372036854775807L, 0, 10) should return the first 10 conversations.

It is necessary to transmit and chat.order chat.id last returned to the GetChats chat to receive next chats. It is also worth remembering that the order of chats can change, so you need to keep these values ​​at the time of obtaining the result GetChats.