Browse Source

Not sharing the conversation link of Note to self

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
sowjanyakch 1 year ago
parent
commit
287ba3bbc9

+ 11 - 0
app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt

@@ -211,6 +211,17 @@ class ConversationInfoActivity :
                 is ConversationInfoViewModel.GetRoomSuccessState -> {
                     conversation = state.conversationModel
                     viewModel.getCapabilities(conversationUser, conversationToken, conversation!!)
+                    if (conversation?.name != context.getString(R.string.note_to_self)) {
+                        binding.shareConversationButton.visibility = VISIBLE
+                    }
+                    binding.shareConversationButton.setOnClickListener {
+                        ShareUtils.shareConversationLink(
+                            this,
+                            conversationUser.baseUrl,
+                            conversation?.token,
+                            conversation?.name
+                        )
+                    }
                 }
 
                 is ConversationInfoViewModel.GetRoomErrorState -> {

+ 1 - 0
app/src/main/res/layout/activity_conversation_info.xml

@@ -271,6 +271,7 @@
                 android:paddingEnd="@dimen/standard_margin"
                 android:paddingBottom="@dimen/standard_half_margin"
                 android:orientation="horizontal"
+                android:visibility = "gone"
                 android:background="?android:attr/selectableItemBackground">