simplify check for sharing location to user
This commit is contained in:
parent
9b6aa48639
commit
3acd73dcaf
1 changed files with 1 additions and 8 deletions
|
@ -113,14 +113,7 @@ class TelegramSettings(private val app: TelegramApplication) {
|
||||||
|
|
||||||
fun isSharingLocationToChat(chatId: Long) = shareChatsInfo.containsKey(chatId)
|
fun isSharingLocationToChat(chatId: Long) = shareChatsInfo.containsKey(chatId)
|
||||||
|
|
||||||
fun isSharingLocationToUser(userId: Int): Boolean {
|
fun isSharingLocationToUser(userId: Int) = shareChatsInfo.values.any { it.userId == userId }
|
||||||
shareChatsInfo.forEach { (_, shareInfo: ShareChatInfo) ->
|
|
||||||
if (shareInfo.userId == userId) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
fun hasAnyChatToShowOnMap() = !hiddenOnMapChats.containsAll(getLiveNowChats())
|
fun hasAnyChatToShowOnMap() = !hiddenOnMapChats.containsAll(getLiveNowChats())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue