mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: read unparsable item status as unknown (#2805)
This commit is contained in:
@@ -1626,6 +1626,7 @@ data class CIMeta (
|
||||
is CIStatus.SndErrorAuth -> MR.images.ic_close to Color.Red
|
||||
is CIStatus.SndError -> MR.images.ic_warning_filled to WarningYellow
|
||||
is CIStatus.RcvNew -> MR.images.ic_circle_filled to primaryColor
|
||||
is CIStatus.Invalid -> MR.images.ic_question_mark to metaColor
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -1712,6 +1713,7 @@ sealed class CIStatus {
|
||||
@Serializable @SerialName("sndError") class SndError(val agentError: String): CIStatus()
|
||||
@Serializable @SerialName("rcvNew") class RcvNew: CIStatus()
|
||||
@Serializable @SerialName("rcvRead") class RcvRead: CIStatus()
|
||||
@Serializable @SerialName("invalid") class Invalid(val text: String): CIStatus()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@@ -1949,6 +1951,7 @@ class CIFile(
|
||||
is CIFileStatus.RcvCancelled -> false
|
||||
is CIFileStatus.RcvComplete -> true
|
||||
is CIFileStatus.RcvError -> false
|
||||
is CIFileStatus.Invalid -> false
|
||||
}
|
||||
|
||||
@Transient
|
||||
@@ -1969,6 +1972,7 @@ class CIFile(
|
||||
is CIFileStatus.RcvCancelled -> null
|
||||
is CIFileStatus.RcvComplete -> null
|
||||
is CIFileStatus.RcvError -> null
|
||||
is CIFileStatus.Invalid -> null
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -2038,6 +2042,7 @@ sealed class CIFileStatus {
|
||||
@Serializable @SerialName("rcvComplete") object RcvComplete: CIFileStatus()
|
||||
@Serializable @SerialName("rcvCancelled") object RcvCancelled: CIFileStatus()
|
||||
@Serializable @SerialName("rcvError") object RcvError: CIFileStatus()
|
||||
@Serializable @SerialName("invalid") class Invalid(val text: String): CIFileStatus()
|
||||
}
|
||||
|
||||
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
|
||||
|
||||
+1
@@ -170,6 +170,7 @@ fun CIFileView(
|
||||
is CIFileStatus.RcvComplete -> fileIcon()
|
||||
is CIFileStatus.RcvCancelled -> fileIcon(innerIcon = painterResource(MR.images.ic_close))
|
||||
is CIFileStatus.RcvError -> fileIcon(innerIcon = painterResource(MR.images.ic_close))
|
||||
is CIFileStatus.Invalid -> fileIcon(innerIcon = painterResource(MR.images.ic_question_mark))
|
||||
}
|
||||
} else {
|
||||
fileIcon()
|
||||
|
||||
+1
@@ -86,6 +86,7 @@ fun CIImageView(
|
||||
is CIFileStatus.RcvTransfer -> progressIndicator()
|
||||
is CIFileStatus.RcvCancelled -> fileIcon(painterResource(MR.images.ic_close), MR.strings.icon_descr_file)
|
||||
is CIFileStatus.RcvError -> fileIcon(painterResource(MR.images.ic_close), MR.strings.icon_descr_file)
|
||||
is CIFileStatus.Invalid -> fileIcon(painterResource(MR.images.ic_question_mark), MR.strings.icon_descr_file)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -309,6 +309,7 @@ private fun loadingIndicator(file: CIFile?) {
|
||||
}
|
||||
is CIFileStatus.RcvCancelled -> fileIcon(painterResource(MR.images.ic_close), MR.strings.icon_descr_file)
|
||||
is CIFileStatus.RcvError -> fileIcon(painterResource(MR.images.ic_close), MR.strings.icon_descr_file)
|
||||
is CIFileStatus.Invalid -> fileIcon(painterResource(MR.images.ic_question_mark), MR.strings.icon_descr_file)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M432-332.5q1-70 17.75-104.25T511-509q40.5-35 62.25-68.25T595-648q0-46.5-30.5-76.5t-86-30q-52 0-80.5 29t-42 61l-81.5-36q23-59 75.25-99.25T478.5-840q100.5 0 154.25 55t53.75 134q0 47-21.25 88.5t-66.25 83q-48.5 45.5-58.5 70t-11 77H432Zm46.5 250q-27.5 0-47.5-20T411-150q0-28.5 20-48t47.5-19.5q28.5 0 48 19.5t19.5 48q0 27.5-19.5 47.5t-48 20Z"/></svg>
|
||||
|
After Width: | Height: | Size: 441 B |
Reference in New Issue
Block a user