Skip to content

Commit c265b7e

Browse files
Merge pull request #1407 from session-foundation/fix/qa-tweaks
1.27.0 fixes
2 parents 9d48cea + a80f51a commit c265b7e

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
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

app/src/main/java/org/thoughtcrime/securesms/util/UserProfileUtils.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class UserProfileUtils @AssistedInject constructor(
9191
isResolvedBlinded -> {
9292
"${address.substring(0, 23)}\n${address.substring(23, 46)}\n${address.substring(46)}" to
9393
Phrase.from(context, R.string.tooltipAccountIdVisible)
94-
.put(NAME_KEY, recipient.name)
94+
.put(NAME_KEY, truncateName(recipient.name))
9595
.format()
9696
}
9797

@@ -119,6 +119,14 @@ class UserProfileUtils @AssistedInject constructor(
119119

120120
}
121121

122+
private fun truncateName(name: String): String {
123+
return if (name.length > 10) {
124+
name.take(10) + ""
125+
} else {
126+
name
127+
}
128+
}
129+
122130
fun onCommand(command: UserProfileModalCommands){
123131
when(command){
124132
UserProfileModalCommands.ShowProCTA -> {

0 commit comments

Comments
 (0)