mobile: switch to send_v2 in ios, add to android (#605)

This commit is contained in:
Evgeny Poberezkin
2022-05-05 15:44:48 +01:00
committed by GitHub
parent e80f617840
commit c8aa8db973
5 changed files with 18 additions and 20 deletions
@@ -887,6 +887,8 @@ class CIFile(
@Serializable
enum class CIFileStatus {
@SerialName("snd_stored") SndStored,
@SerialName("snd_transfer") SndTransfer,
@SerialName("snd_complete") SndComplete,
@SerialName("snd_cancelled") SndCancelled,
@SerialName("rcv_invitation") RcvInvitation,
@SerialName("rcv_accepted") RcvAccepted,
@@ -567,6 +567,8 @@ sealed class CC {
file != null && quotedItemId != null -> "/_send ${chatRef(type, id)} file $file quoted $quotedItemId ${mc.cmdString}"
else -> throw Exception()
}
// TODO use below
// is ApiSendMessage -> "/_send_v2 ${chatRef(type, id)} ${json.encodeToString(ComposedMessage(file, quotedItemId, mc))}"
is ApiUpdateChatItem -> "/_update item ${chatRef(type, id)} $itemId ${mc.cmdString}"
is ApiDeleteChatItem -> "/_delete item ${chatRef(type, id)} $itemId ${mode.deleteMode}"
is GetUserSMPServers -> "/smp_servers"
@@ -621,6 +623,9 @@ sealed class CC {
}
}
@Serializable
class ComposedMessage(val filePath: String?, val quotedItemId: Long?, val msgContent: MsgContent)
val json = Json {
prettyPrint = true
ignoreUnknownKeys = true