Skip to content

Commit

Permalink
use notif channel name over ID when available for mute txt
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Aug 30, 2024
1 parent 0ec60f7 commit 18d095d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class NotificationProcessor @Inject constructor(
listOf(TimelineAttributeFactory.title("Mute app"))
)
)
val muteChannelText = "Mute ${if (conversation) "conversation" else "channel"})" +
val muteChannelText = "Mute ${if (conversation) "conversation" else "channel"}" +
if (conversation) "" else "\n'$channel'"
add(
TimelineItem.Action(
Expand All @@ -175,7 +175,7 @@ class NotificationProcessor @Inject constructor(
try {
withTimeout(notificationProcessingTimeout) {
val (packageId, notifId, tagId, title, text, category, color, messages, actions, sbn) = notification
val conversationId = tagId?.let { notificationChannelDao.getConversationId(sbn.packageName, it) }
val channel = tagId?.let { notificationChannelDao.get(packageId, it) }

if (persistedNotifDao.getDuplicates(sbn.key, sbn.packageName, title, text).isNotEmpty()) {
Timber.d("Ignoring duplicate notification ${sbn.key}")
Expand Down Expand Up @@ -203,7 +203,7 @@ class NotificationProcessor @Inject constructor(

val itemId = uuidFrom(NotificationActionHandler.notificationUuidPrefix + (uuid4().toString()).substring(NotificationActionHandler.notificationUuidPrefix.length))
val attributes = buildPebbleAttributes(packageId, category, title, text, messages, color)
val pebbleActions = buildPebbleActions(actions, tagId, conversationId != null)
val pebbleActions = buildPebbleActions(actions, channel?.name ?: tagId, channel?.conversationId != null)
activeNotifsState.value += (itemId to sbn)

val notificationItem = TimelineItem(
Expand Down

0 comments on commit 18d095d

Please sign in to comment.