Add special notifications for mentions (#1846)
* Add special notifications for mentions --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
committed by
GitHub
parent
12b3196471
commit
4de256b69c
+6
-1
@@ -82,6 +82,11 @@ class NotifiableEventResolver @Inject constructor(
|
||||
return when (val content = this.content) {
|
||||
is NotificationContent.MessageLike.RoomMessage -> {
|
||||
val messageBody = descriptionFromMessageContent(content, senderDisplayName ?: content.senderId.value)
|
||||
val notificationBody = if (hasMention) {
|
||||
stringProvider.getString(R.string.notification_mentioned_you_body, messageBody)
|
||||
} else {
|
||||
messageBody
|
||||
}
|
||||
buildNotifiableMessageEvent(
|
||||
sessionId = userId,
|
||||
senderId = content.senderId,
|
||||
@@ -90,7 +95,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||
noisy = isNoisy,
|
||||
timestamp = this.timestamp,
|
||||
senderName = senderDisplayName,
|
||||
body = messageBody,
|
||||
body = notificationBody,
|
||||
imageUriString = this.contentUrl,
|
||||
roomName = roomDisplayName,
|
||||
roomIsDirect = isDirect,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<string name="notification_invitation_action_join">"Vstoupit"</string>
|
||||
<string name="notification_invitation_action_reject">"Odmítnout"</string>
|
||||
<string name="notification_invite_body">"Vás pozval(a) do chatu"</string>
|
||||
<string name="notification_mentioned_you_body">"Zmínili vás: %1$s"</string>
|
||||
<string name="notification_new_messages">"Nové zprávy"</string>
|
||||
<string name="notification_reaction_body">"Reagoval(a) s %1$s"</string>
|
||||
<string name="notification_room_action_mark_as_read">"Označit jako přečtené"</string>
|
||||
|
||||
Reference in New Issue
Block a user