Merge pull request #8576 from osmandapp/tdlib_fixes

TdLib api compilation fixes
This commit is contained in:
vshcherb 2020-02-27 15:34:25 +02:00 committed by GitHub
commit 32bed07012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -446,7 +446,7 @@ class TelegramHelper private constructor() {
offsetOrder = last.order offsetOrder = last.order
offsetChatId = last.chatId offsetChatId = last.chatId
} }
client?.send(TdApi.GetChats(offsetOrder, offsetChatId, CHATS_LIMIT - chatList.size)) { obj -> client?.send(TdApi.GetChats(TdApi.ChatListMain(), offsetOrder, offsetChatId, CHATS_LIMIT - chatList.size)) { obj ->
when (obj.constructor) { when (obj.constructor) {
TdApi.Error.CONSTRUCTOR -> { TdApi.Error.CONSTRUCTOR -> {
val error = obj as TdApi.Error val error = obj as TdApi.Error
@ -533,8 +533,9 @@ class TelegramHelper private constructor() {
} }
resultArticles.forEach { resultArticles.forEach {
shareInfo.lastTextMessageHandled = false shareInfo.lastTextMessageHandled = false
client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, true, val sendOptions = TdApi.SendMessageOptions(true, true, null)
true, inlineQueryResults.inlineQueryId, it.id, false)) { obj -> client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, sendOptions,
inlineQueryResults.inlineQueryId, it.id, false)) { obj ->
handleTextLocationMessageUpdate(obj, shareInfo, true) handleTextLocationMessageUpdate(obj, shareInfo, true)
} }
} }
@ -861,7 +862,8 @@ class TelegramHelper private constructor() {
shareInfo.pendingTdLibText++ shareInfo.pendingTdLibText++
shareInfo.lastSendTextMessageTime = (System.currentTimeMillis() / 1000).toInt() shareInfo.lastSendTextMessageTime = (System.currentTimeMillis() / 1000).toInt()
log.error("sendNewTextLocation ${shareInfo.pendingTdLibText}") log.error("sendNewTextLocation ${shareInfo.pendingTdLibText}")
client?.send(TdApi.SendMessage(shareInfo.chatId, 0, false, true, null, content)) { obj -> val sendOptions = TdApi.SendMessageOptions(false, true, null)
client?.send(TdApi.SendMessage(shareInfo.chatId, 0, sendOptions, null, content)) { obj ->
handleTextLocationMessageUpdate(obj, shareInfo, false) handleTextLocationMessageUpdate(obj, shareInfo, false)
} }
} }
@ -893,7 +895,8 @@ class TelegramHelper private constructor() {
shareInfo.pendingTdLibMap++ shareInfo.pendingTdLibMap++
shareInfo.lastSendMapMessageTime = (System.currentTimeMillis() / 1000).toInt() shareInfo.lastSendMapMessageTime = (System.currentTimeMillis() / 1000).toInt()
log.error("sendNewMapLocation ${shareInfo.pendingTdLibMap}") log.error("sendNewMapLocation ${shareInfo.pendingTdLibMap}")
client?.send(TdApi.SendMessage(shareInfo.chatId, 0, false, true, null, content)) { obj -> val sendOptions = TdApi.SendMessageOptions(false, true, null)
client?.send(TdApi.SendMessage(shareInfo.chatId, 0, sendOptions, null, content)) { obj ->
handleMapLocationMessageUpdate(obj, shareInfo, false) handleMapLocationMessageUpdate(obj, shareInfo, false)
} }
} }
@ -1224,7 +1227,7 @@ class TelegramHelper private constructor() {
val updateUser = obj as TdApi.UpdateUser val updateUser = obj as TdApi.UpdateUser
val user = updateUser.user val user = updateUser.user
users[updateUser.user.id] = user users[updateUser.user.id] = user
if (user.outgoingLink is TdApi.LinkStateIsContact) { if (user.isContact) {
contacts[user.id] = user contacts[user.id] = user
} }
if (isOsmAndBot(user.id)) { if (isOsmAndBot(user.id)) {