Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ class MessageComposerPresenter(
notificationConversationService.onSendMessage(
sessionId = room.sessionId,
roomId = roomInfo.id,
roomName = roomInfo.name ?: roomInfo.id.value,
roomName = roomInfo.name,
roomIsDirect = roomInfo.isDm,
roomAvatarUrl = roomInfo.avatarUrl ?: roomMembers.getDirectRoomMember(roomInfo = roomInfo, sessionId = room.sessionId)?.avatarUrl,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface NotificationConversationService {
suspend fun onSendMessage(
sessionId: SessionId,
roomId: RoomId,
roomName: String,
roomName: String?,
roomIsDirect: Boolean,
roomAvatarUrl: String?,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DefaultNotificationConversationService(
override suspend fun onSendMessage(
sessionId: SessionId,
roomId: RoomId,
roomName: String,
roomName: String?,
roomIsDirect: Boolean,
roomAvatarUrl: String?,
) {
Expand All @@ -93,10 +93,11 @@ class DefaultNotificationConversationService(
val imageLoader = imageLoaderHolder.get(client)

val defaultShortcutIconSize = ShortcutManagerCompat.getIconMaxWidth(context)
val name = roomName?.takeIf { it.isNotBlank() } ?: roomId.value
val icon = bitmapLoader.getRoomBitmap(
avatarData = AvatarData(
id = roomId.value,
name = roomName,
name = name,
url = roomAvatarUrl,
size = AvatarSize.RoomDetailsHeader,
),
Expand All @@ -105,7 +106,7 @@ class DefaultNotificationConversationService(
)?.let(IconCompat::createWithBitmap)

val shortcutInfo = ShortcutInfoCompat.Builder(context, createShortcutId(sessionId, roomId))
.setShortLabel(roomName)
.setShortLabel(name)
.setIcon(icon)
.setIntent(intentProvider.getViewRoomIntent(sessionId, roomId, threadId = null, eventId = null))
.setCategories(categories)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FakeNotificationConversationService : NotificationConversationService {
override suspend fun onSendMessage(
sessionId: SessionId,
roomId: RoomId,
roomName: String,
roomName: String?,
roomIsDirect: Boolean,
roomAvatarUrl: String?,
) = Unit
Expand Down
Loading