mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 06:15:12 +00:00
Support delete-multiple push notification
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
cdaecef095
commit
90bf76e013
@ -169,6 +169,10 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
||||
)
|
||||
} else if (deleteAll) {
|
||||
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
|
||||
} else if (deleteMultiple) {
|
||||
notificationIds.forEach {
|
||||
cancelExistingNotificationWithId(applicationContext, signatureVerification!!.userEntity, it)
|
||||
}
|
||||
} else if (type == "call") {
|
||||
val fullScreenIntent = Intent(applicationContext, MagicCallActivity::class.java)
|
||||
val bundle = Bundle()
|
||||
|
@ -586,6 +586,10 @@ public class NotificationWorker extends Worker {
|
||||
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), decryptedPushMessage.getNotificationId());
|
||||
} else if (decryptedPushMessage.isDeleteAll()) {
|
||||
NotificationUtils.INSTANCE.cancelAllNotificationsForAccount(context, signatureVerification.getUserEntity());
|
||||
} else if (decryptedPushMessage.isDeleteMultiple()) {
|
||||
for (long notificationId : decryptedPushMessage.getNotificationIds()) {
|
||||
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), notificationId);
|
||||
}
|
||||
} else {
|
||||
credentials = ApiUtils.getCredentials(signatureVerification.getUserEntity().getUsername(),
|
||||
signatureVerification.getUserEntity().getToken());
|
||||
|
@ -44,12 +44,18 @@ public class DecryptedPushMessage {
|
||||
@JsonField(name = "nid")
|
||||
public long notificationId;
|
||||
|
||||
@JsonField(name = "nids")
|
||||
public long[] notificationIds;
|
||||
|
||||
@JsonField(name = "delete")
|
||||
public boolean delete;
|
||||
|
||||
@JsonField(name = "delete-all")
|
||||
public boolean deleteAll;
|
||||
|
||||
@JsonField(name = "delete-multiple")
|
||||
public boolean deleteMultiple;
|
||||
|
||||
@JsonIgnore
|
||||
public NotificationUser notificationUser;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user