Fix 'Conversation label cannot be empty' error (#6823)
This happens when building a `ShortcutInfoCompat` in `DefaultNotificationConversationService.onSendMessage` when the provided room name is not null but it's empty.
This commit is contained in:
parent
42c141109f
commit
64d9336901
4 changed files with 7 additions and 6 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ interface NotificationConversationService {
|
|||
suspend fun onSendMessage(
|
||||
sessionId: SessionId,
|
||||
roomId: RoomId,
|
||||
roomName: String,
|
||||
roomName: String?,
|
||||
roomIsDirect: Boolean,
|
||||
roomAvatarUrl: String?,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class DefaultNotificationConversationService(
|
|||
override suspend fun onSendMessage(
|
||||
sessionId: SessionId,
|
||||
roomId: RoomId,
|
||||
roomName: String,
|
||||
roomName: String?,
|
||||
roomIsDirect: Boolean,
|
||||
roomAvatarUrl: String?,
|
||||
) {
|
||||
|
|
@ -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,
|
||||
),
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class FakeNotificationConversationService : NotificationConversationService {
|
|||
override suspend fun onSendMessage(
|
||||
sessionId: SessionId,
|
||||
roomId: RoomId,
|
||||
roomName: String,
|
||||
roomName: String?,
|
||||
roomIsDirect: Boolean,
|
||||
roomAvatarUrl: String?,
|
||||
) = Unit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue