mobile: allow ending live message with an empty string (#1603)
This commit is contained in:
committed by
GitHub
parent
c0fb29d5f7
commit
b159496257
@@ -1450,14 +1450,8 @@ sealed class MsgContent {
|
||||
@Serializable(with = MsgContentSerializer::class) class MCFile(override val text: String): MsgContent()
|
||||
@Serializable(with = MsgContentSerializer::class) class MCUnknown(val type: String? = null, override val text: String, val json: JsonElement): MsgContent()
|
||||
|
||||
val cmdString: String get() = when (this) {
|
||||
is MCText -> "text $text"
|
||||
is MCLink -> "json ${json.encodeToString(this)}"
|
||||
is MCImage -> "json ${json.encodeToString(this)}"
|
||||
is MCVoice-> "json ${json.encodeToString(this)}"
|
||||
is MCFile -> "json ${json.encodeToString(this)}"
|
||||
is MCUnknown -> "json $json"
|
||||
}
|
||||
val cmdString: String get() =
|
||||
if (this is MCUnknown) "json $json" else "json ${json.encodeToString(this)}"
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
||||
@@ -1915,10 +1915,7 @@ public enum MsgContent {
|
||||
}
|
||||
|
||||
var cmdString: String {
|
||||
switch self {
|
||||
case let .text(text): return "text \(text)"
|
||||
default: return "json \(encodeJSON(self))"
|
||||
}
|
||||
"json \(encodeJSON(self))"
|
||||
}
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
|
||||
Reference in New Issue
Block a user