From 25f39eefa7d535aaf84c1f86213826c74a9ff4fe Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Fri, 22 Jun 2018 19:00:40 +0300 Subject: [PATCH] Do not request location messages for channels --- .../src/net/osmand/telegram/helpers/TelegramHelper.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt index a9de7b8eaf..d3f0585980 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt @@ -363,6 +363,10 @@ class TelegramHelper private constructor() { for (chatTitle in chatTitles) { val chatId = this.chatTitles[chatTitle] if (chatId != null) { + val chat = chats[chatId] + if (chat == null || (chat.type is TdApi.ChatTypeSupergroup && (chat.type as TdApi.ChatTypeSupergroup).isChannel)) { + return + } client?.send(TdApi.SearchChatRecentLocationMessages(chatId, CHAT_LIVE_USERS_LIMIT)) { obj -> when (obj.constructor) { TdApi.Error.CONSTRUCTOR -> {