commit ea8723d99067dad86202895dbeb15c8888f7c1b9
parent fb16a220b72227cc8d4759c2d4aa6623f1586abd
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Thu, 23 Nov 2023 22:51:24 +0100

fix(core/notifications): include username only for groups

Diffstat:
Mcore/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/Notifications.kt | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/Notifications.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/Notifications.kt @@ -303,7 +303,8 @@ class Notifications : Feature("Notifications", loadParams = FeatureLoadParams.IN } val computeMessages: () -> Unit = { computeNotificationMessages(data.notification, conversationId)} - fun setNotificationText(text: String, includeUsername: Boolean = true) { + fun setNotificationText(text: String) { + val includeUsername = context.database.getDMOtherParticipant(conversationId) == null cachedMessages.computeIfAbsent(conversationId) { sortedMapOf() }[orderKey] = if (includeUsername) "$senderUsername: $text" else text