fix: final touches

This commit is contained in:
infi 2026-05-25 01:24:35 +02:00
parent 4f12e86fe8
commit 23fb992f74
2 changed files with 16 additions and 9 deletions

View File

@ -182,7 +182,7 @@ class HandlerService : FirebaseMessagingService() {
val dbChannel = db.channelQueries.findById(channelId).executeAsOneOrNull()
val authorBitmap = loadBitmap(image)
val authorBitmap = runCatching { loadBitmap(image) }.getOrElse { generateLetterBitmap(authorName) }
val conversationBitmap: Bitmap = when (dbChannel?.channelType) {
"TextChannel", "VoiceChannel" -> {
val server =
@ -275,18 +275,24 @@ class HandlerService : FirebaseMessagingService() {
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val existingStyle = NotificationManagerCompat.from(this)
.activeNotifications
.firstOrNull { it.tag == channelId && it.id == NotificationID.NEW_MESSAGE }
?.notification
?.let { NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(it) }
val messagingStyle = (existingStyle ?: NotificationCompat.MessagingStyle(self))
.setGroupConversation(dbChannel?.channelType != "DirectMessage")
.setConversationTitle(channelName)
.addMessage(body, messageTimestamp, author)
val builder = NotificationCompat.Builder(this, CHANNEL_ID_GROUP_CONVERSATIONS_MESSAGES)
.setSmallIcon(R.drawable.ic_stoat_24dp)
.setContentTitle(authorName)
.setContentText(body)
.setContentIntent(contentIntent)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setStyle(
NotificationCompat.MessagingStyle(self)
.setGroupConversation(dbChannel?.channelType != "DirectMessage")
.setConversationTitle(channelName)
.addMessage(body, messageTimestamp, author)
)
.setStyle(messagingStyle)
.addAction(replyAction)
.addAction(markAsReadAction)
.setPriority(NotificationCompat.PRIORITY_HIGH)

View File

@ -184,7 +184,8 @@ fun ChannelInfoSheet(channelId: String, onHideSheet: suspend () -> Unit) {
}
}
SheetButton(
// FIXME: Waiting on backend!
/*SheetButton(
headlineContent = {
Text(
text = stringResource(id = R.string.channel_info_sheet_options_notifications_manage),
@ -197,7 +198,7 @@ fun ChannelInfoSheet(channelId: String, onHideSheet: suspend () -> Unit) {
)
},
onClick = {}
)
)*/
SheetButton(
headlineContent = {