アクセストークン更新したらプッシュ購読の更新も行う

This commit is contained in:
tateisu 2019-12-18 03:11:19 +09:00
parent 03ed016c5e
commit e2716d4741
2 changed files with 8 additions and 4 deletions

View File

@ -35,10 +35,7 @@ import jp.juggler.subwaytooter.span.MyClickableSpan
import jp.juggler.subwaytooter.span.MyClickableSpanClickCallback
import jp.juggler.subwaytooter.table.AcctColor
import jp.juggler.subwaytooter.table.SavedAccount
import jp.juggler.subwaytooter.util.ChromeTabOpener
import jp.juggler.subwaytooter.util.EmptyCallback
import jp.juggler.subwaytooter.util.LinkHelper
import jp.juggler.subwaytooter.util.PostHelper
import jp.juggler.subwaytooter.util.*
import jp.juggler.subwaytooter.view.*
import jp.juggler.util.*
import org.apache.commons.io.IOUtils
@ -2005,6 +2002,7 @@ class ActMain : AppCompatActivity()
}
// 通知の更新が必要かもしれない
PushSubscriptionHelper.clearLastCheck(sa)
PollingWorker.queueUpdateNotification(this@ActMain)
return true
}

View File

@ -30,8 +30,14 @@ class PushSubscriptionHelper(
"Push subscription is not needed. we can't do check current subscription state, and unsubscribe it."
const val ERROR_PREVENT_FREQUENTLY_CHECK = "prevent frequently subscription check."
fun clearLastCheck(account : SavedAccount){
synchronized(lastCheckedMap){
lastCheckedMap.remove(account.acct)
}
}
}
private fun preventRapid() : Boolean {
if(verbose) return true
val now = System.currentTimeMillis()