mobile: API for chat pagination (#908)

This commit is contained in:
Evgeny Poberezkin
2022-08-07 19:23:33 +01:00
committed by GitHub
parent 7f959103c1
commit e3f63db5ab
3 changed files with 34 additions and 8 deletions
+2 -2
View File
@@ -185,8 +185,8 @@ func apiGetChats() throws -> [ChatData] {
throw r
}
func apiGetChat(type: ChatType, id: Int64) throws -> Chat {
let r = chatSendCmdSync(.apiGetChat(type: type, id: id))
func apiGetChat(type: ChatType, id: Int64, pagination: ChatPagination = .last(count: 100)) throws -> Chat {
let r = chatSendCmdSync(.apiGetChat(type: type, id: id, pagination: pagination))
if case let .apiChat(chat) = r { return Chat.init(chat) }
throw r
}