diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt index be361f2a9d..1e8a72cb44 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt @@ -393,7 +393,12 @@ class TelegramHelper private constructor() { fun hasGrayscaleUserPhoto(userId: Int): Boolean { return File("$appDir/$GRAYSCALE_PHOTOS_DIR$userId$GRAYSCALE_PHOTOS_EXT").exists() } - + + private fun isUserLocationMessage(message: TdApi.Message): Boolean { + val cont = message.content + return (cont is MessageUserTextLocation || cont is TdApi.MessageLocation) + } + private fun hasLocalUserPhoto(user: TdApi.User): Boolean { val localPhoto = user.profilePhoto?.small?.local return if (localPhoto != null) { @@ -686,7 +691,7 @@ class TelegramHelper private constructor() { } } } - } else if (sameSender) { + } else if (sameSender && isUserLocationMessage(message) && isUserLocationMessage(newMessage)) { iterator.remove() } } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt index bb56ec9643..1c5e5b0c9d 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt @@ -582,7 +582,9 @@ class MyLocationTabFragment : Fragment(), TelegramListener { } TelegramUiHelper.setupPhoto(app, holder.icon, photoPath, placeholderId, false) - + holder.icon?.setOnClickListener { + app.forceUpdateMyLocation() + } val title = when (item) { is TdApi.Chat -> item.title is TdApi.User -> TelegramUiHelper.getUserName(item)