mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-22 17:38:25 +00:00
Hide sender prefix for note to self
This commit is contained in:
parent
916f705c50
commit
dd345cbf07
@ -136,17 +136,19 @@ class ConversationView : LinearLayout {
|
|||||||
else -> recipient.toShortString() // Internally uses the Contact API
|
else -> recipient.toShortString() // Internally uses the Contact API
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSnippet(thread: ThreadRecord): CharSequence {
|
private fun getSnippet(thread: ThreadRecord): CharSequence = thread.run {
|
||||||
thread.apply {
|
|
||||||
val body = getDisplayBody(context)
|
val body = getDisplayBody(context)
|
||||||
|
|
||||||
val snippetAuthor = lastMessage?.individualRecipient
|
when {
|
||||||
|
recipient.isLocalNumber -> body // Note to self
|
||||||
return if (lastMessage?.isOutgoing == true) {
|
lastMessage?.isOutgoing == true -> {
|
||||||
TextUtils.concat(resources.getString(R.string.MessageRecord_you), ": ", body)
|
TextUtils.concat(resources.getString(R.string.MessageRecord_you), ": ", body)
|
||||||
} else {
|
|
||||||
return snippetAuthor?.toShortString()?.let { TextUtils.concat(it, ": ", body) } ?: body
|
|
||||||
}
|
}
|
||||||
|
else -> lastMessage
|
||||||
|
?.individualRecipient
|
||||||
|
?.toShortString()
|
||||||
|
?.let { TextUtils.concat(it, ": ", body) }
|
||||||
|
?: body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user