package ru.forbion.f7cloud.core.push

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

/** Handles Decline on incoming Talk call notifications. */
class F7CallActionReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action != ACTION_DECLINE) return
        val roomToken = intent.getStringExtra(EXTRA_ROOM_TOKEN)
        F7IncomingCallQueue.dismissAndShowNext(context, roomToken)
    }

    companion object {
        const val ACTION_DECLINE = "ru.forbion.f7cloud.action.DECLINE_CALL"
        const val EXTRA_NOTIFICATION_ID = "notificationId"
        const val EXTRA_ROOM_TOKEN = "roomToken"
    }
}
