java – 如何在tdlib中使用getChats

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

方法“getchats”返回聊天列表.我不知道如何使用这种方法

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

最佳答案 (谷歌翻译)
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.

点赞