-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add special notifications for mentions #1846
Add special notifications for mentions #1846
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1846 +/- ##
========================================
Coverage 66.48% 66.48%
========================================
Files 1308 1308
Lines 33055 33058 +3
Branches 7083 7084 +1
========================================
+ Hits 21976 21979 +3
Misses 7724 7724
Partials 3355 3355 ☔ View full report in Codecov by Sentry. |
013f875
to
a9d4bdb
Compare
@@ -83,6 +83,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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of the string is:
<string name="notification_mentioned_you_body">"%1$s mentioned you.
%2$s"</string>
so it seems like a parameter is missing here? The messageBody
will be used for %1$s
and it should be the sender. Can you double check please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you want to use notification_mentioned_you_fallback_body
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not anymore: https://github.com/vector-im/element-x-android/pull/1846/files#diff-ceb20f078550a897a919802d4b7635a8299f6ac1ef679aefba72e4c294954f2dR11.
notification_mentioned_you_fallback_body
was removed for this same reason. We decided to change what the message looked like since it was too verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it's fine now. I do not know what happened with all those string values, and it does not worth investigate more about it. Thanks!
e0b9035
to
36ca1b7
Compare
…l-notifications-for-mentions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -83,6 +83,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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it's fine now. I do not know what happened with all those string values, and it does not worth investigate more about it. Thanks!
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test in NotifiableEventResolverTest
to cover this case?
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Type of change
Content
Motivation and context
Closes #1451
Screenshots / GIFs
Tests
Tested devices
Checklist