align more

This commit is contained in:
spaced4ndy 2025-06-27 13:22:29 +04:00
parent 86953de2f4
commit a7a2d53a7e
3 changed files with 8 additions and 3 deletions

View file

@ -1677,8 +1677,8 @@ data class Contact(
val active get() = contactStatus == ContactStatus.Active
override val nextConnect get() = sendMsgToConnect
val nextSendGrpInv get() = contactGroupMemberId != null && !contactGrpInvSent
val nextConnectPrepared get() = preparedContact != null && activeConn == null
val nextAcceptContactRequest get() = contactRequestId != null && activeConn == null
val nextConnectPrepared get() = preparedContact != null && (activeConn == null || activeConn.connStatus == ConnStatus.Prepared)
val nextAcceptContactRequest get() = contactRequestId != null && (activeConn == null || activeConn.connStatus == ConnStatus.New)
val sendMsgToConnect get() = nextSendGrpInv || nextConnectPrepared
override val incognito get() = contactConnIncognito
override fun featureEnabled(feature: ChatFeature) = when (feature) {

View file

@ -511,6 +511,7 @@ fun ComposeView(
withContext(Dispatchers.Main) {
chatsCtx.updateContact(chat.remoteHostId, contact)
clearState()
chatModel.setContactNetworkStatus(contact, NetworkStatus.Connected())
}
}
}
@ -523,6 +524,7 @@ fun ComposeView(
withContext(Dispatchers.Main) {
chatsCtx.updateContact(chat.remoteHostId, contact)
clearState()
chatModel.setContactNetworkStatus(contact, NetworkStatus.Connected())
}
}
}

View file

@ -346,7 +346,10 @@ fun ChatPreviewView(
@Composable
fun chatStatusImage() {
if (cInfo is ChatInfo.Direct) {
if (cInfo.contact.active && cInfo.contact.activeConn != null) {
if (
cInfo.contact.active &&
(cInfo.contact.activeConn?.connStatus == ConnStatus.Ready || cInfo.contact.activeConn?.connStatus == ConnStatus.SndReady)
) {
val descr = contactNetworkStatus?.statusString
when (contactNetworkStatus) {
is NetworkStatus.Connected ->