feat: highlight if mention, fix avatar padding
Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
parent
f778a0502c
commit
8d143dffd1
|
|
@ -12,6 +12,7 @@ import androidx.activity.compose.rememberLauncherForActivityResult
|
|||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.combinedClickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -145,6 +146,17 @@ fun Message(
|
|||
Spacer(modifier = Modifier.height(10.dp))
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier.then(
|
||||
if (message.mentions?.contains(RevoltAPI.selfId) == true) {
|
||||
Modifier.background(
|
||||
MaterialTheme.colorScheme.primary.copy(alpha = 0.1f)
|
||||
)
|
||||
} else {
|
||||
Modifier
|
||||
}
|
||||
)
|
||||
) {
|
||||
message.replies?.forEach { reply ->
|
||||
val replyMessage = RevoltAPI.messageCache[reply]
|
||||
|
||||
|
|
@ -179,12 +191,15 @@ fun Message(
|
|||
.fillMaxWidth()
|
||||
) {
|
||||
if (message.tail == false) {
|
||||
Column {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
UserAvatar(
|
||||
username = author.username ?: "",
|
||||
userId = author.id ?: message.id ?: ULID.makeSpecial(0),
|
||||
avatar = author.avatar,
|
||||
rawUrl = message.masquerade?.avatar?.let { asJanuaryProxyUrl(it) }
|
||||
)
|
||||
}
|
||||
} else {
|
||||
UserAvatarWidthPlaceholder()
|
||||
}
|
||||
|
|
@ -305,4 +320,5 @@ fun Message(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue