mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 13:09:46 +01:00
Merge pull request #1142 from nextcloud/support-delete-multiple
Support delete-multiple push notification
This commit is contained in:
commit
3972acb34d
@ -169,6 +169,14 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
)
|
)
|
||||||
} else if (deleteAll) {
|
} else if (deleteAll) {
|
||||||
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
|
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
|
||||||
|
} else if (deleteMultiple) {
|
||||||
|
notificationIds.forEach {
|
||||||
|
cancelExistingNotificationWithId(
|
||||||
|
applicationContext,
|
||||||
|
signatureVerification!!.userEntity,
|
||||||
|
it
|
||||||
|
)
|
||||||
|
}
|
||||||
} else if (type == "call") {
|
} else if (type == "call") {
|
||||||
val fullScreenIntent = Intent(applicationContext, MagicCallActivity::class.java)
|
val fullScreenIntent = Intent(applicationContext, MagicCallActivity::class.java)
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
@ -201,7 +209,11 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
LoganSquare.parse(ringtonePreferencesString, RingtoneSettings::class.java)
|
LoganSquare.parse(ringtonePreferencesString, RingtoneSettings::class.java)
|
||||||
ringtoneSettings.ringtoneUri
|
ringtoneSettings.ringtoneUri
|
||||||
} catch (exception: IOException) {
|
} catch (exception: IOException) {
|
||||||
Uri.parse("android.resource://" + applicationContext.packageName + "/raw/librem_by_feandesign_call")
|
Uri.parse(
|
||||||
|
"android.resource://" +
|
||||||
|
applicationContext.packageName +
|
||||||
|
"/raw/librem_by_feandesign_call"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,6 +586,10 @@ public class NotificationWorker extends Worker {
|
|||||||
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), decryptedPushMessage.getNotificationId());
|
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), decryptedPushMessage.getNotificationId());
|
||||||
} else if (decryptedPushMessage.isDeleteAll()) {
|
} else if (decryptedPushMessage.isDeleteAll()) {
|
||||||
NotificationUtils.INSTANCE.cancelAllNotificationsForAccount(context, signatureVerification.getUserEntity());
|
NotificationUtils.INSTANCE.cancelAllNotificationsForAccount(context, signatureVerification.getUserEntity());
|
||||||
|
} else if (decryptedPushMessage.isDeleteMultiple()) {
|
||||||
|
for (long notificationId : decryptedPushMessage.getNotificationIds()) {
|
||||||
|
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), notificationId);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
credentials = ApiUtils.getCredentials(signatureVerification.getUserEntity().getUsername(),
|
credentials = ApiUtils.getCredentials(signatureVerification.getUserEntity().getUsername(),
|
||||||
signatureVerification.getUserEntity().getToken());
|
signatureVerification.getUserEntity().getToken());
|
||||||
|
@ -44,12 +44,18 @@ public class DecryptedPushMessage {
|
|||||||
@JsonField(name = "nid")
|
@JsonField(name = "nid")
|
||||||
public long notificationId;
|
public long notificationId;
|
||||||
|
|
||||||
|
@JsonField(name = "nids")
|
||||||
|
public long[] notificationIds;
|
||||||
|
|
||||||
@JsonField(name = "delete")
|
@JsonField(name = "delete")
|
||||||
public boolean delete;
|
public boolean delete;
|
||||||
|
|
||||||
@JsonField(name = "delete-all")
|
@JsonField(name = "delete-all")
|
||||||
public boolean deleteAll;
|
public boolean deleteAll;
|
||||||
|
|
||||||
|
@JsonField(name = "delete-multiple")
|
||||||
|
public boolean deleteMultiple;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public NotificationUser notificationUser;
|
public NotificationUser notificationUser;
|
||||||
|
|
||||||
@ -99,6 +105,14 @@ public class DecryptedPushMessage {
|
|||||||
return this.timestamp;
|
return this.timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long[] getNotificationIds() {
|
||||||
|
return notificationIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDeleteMultiple() {
|
||||||
|
return deleteMultiple;
|
||||||
|
}
|
||||||
|
|
||||||
public void setApp(String app) {
|
public void setApp(String app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
}
|
}
|
||||||
@ -139,6 +153,14 @@ public class DecryptedPushMessage {
|
|||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setNotificationIds(long[] notificationIds) {
|
||||||
|
this.notificationIds = notificationIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleteMultiple(boolean deleteMultiple) {
|
||||||
|
this.deleteMultiple = deleteMultiple;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
if (o == this) {
|
if (o == this) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1 +1 @@
|
|||||||
499
|
489
|
@ -33,6 +33,10 @@
|
|||||||
<Match>
|
<Match>
|
||||||
<Class name="~.*\$\$Parcelable.*" />
|
<Class name="~.*\$\$Parcelable.*" />
|
||||||
</Match>
|
</Match>
|
||||||
|
<!-- JSON/Data classes with generated accessor methods -->
|
||||||
|
<Match>
|
||||||
|
<Class name="~com\.nextcloud\.talk\.models\.json\.push.*" />
|
||||||
|
</Match>
|
||||||
|
|
||||||
<!-- Dagger code is autogenerated. Exclude it from Check. -->
|
<!-- Dagger code is autogenerated. Exclude it from Check. -->
|
||||||
<Match>
|
<Match>
|
||||||
|
Loading…
Reference in New Issue
Block a user