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

This commit is contained in:
rhunk
2023-11-23 22:51:24 +01:00
parent fb16a220b7
commit ea8723d990

View File

@ -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