Skip to content

Commit a80f51a

Browse files
committed
SES-4292 - Fixing community member crash
1 parent 54c6439 commit a80f51a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,15 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
688688
is ConversationUiEvent.ShowUnblockConfirmation -> {
689689
unblock()
690690
}
691+
692+
is ConversationUiEvent.ShowConversationSettings -> {
693+
val intent = ConversationSettingsActivity.createIntent(
694+
context = this@ConversationActivityV2,
695+
threadId = event.threadId,
696+
threadAddress = event.threadAddress
697+
)
698+
startActivity(intent)
699+
}
691700
}
692701
}
693702
}

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ class ConversationViewModel(
494494
pagerData += ConversationAppBarPagerData(
495495
title = title,
496496
action = {
497-
showGroupMembers()
497+
if(conversation.isCommunityRecipient) showConversationSettings()
498+
else showGroupMembers()
498499
},
499500
)
500501
}
@@ -1319,6 +1320,15 @@ class ConversationViewModel(
13191320
}
13201321
}
13211322

1323+
private fun showConversationSettings() {
1324+
recipient?.let { convo ->
1325+
_uiEvents.tryEmit(ConversationUiEvent.ShowConversationSettings(
1326+
threadId = threadId,
1327+
threadAddress = convo.address
1328+
))
1329+
}
1330+
}
1331+
13221332
private fun showNotificationSettings() {
13231333
_uiEvents.tryEmit(ConversationUiEvent.ShowNotificationSettings(threadId))
13241334
}
@@ -1480,6 +1490,7 @@ sealed interface ConversationUiEvent {
14801490
data class ShowDisappearingMessages(val threadId: Long) : ConversationUiEvent
14811491
data class ShowNotificationSettings(val threadId: Long) : ConversationUiEvent
14821492
data class ShowGroupMembers(val groupId: String) : ConversationUiEvent
1493+
data class ShowConversationSettings(val threadId: Long, val threadAddress: Address) : ConversationUiEvent
14831494
data object ShowUnblockConfirmation : ConversationUiEvent
14841495
}
14851496

0 commit comments

Comments
 (0)