Skip to content
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

Update notifications rules: make a sound for each notification #5796

Merged
merged 5 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/46312.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the same notification rules than web / iOs client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth calling out that the change will mean we will notify for all (new) messages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we can, i update the message

Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ class NotificationUtils @Inject constructor(private val context: Context,

val channelID = if (roomInfo.shouldBing) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID
return NotificationCompat.Builder(context, channelID)
.setOnlyAlertOnce(true)
.setWhen(lastMessageTimestamp)
// MESSAGING_STYLE sets title and content for API 16 and above devices.
.setStyle(messageStyle)
Expand Down Expand Up @@ -682,7 +681,6 @@ class NotificationUtils @Inject constructor(private val context: Context,
val channelID = if (inviteNotifiableEvent.noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID

return NotificationCompat.Builder(context, channelID)
.setOnlyAlertOnce(true)
.setContentTitle(inviteNotifiableEvent.roomName ?: stringProvider.getString(R.string.app_name))
.setContentText(inviteNotifiableEvent.description)
.setGroup(stringProvider.getString(R.string.app_name))
Expand Down Expand Up @@ -756,7 +754,6 @@ class NotificationUtils @Inject constructor(private val context: Context,
val channelID = if (simpleNotifiableEvent.noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID

return NotificationCompat.Builder(context, channelID)
.setOnlyAlertOnce(true)
.setContentTitle(stringProvider.getString(R.string.app_name))
.setContentText(simpleNotifiableEvent.description)
.setGroup(stringProvider.getString(R.string.app_name))
Expand Down Expand Up @@ -866,7 +863,6 @@ class NotificationUtils @Inject constructor(private val context: Context,
val smallIcon = R.drawable.ic_status_bar

return NotificationCompat.Builder(context, if (noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID)
.setOnlyAlertOnce(true)
// used in compat < N, after summary is built based on child notifications
.setWhen(lastMessageTimestamp)
.setStyle(style)
Expand Down