mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 04:20:00 +03:00
Improve description format
This commit is contained in:
parent
a3c331019d
commit
ec50f891a2
1 changed files with 8 additions and 3 deletions
|
@ -119,13 +119,18 @@ class IncomingVerificationRequestHandler @Inject constructor(
|
||||||
Timber.v("## SAS verificationRequestCreated ${pr.transactionId}")
|
Timber.v("## SAS verificationRequestCreated ${pr.transactionId}")
|
||||||
// For incoming request we should prompt (if not in activity where this request apply)
|
// For incoming request we should prompt (if not in activity where this request apply)
|
||||||
if (pr.isIncoming) {
|
if (pr.isIncoming) {
|
||||||
val user = session?.getUser(pr.otherUserId)
|
val user = session?.getUser(pr.otherUserId)?.toMatrixItem()
|
||||||
val name = user?.getBestName() ?: pr.otherUserId
|
val name = user?.getBestName() ?: pr.otherUserId
|
||||||
|
val description = if (name == pr.otherUserId) {
|
||||||
|
name
|
||||||
|
} else {
|
||||||
|
"$name (${pr.otherUserId})"
|
||||||
|
}
|
||||||
|
|
||||||
val alert = VerificationVectorAlert(
|
val alert = VerificationVectorAlert(
|
||||||
uniqueIdForVerificationRequest(pr),
|
uniqueIdForVerificationRequest(pr),
|
||||||
context.getString(R.string.sas_incoming_request_notif_title),
|
context.getString(R.string.sas_incoming_request_notif_title),
|
||||||
"$name(${pr.otherUserId})",
|
description,
|
||||||
R.drawable.ic_shield_black,
|
R.drawable.ic_shield_black,
|
||||||
shouldBeDisplayedIn = { activity ->
|
shouldBeDisplayedIn = { activity ->
|
||||||
if (activity is RoomDetailActivity) {
|
if (activity is RoomDetailActivity) {
|
||||||
|
@ -136,7 +141,7 @@ class IncomingVerificationRequestHandler @Inject constructor(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.apply {
|
.apply {
|
||||||
viewBinder = VerificationVectorAlert.ViewBinder(user?.toMatrixItem(), avatarRenderer.get())
|
viewBinder = VerificationVectorAlert.ViewBinder(user, avatarRenderer.get())
|
||||||
contentAction = Runnable {
|
contentAction = Runnable {
|
||||||
(weakCurrentActivity?.get() as? VectorBaseActivity<*>)?.let {
|
(weakCurrentActivity?.get() as? VectorBaseActivity<*>)?.let {
|
||||||
val roomId = pr.roomId
|
val roomId = pr.roomId
|
||||||
|
|
Loading…
Add table
Reference in a new issue