Fix saving my location messages
This commit is contained in:
parent
119354ed31
commit
3fe50cb21a
1 changed files with 4 additions and 2 deletions
|
@ -205,7 +205,6 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
if (currentTime - lastLocationSentTime <= chatsCounts * SENT_LOCATIONS_INTERVAL_TIME_MS) {
|
if (currentTime - lastLocationSentTime <= chatsCounts * SENT_LOCATIONS_INTERVAL_TIME_MS) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
lastLocationSentTime = System.currentTimeMillis()
|
|
||||||
|
|
||||||
chatsShareInfo.values.forEach { shareInfo ->
|
chatsShareInfo.values.forEach { shareInfo ->
|
||||||
if (shareInfo.pendingTdLibText >= MAX_MESSAGES_IN_TDLIB_PER_CHAT || shareInfo.pendingTdLibMap >= MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
if (shareInfo.pendingTdLibText >= MAX_MESSAGES_IN_TDLIB_PER_CHAT || shareInfo.pendingTdLibMap >= MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
||||||
|
@ -229,7 +228,6 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
}
|
}
|
||||||
checkAndSendBufferMessagesToChat(shareInfo.chatId)
|
checkAndSendBufferMessagesToChat(shareInfo.chatId)
|
||||||
}
|
}
|
||||||
app.locationMessages.addMyLocationMessage(location)
|
|
||||||
if (bufferedMessagesFull) {
|
if (bufferedMessagesFull) {
|
||||||
checkNetworkType()
|
checkNetworkType()
|
||||||
}
|
}
|
||||||
|
@ -244,6 +242,7 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
if (isBot) {
|
if (isBot) {
|
||||||
sendLocationToBot(message, shareInfo, SHARE_TYPE_TEXT)
|
sendLocationToBot(message, shareInfo, SHARE_TYPE_TEXT)
|
||||||
} else {
|
} else {
|
||||||
|
lastLocationSentTime = System.currentTimeMillis()
|
||||||
app.telegramHelper.sendNewTextLocation(shareInfo, message)
|
app.telegramHelper.sendNewTextLocation(shareInfo, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,6 +255,7 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (shareInfo.pendingTdLibText < MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
if (shareInfo.pendingTdLibText < MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
||||||
|
lastLocationSentTime = System.currentTimeMillis()
|
||||||
app.telegramHelper.editTextLocation(shareInfo, message)
|
app.telegramHelper.editTextLocation(shareInfo, message)
|
||||||
} else {
|
} else {
|
||||||
app.locationMessages.addBufferedMessage(message)
|
app.locationMessages.addBufferedMessage(message)
|
||||||
|
@ -277,6 +277,7 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
app.locationMessages.addBufferedMessage(message)
|
app.locationMessages.addBufferedMessage(message)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
lastLocationSentTime = System.currentTimeMillis()
|
||||||
app.telegramHelper.sendNewMapLocation(shareInfo, message)
|
app.telegramHelper.sendNewMapLocation(shareInfo, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,6 +290,7 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (shareInfo.pendingTdLibMap < MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
if (shareInfo.pendingTdLibMap < MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
||||||
|
lastLocationSentTime = System.currentTimeMillis()
|
||||||
app.telegramHelper.editMapLocation(shareInfo, message)
|
app.telegramHelper.editMapLocation(shareInfo, message)
|
||||||
} else {
|
} else {
|
||||||
app.locationMessages.addBufferedMessage(message)
|
app.locationMessages.addBufferedMessage(message)
|
||||||
|
|
Loading…
Reference in a new issue