Rename pausedLiveChatIds
This commit is contained in:
parent
d76f6a2e7f
commit
d70d2c6dc7
1 changed files with 8 additions and 8 deletions
|
@ -72,7 +72,7 @@ class TelegramHelper private constructor() {
|
|||
private val chatList = TreeSet<OrderedChat>()
|
||||
private val chatLiveMessages = ConcurrentHashMap<Long, TdApi.Message>()
|
||||
|
||||
private val pausedLiveChats = mutableListOf<Long>()
|
||||
private val pausedLiveChatIds = mutableListOf<Long>()
|
||||
|
||||
private val downloadChatFilesMap = ConcurrentHashMap<String, TdApi.Chat>()
|
||||
private val downloadUserFilesMap = ConcurrentHashMap<String, TdApi.User>()
|
||||
|
@ -598,14 +598,14 @@ class TelegramHelper private constructor() {
|
|||
}
|
||||
|
||||
fun pauseSendingLiveLocationToChat(chatId: Long) {
|
||||
synchronized(pausedLiveChats) {
|
||||
pausedLiveChats.add(chatId)
|
||||
synchronized(pausedLiveChatIds) {
|
||||
pausedLiveChatIds.add(chatId)
|
||||
}
|
||||
}
|
||||
|
||||
fun resumeSendingLiveLocationToChat(chatId: Long) {
|
||||
synchronized(pausedLiveChats) {
|
||||
pausedLiveChats.remove(chatId)
|
||||
synchronized(pausedLiveChatIds) {
|
||||
pausedLiveChatIds.remove(chatId)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ class TelegramHelper private constructor() {
|
|||
if (msgId != null && msgId != 0L) {
|
||||
val array = LongArray(1)
|
||||
array[0] = msgId
|
||||
client?.send(TdApi.DeleteMessages(chatId, array, true), UpdatesHandler())
|
||||
client?.send(TdApi.DeleteMessages(chatId, arrayOf(msgId), true), UpdatesHandler())
|
||||
}
|
||||
needRefreshActiveLiveLocationMessages = true
|
||||
}
|
||||
|
@ -656,8 +656,8 @@ class TelegramHelper private constructor() {
|
|||
private fun sendLiveLocationImpl(chatLivePeriods: Map<Long, Long>, latitude: Double, longitude: Double) {
|
||||
val location = TdApi.Location(latitude, longitude)
|
||||
chatLivePeriods.forEach { (chatId, livePeriod) ->
|
||||
synchronized(pausedLiveChats) {
|
||||
if (pausedLiveChats.contains(chatId)) {
|
||||
synchronized(pausedLiveChatIds) {
|
||||
if (pausedLiveChatIds.contains(chatId)) {
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue