diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt index 994299e708..e4d5188a2b 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt @@ -446,7 +446,7 @@ class TelegramHelper private constructor() { offsetOrder = last.order 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) { TdApi.Error.CONSTRUCTOR -> { val error = obj as TdApi.Error @@ -533,8 +533,9 @@ class TelegramHelper private constructor() { } resultArticles.forEach { shareInfo.lastTextMessageHandled = false - client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, true, - true, inlineQueryResults.inlineQueryId, it.id, false)) { obj -> + val sendOptions = TdApi.SendMessageOptions(true, true, null) + client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, sendOptions, + inlineQueryResults.inlineQueryId, it.id, false)) { obj -> handleTextLocationMessageUpdate(obj, shareInfo, true) } } @@ -861,7 +862,8 @@ class TelegramHelper private constructor() { shareInfo.pendingTdLibText++ shareInfo.lastSendTextMessageTime = (System.currentTimeMillis() / 1000).toInt() 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) } } @@ -893,7 +895,8 @@ class TelegramHelper private constructor() { shareInfo.pendingTdLibMap++ shareInfo.lastSendMapMessageTime = (System.currentTimeMillis() / 1000).toInt() 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) } } @@ -1224,7 +1227,7 @@ class TelegramHelper private constructor() { val updateUser = obj as TdApi.UpdateUser val user = updateUser.user users[updateUser.user.id] = user - if (user.outgoingLink is TdApi.LinkStateIsContact) { + if (user.isContact) { contacts[user.id] = user } if (isOsmAndBot(user.id)) {