use conversationType to check if share button should be shown for conversation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-04-17 13:55:55 +02:00
parent 080937305a
commit f628d357ea
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
4 changed files with 7 additions and 3 deletions

View File

@ -203,7 +203,7 @@ class ConversationInfoActivity :
is ConversationInfoViewModel.GetRoomSuccessState -> {
conversation = state.conversationModel
viewModel.getCapabilities(conversationUser, conversationToken, conversation!!)
if (conversation?.name == context.getString(R.string.note_to_self)) {
if (ConversationUtils.isNoteToSelfConversation(conversation)) {
binding.shareConversationButton.visibility = GONE
}
binding.shareConversationButton.setOnClickListener {

View File

@ -214,6 +214,11 @@ data class Conversation(
}
}
@Deprecated("Use ConversationUtil")
fun isNoteToSelfConversation(): Boolean {
return type == ConversationType.NOTE_TO_SELF
}
enum class NotificationLevel {
DEFAULT,
ALWAYS,

View File

@ -125,7 +125,7 @@ class ConversationsListBottomDialog(
conversation.isNameEditable(currentUser)
)
binding.conversationLinkShare.visibility = setVisibleIf(
conversation.name != context.getString(R.string.note_to_self)
!conversation.isNoteToSelfConversation()
)
binding.conversationOperationDelete.visibility = setVisibleIf(

View File

@ -785,6 +785,5 @@ How to translate with transifex:
<string name="get_invitations_error">Failed to fetch pending invitations</string>
<string name="message_last_edited_by">Edited by %1$s</string>
<string name="share_link_to_conversation">Join conversation %1$s at %2$s</string>
<string name="note_to_self">Note to self</string>
<string name="nc_conversation_settings">Conversation settings</string>
</resources>