diff --git a/CHANGES.md b/CHANGES.md index aa18d9e088..e05c52c835 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,18 +8,22 @@ Improvements 🙌: - Show confirmation dialog before deleting a message (#967) - Open room member profile from reactions list and read receipts list (#875) -Other changes: - - - Bugfix 🐛: - Fix crash by removing all notifications after clearing cache (#878) Translations 🗣: - +SDK API changes 🔞: + - Javadoc improved for PushersService + - PushersService.pushers() has been renamed to PushersService.getPushers() + Build 🧱: - +Other changes: + - + Changes in RiotX 0.15.0 (2020-02-10) =================================================== @@ -385,15 +389,18 @@ Features ✨: Improvements 🙌: - -Other changes: - - - Bugfix 🐛: - Translations 🗣: - +SDK API changes 🔞: + - + Build 🧱: - +Other changes: + - + diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/pushers/PushersService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/pushers/PushersService.kt index 5f192c02f6..2f24d596ad 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/pushers/PushersService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/pushers/PushersService.kt @@ -17,6 +17,7 @@ package im.vector.matrix.android.api.session.pushers import androidx.lifecycle.LiveData import im.vector.matrix.android.api.MatrixCallback +import im.vector.matrix.android.api.util.Cancelable import java.util.UUID interface PushersService { @@ -27,7 +28,8 @@ interface PushersService { fun refreshPushers() /** - * Add a new HTTP pusher. Only `http` kind is supported by the SDK for now. + * Add a new HTTP pusher. + * Note that only `http` kind is supported by the SDK for now. * Ref: https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-pushers-set * * @param pushkey This is a unique identifier for this pusher. The value you should use for @@ -64,9 +66,18 @@ interface PushersService { append: Boolean, withEventIdOnly: Boolean): UUID - fun removeHttpPusher(pushkey: String, appId: String, callback: MatrixCallback) + /** + * Remove the http pusher + */ + fun removeHttpPusher(pushkey: String, appId: String, callback: MatrixCallback): Cancelable + /** + * Get the current pushers, as a LiveData + */ fun getPushersLive(): LiveData> - fun pushers(): List + /** + * Get the current pushers + */ + fun getPushers(): List } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/pushers/DefaultPusherService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/pushers/DefaultPusherService.kt index f7e154e18b..797f304180 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/pushers/DefaultPusherService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/pushers/DefaultPusherService.kt @@ -21,6 +21,7 @@ import com.zhuinden.monarchy.Monarchy import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.session.pushers.Pusher import im.vector.matrix.android.api.session.pushers.PushersService +import im.vector.matrix.android.api.util.Cancelable import im.vector.matrix.android.internal.database.mapper.asDomain import im.vector.matrix.android.internal.database.model.PusherEntity import im.vector.matrix.android.internal.database.query.where @@ -86,9 +87,9 @@ internal class DefaultPusherService @Inject constructor( return request.id } - override fun removeHttpPusher(pushkey: String, appId: String, callback: MatrixCallback) { + override fun removeHttpPusher(pushkey: String, appId: String, callback: MatrixCallback): Cancelable { val params = RemovePusherTask.Params(pushkey, appId) - removePusherTask + return removePusherTask .configureWith(params) { this.callback = callback } @@ -103,7 +104,7 @@ internal class DefaultPusherService @Inject constructor( ) } - override fun pushers(): List { + override fun getPushers(): List { return monarchy.fetchAllCopiedSync { PusherEntity.where(it) }.map { it.asDomain() } } diff --git a/vector/src/gplay/java/im/vector/riotx/gplay/features/settings/troubleshoot/TestTokenRegistration.kt b/vector/src/gplay/java/im/vector/riotx/gplay/features/settings/troubleshoot/TestTokenRegistration.kt index 5468217527..75e888dfb7 100644 --- a/vector/src/gplay/java/im/vector/riotx/gplay/features/settings/troubleshoot/TestTokenRegistration.kt +++ b/vector/src/gplay/java/im/vector/riotx/gplay/features/settings/troubleshoot/TestTokenRegistration.kt @@ -47,10 +47,10 @@ class TestTokenRegistration @Inject constructor(private val context: AppCompatAc status = TestStatus.FAILED return } - val pusher = session.pushers().filter { + val pushers = session.getPushers().filter { it.pushKey == fcmToken && it.state == PusherState.REGISTERED } - if (pusher.isEmpty()) { + if (pushers.isEmpty()) { description = stringProvider.getString(R.string.settings_troubleshoot_test_token_registration_failed, stringProvider.getString(R.string.sas_error_unknown)) quickFix = object : TroubleshootQuickFix(R.string.settings_troubleshoot_test_token_registration_quick_fix) {