Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Note to self in conversation instead of your own Session ID #929

Merged
merged 5 commits into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,14 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
private fun setUpToolBar() {
setSupportActionBar(binding?.toolbar)
val actionBar = supportActionBar ?: return
val recipient = viewModel.recipient ?: return
actionBar.title = ""
actionBar.setDisplayHomeAsUpEnabled(true)
actionBar.setHomeButtonEnabled(true)
binding!!.toolbarContent.conversationTitleView.text = viewModel.recipient?.toShortString()
binding!!.toolbarContent.conversationTitleView.text = when {
recipient.isLocalNumber -> getString(R.string.note_to_self)
else -> recipient.toShortString()
}
@DimenRes val sizeID: Int = if (viewModel.recipient?.isClosedGroupRecipient == true) {
R.dimen.medium_profile_picture_size
} else {
Expand Down Expand Up @@ -629,18 +633,19 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
// region Animation & Updating
override fun onModified(recipient: Recipient) {
runOnUiThread {
val recipient = viewModel.recipient
if (recipient != null && recipient.isContactRecipient) {
binding?.blockedBanner?.isVisible = recipient.isBlocked
val threadRecipient = viewModel.recipient ?: return@runOnUiThread
if (threadRecipient.isContactRecipient) {
binding?.blockedBanner?.isVisible = threadRecipient.isBlocked
}
setUpMessageRequestsBar()
invalidateOptionsMenu()
updateSubtitle()
showOrHideInputIfNeeded()
if (recipient != null) {
binding?.toolbarContent?.profilePictureView?.root?.update(recipient)
binding?.toolbarContent?.profilePictureView?.root?.update(threadRecipient)
binding!!.toolbarContent.conversationTitleView.text = when {
threadRecipient.isLocalNumber -> getString(R.string.note_to_self)
else -> threadRecipient.toShortString()
}
binding?.toolbarContent?.conversationTitleView?.text = recipient?.toShortString()
}
}

Expand Down