unregisterAck -> unregister

This commit is contained in:
p1gp1g
2020-12-28 12:16:41 +01:00
parent 5175224692
commit 76965d3e11
2 changed files with 3 additions and 6 deletions

View File

@@ -29,11 +29,8 @@ fun sendEndpoint(context: Context, application: String, endpoint: String) {
context.sendBroadcast(broadcastIntent)
}
fun sendUnregistered(context: Context, application: String, needToken: Boolean){
val token = getToken(context,application).let{
if(it.isNullOrEmpty() and needToken) return else it
}
fun sendUnregistered(context: Context, application: String, _token: String?){
val token = _token?: getToken(context,application)!!
val broadcastIntent = Intent()
broadcastIntent.`package` = application
broadcastIntent.action = UNREGISTERED

View File

@@ -111,7 +111,7 @@ class RegisterBroadcastReceiver: BroadcastReceiver() {
db.close()
Log.i("RegisterService","Unregistration is finished")
}
sendUnregistered(context!!,application,false)
sendUnregistered(context!!,application,token)
}
}
}