diff --git a/changelog.d/1040.bugfix b/changelog.d/1040.bugfix new file mode 100644 index 0000000000..2c5fb1ba3b --- /dev/null +++ b/changelog.d/1040.bugfix @@ -0,0 +1 @@ +Ajout d'un lien par défaut pour les salons sans alias accessibles par lien. \ No newline at end of file diff --git a/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessController.kt b/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessController.kt index 5acb9d5885..53b8ce21af 100644 --- a/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessController.kt +++ b/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessController.kt @@ -39,7 +39,7 @@ class TchapRoomLinkAccessController @Inject constructor( interface InteractionListener { fun setLinkAccessEnabled(isEnabled: Boolean) - fun openAliasDetail(alias: String) + fun openAliasDetail(roomIdOrAlias: String) } var interactionListener: InteractionListener? = null @@ -84,18 +84,19 @@ class TchapRoomLinkAccessController @Inject constructor( id("LinkAccessInfo") helperTextResId( when { - !state.isLinkAccessEnabled -> R.string.tchap_room_settings_enable_room_access_by_link_info_off + !state.isLinkAccessEnabled -> R.string.tchap_room_settings_enable_room_access_by_link_info_off roomType == TchapRoomType.EXTERNAL -> R.string.tchap_room_settings_enable_room_access_by_link_info_on_with_limitation - else -> R.string.tchap_room_settings_enable_room_access_by_link_info_on + else -> R.string.tchap_room_settings_enable_room_access_by_link_info_on } ) } - if (state.isLinkAccessEnabled && !state.canonicalAlias.isNullOrEmpty()) { + if (state.isLinkAccessEnabled) { + val roomIdOrAlias = state.canonicalAlias ?: state.roomId profileActionItem { id("canonicalAlias") - title(state.canonicalAlias) - listener { host.interactionListener?.openAliasDetail(state.canonicalAlias) } + title(roomIdOrAlias) + listener { host.interactionListener?.openAliasDetail(roomIdOrAlias) } } } } diff --git a/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessFragment.kt b/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessFragment.kt index 0df9d66783..78f7583b5a 100644 --- a/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessFragment.kt +++ b/vector/src/main/java/fr/gouv/tchap/features/roomprofile/settings/linkaccess/TchapRoomLinkAccessFragment.kt @@ -97,9 +97,9 @@ class TchapRoomLinkAccessFragment : VectorBaseFragment handleCopy(action.permalink) + is TchapRoomLinkAccessBottomSheetSharedAction.CopyLink -> handleCopy(action.permalink) is TchapRoomLinkAccessBottomSheetSharedAction.ForwardLink -> handleForward(action.permalink) - is TchapRoomLinkAccessBottomSheetSharedAction.ShareLink -> handleShare(action.permalink) + is TchapRoomLinkAccessBottomSheetSharedAction.ShareLink -> handleShare(action.permalink) } } @@ -107,9 +107,9 @@ class TchapRoomLinkAccessFragment : VectorBaseFragment