From 80d42f0963cc1d981689b9ea99f0ee8df9fd1d8b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 Jun 2022 11:37:12 +0200 Subject: [PATCH] Remove unused methods / clarify API --- .../vector/app/core/pushers/PushersManager.kt | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/pushers/PushersManager.kt b/vector/src/main/java/im/vector/app/core/pushers/PushersManager.kt index cb261f8288..91ab58207d 100644 --- a/vector/src/main/java/im/vector/app/core/pushers/PushersManager.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/PushersManager.kt @@ -47,8 +47,7 @@ class PushersManager @Inject constructor( } fun enqueueRegisterPusherWithFcmKey(pushKey: String): UUID { - val currentSession = activeSessionHolder.getActiveSession() - return currentSession.pushersService().enqueueAddHttpPusher(createHttpPusher(pushKey)) + return enqueueRegisterPusher(pushKey, stringProvider.getString(R.string.pusher_http_url)) } fun enqueueRegisterPusher( @@ -56,25 +55,13 @@ class PushersManager @Inject constructor( gateway: String ): UUID { val currentSession = activeSessionHolder.getActiveSession() - return currentSession.pushersService().enqueueAddHttpPusher(createHttpPusher(pushKey, gateway)) - } - - suspend fun registerPusherWithFcmKey(pushKey: String) { - val currentSession = activeSessionHolder.getActiveSession() - currentSession.pushersService().addHttpPusher(createHttpPusher(pushKey)) - } - - suspend fun registerPusher( - pushKey: String, - gateway: String - ) { - val currentSession = activeSessionHolder.getActiveSession() - currentSession.pushersService().addHttpPusher(createHttpPusher(pushKey, gateway)) + val pusher = createHttpPusher(pushKey, gateway) + return currentSession.pushersService().enqueueAddHttpPusher(pusher) } private fun createHttpPusher( pushKey: String, - gateway: String = stringProvider.getString(R.string.pusher_http_url) + gateway: String ) = HttpPusher( pushKey, stringProvider.getString(R.string.pusher_app_id),