Reduce the number of fallback notification. Only used now when message cannot be decrypted.
Also avoid using `else` in this `when` block.
This commit is contained in:
parent
cf657df5fd
commit
aefeb01cdd
1 changed files with 55 additions and 2 deletions
|
|
@ -114,10 +114,63 @@ class NotifiableEventResolver @Inject constructor(
|
|||
title = null, // TODO check if title is needed anymore
|
||||
)
|
||||
} else {
|
||||
fallbackNotifiableEvent(userId, roomId, eventId)
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification state event for membership ${content.membershipState}")
|
||||
null
|
||||
}
|
||||
}
|
||||
else -> fallbackNotifiableEvent(userId, roomId, eventId)
|
||||
NotificationContent.MessageLike.CallAnswer,
|
||||
NotificationContent.MessageLike.CallCandidates,
|
||||
NotificationContent.MessageLike.CallHangup,
|
||||
NotificationContent.MessageLike.CallInvite -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for call ${content.javaClass.simpleName}")
|
||||
}
|
||||
NotificationContent.MessageLike.KeyVerificationAccept,
|
||||
NotificationContent.MessageLike.KeyVerificationCancel,
|
||||
NotificationContent.MessageLike.KeyVerificationDone,
|
||||
NotificationContent.MessageLike.KeyVerificationKey,
|
||||
NotificationContent.MessageLike.KeyVerificationMac,
|
||||
NotificationContent.MessageLike.KeyVerificationReady,
|
||||
NotificationContent.MessageLike.KeyVerificationStart -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for verification ${content.javaClass.simpleName}")
|
||||
}
|
||||
is NotificationContent.MessageLike.Poll -> null.also {
|
||||
// TODO Polls: handle notification rendering
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for poll")
|
||||
}
|
||||
is NotificationContent.MessageLike.ReactionContent -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for reaction")
|
||||
}
|
||||
NotificationContent.MessageLike.RoomEncrypted -> fallbackNotifiableEvent(userId, roomId, eventId).also {
|
||||
Timber.tag(loggerTag.value).w("Notification with encrypted content -> fallback")
|
||||
}
|
||||
NotificationContent.MessageLike.RoomRedaction -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for redaction")
|
||||
}
|
||||
NotificationContent.MessageLike.Sticker -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for sticker")
|
||||
}
|
||||
NotificationContent.StateEvent.PolicyRuleRoom,
|
||||
NotificationContent.StateEvent.PolicyRuleServer,
|
||||
NotificationContent.StateEvent.PolicyRuleUser,
|
||||
NotificationContent.StateEvent.RoomAliases,
|
||||
NotificationContent.StateEvent.RoomAvatar,
|
||||
NotificationContent.StateEvent.RoomCanonicalAlias,
|
||||
NotificationContent.StateEvent.RoomCreate,
|
||||
NotificationContent.StateEvent.RoomEncryption,
|
||||
NotificationContent.StateEvent.RoomGuestAccess,
|
||||
NotificationContent.StateEvent.RoomHistoryVisibility,
|
||||
NotificationContent.StateEvent.RoomJoinRules,
|
||||
NotificationContent.StateEvent.RoomName,
|
||||
NotificationContent.StateEvent.RoomPinnedEvents,
|
||||
NotificationContent.StateEvent.RoomPowerLevels,
|
||||
NotificationContent.StateEvent.RoomServerAcl,
|
||||
NotificationContent.StateEvent.RoomThirdPartyInvite,
|
||||
NotificationContent.StateEvent.RoomTombstone,
|
||||
NotificationContent.StateEvent.RoomTopic,
|
||||
NotificationContent.StateEvent.SpaceChild,
|
||||
NotificationContent.StateEvent.SpaceParent -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for state event ${content.javaClass.simpleName}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue