Rename VectorMessagingHelper to VectorPushHandler

This commit is contained in:
sim 2022-09-08 15:38:52 +02:00
parent 2527dbbeb2
commit dbea1726ec
3 changed files with 6 additions and 9 deletions

View File

@ -24,7 +24,7 @@ import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.pushers.FcmHelper
import im.vector.app.core.pushers.PushersManager
import im.vector.app.core.pushers.UnifiedPushHelper
import im.vector.app.core.pushers.VectorMessagingHelper
import im.vector.app.core.pushers.VectorPushHandler
import im.vector.app.features.settings.VectorPreferences
import org.json.JSONObject
import timber.log.Timber
@ -36,7 +36,7 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
@Inject lateinit var vectorPreferences: VectorPreferences
@Inject lateinit var activeSessionHolder: ActiveSessionHolder
@Inject lateinit var pushersManager: PushersManager
@Inject lateinit var vectorMessagingHelper: VectorMessagingHelper
@Inject lateinit var vectorPushHandler: VectorPushHandler
@Inject lateinit var unifiedPushHelper: UnifiedPushHelper
override fun onNewToken(token: String) {
@ -53,6 +53,6 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
Timber.d("New Firebase message")
vectorMessagingHelper.onMessage(JSONObject(message.data as Map<*, *>).toString())
vectorPushHandler.onMessage(JSONObject(message.data as Map<*, *>).toString())
}
}

View File

@ -42,7 +42,7 @@ class VectorMessagingReceiver : MessagingReceiver() {
@Inject lateinit var pushersManager: PushersManager
@Inject lateinit var activeSessionHolder: ActiveSessionHolder
@Inject lateinit var vectorPreferences: VectorPreferences
@Inject lateinit var vectorMessagingHelper: VectorMessagingHelper
@Inject lateinit var vectorPushHandler: VectorPushHandler
@Inject lateinit var guardServiceStarter: GuardServiceStarter
@Inject lateinit var unifiedPushStore: UnifiedPushStore
@Inject lateinit var unifiedPushHelper: UnifiedPushHelper
@ -57,7 +57,7 @@ class VectorMessagingReceiver : MessagingReceiver() {
* @param instance connection, for multi-account
*/
override fun onMessage(context: Context, message: ByteArray, instance: String) {
vectorMessagingHelper.onMessage(String(message))
vectorPushHandler.onMessage(String(message))
}
override fun onNewEndpoint(context: Context, endpoint: String, instance: String) {

View File

@ -47,11 +47,8 @@ import javax.inject.Inject
private val loggerTag = LoggerTag("Push", LoggerTag.SYNC)
/**
* Hilt injection happen at super.onReceive().
*/
class VectorMessagingHelper @Inject constructor(
class VectorPushHandler @Inject constructor(
private val notificationDrawerManager: NotificationDrawerManager,
private val notifiableEventResolver: NotifiableEventResolver,
private val activeSessionHolder: ActiveSessionHolder,