Start background sync even if the eventId or roomId is null.
This commit is contained in:
parent
bf0b6d738a
commit
0cba8f3aa1
|
@ -8,7 +8,7 @@ Improvements 🙌:
|
||||||
-
|
-
|
||||||
|
|
||||||
Bugfix 🐛:
|
Bugfix 🐛:
|
||||||
-
|
- Clear the notification when the event is read elsewhere (#1822)
|
||||||
|
|
||||||
Translations 🗣:
|
Translations 🗣:
|
||||||
-
|
-
|
||||||
|
|
|
@ -130,14 +130,9 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
||||||
if (BuildConfig.LOW_PRIVACY_LOG_ENABLE) {
|
if (BuildConfig.LOW_PRIVACY_LOG_ENABLE) {
|
||||||
Timber.i("## onMessageReceivedInternal() : $data")
|
Timber.i("## onMessageReceivedInternal() : $data")
|
||||||
}
|
}
|
||||||
val eventId = data["event_id"]
|
|
||||||
val roomId = data["room_id"]
|
|
||||||
if (eventId == null || roomId == null) {
|
|
||||||
Timber.e("## onMessageReceivedInternal() missing eventId and/or roomId")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// update the badge counter
|
// update the badge counter
|
||||||
val unreadCount = data.get("unread")?.let { Integer.parseInt(it) } ?: 0
|
val unreadCount = data["unread"]?.let { Integer.parseInt(it) } ?: 0
|
||||||
BadgeProxy.updateBadgeCount(applicationContext, unreadCount)
|
BadgeProxy.updateBadgeCount(applicationContext, unreadCount)
|
||||||
|
|
||||||
val session = activeSessionHolder.getSafeActiveSession()
|
val session = activeSessionHolder.getSafeActiveSession()
|
||||||
|
@ -145,6 +140,9 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
Timber.w("## Can't sync from push, no current session")
|
Timber.w("## Can't sync from push, no current session")
|
||||||
} else {
|
} else {
|
||||||
|
val eventId = data["event_id"]
|
||||||
|
val roomId = data["room_id"]
|
||||||
|
|
||||||
if (isEventAlreadyKnown(eventId, roomId)) {
|
if (isEventAlreadyKnown(eventId, roomId)) {
|
||||||
Timber.i("Ignoring push, event already known")
|
Timber.i("Ignoring push, event already known")
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue