save shareInfo to suggested when sharing time expire

This commit is contained in:
veliymolfar 2020-01-09 12:20:34 +02:00
parent 7031e79b59
commit 2a8f707334

View file

@ -89,7 +89,10 @@ class ShareLocationHelper(private val app: TelegramApplication) {
app.settings.getChatsShareInfo().forEach { (chatId, shareInfo) ->
val currentTime = System.currentTimeMillis() / 1000
when {
shareInfo.getChatLiveMessageExpireTime() <= 0 -> app.settings.shareLocationToChat(chatId, false)
shareInfo.getChatLiveMessageExpireTime() <= 0 -> {
app.settings.shareLocationToChat(chatId, false)
app.settings.addTimePeriodToLastItem(shareInfo.chatId, shareInfo.livePeriod)
}
currentTime > shareInfo.currentMessageLimit -> {
shareInfo.apply {
val newLivePeriod =