diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt index 9e1d7ed144..625cff78c5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt @@ -71,6 +71,10 @@ interface PushersService { * @param emailBranding The branding placeholder to include in the email communications. * @param appDisplayName A human readable string that will allow the user to identify what application owns this pusher. * @param deviceDisplayName A human readable string that will allow the user to identify what device owns this pusher. + * @param append If true, the homeserver should add another pusher with the given pushkey and App ID in addition + * to any others with different user IDs. Otherwise, the homeserver must remove any other pushers + * with the same App ID and pushkey for different users. Typically We always want to append for + * email pushers since we don't want to stop other accounts notifying to the same email address. * @return A work request uuid. Can be used to listen to the status * (LiveData status = workManager.getWorkInfoByIdLiveData()) * @throws [InvalidParameterException] if a parameter is not correct @@ -79,7 +83,8 @@ interface PushersService { lang: String, emailBranding: String, appDisplayName: String, - deviceDisplayName: String): UUID + deviceDisplayName: String, + append: Boolean = true): UUID /** * Directly ask the push gateway to send a push to this device diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt index 8f91374688..4b546701db 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/DefaultPushersService.kt @@ -85,7 +85,8 @@ internal class DefaultPushersService @Inject constructor( lang: String, emailBranding: String, appDisplayName: String, - deviceDisplayName: String + deviceDisplayName: String, + append: Boolean ) = addPusher( JsonPusher( pushKey = email, @@ -96,7 +97,7 @@ internal class DefaultPushersService @Inject constructor( appDisplayName = appDisplayName, deviceDisplayName = deviceDisplayName, data = JsonPusherData(brand = emailBranding), - append = true + append = append ) )