From 3be22590684b75dd6a1a910a710909c0d7bf5748 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 20 May 2023 14:42:50 +0200 Subject: [PATCH] update available reactions (#2466) --- .../java/chat/simplex/app/model/ChatModel.kt | 22 ++----------------- apps/ios/SimpleXChat/ChatTypes.swift | 17 +------------- src/Simplex/Chat.hs | 4 +--- src/Simplex/Chat/Protocol.hs | 2 +- 4 files changed, 5 insertions(+), 40 deletions(-) diff --git a/apps/android/app/src/main/java/chat/simplex/app/model/ChatModel.kt b/apps/android/app/src/main/java/chat/simplex/app/model/ChatModel.kt index 9390c9e639..4ddcf61447 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/model/ChatModel.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/model/ChatModel.kt @@ -1811,11 +1811,6 @@ sealed class MsgReaction { is Unknown -> "" } - val cmdString: String get() = when(this) { - is Emoji -> emoji.cmdString - is Unknown -> "" - } - companion object { val values: List get() = MREmojiChar.values().map(::Emoji) } @@ -1864,22 +1859,9 @@ enum class MREmojiChar(val value: String) { @SerialName("👍") ThumbsUp("👍"), @SerialName("👎") ThumbsDown("👎"), @SerialName("😀") Smile("😀"), - @SerialName("🎉") Celebration("🎉"), - @SerialName("😕") Confused("😕"), + @SerialName("😕") Sad("😢"), @SerialName("❤") Heart("❤"), - @SerialName("🚀") Launch("🚀"), - @SerialName("👀") Looking("👀"); - - val cmdString: String get() = when(this) { - ThumbsUp -> "+" - ThumbsDown -> "-" - Smile -> ")" - Celebration -> "!" - Confused -> "?" - Heart -> "*" - Launch -> "^" - Looking -> "%" - } + @SerialName("🚀") Launch("🚀"); } @Serializable diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index f54b4a29c9..957983e4a4 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -2495,24 +2495,9 @@ public enum MREmojiChar: String, Codable, CaseIterable { case thumbsup = "👍" case thumbsdown = "👎" case smile = "😀" - case celebration = "🎉" - case confused = "😕" + case sad = "😢" case heart = "❤" case launch = "🚀" - case looking = "👀" - - public var cmdString: String { - switch self { - case .thumbsup: return "+" - case .thumbsdown: return "-" - case .smile: return ")" - case .celebration: return "!" - case .confused: return "?" - case .heart: return "*" - case .launch: return "^" - case .looking: return "%" - } - } } extension MsgReaction: Decodable { diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index bd3cb3a6e5..6a40d51908 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -4950,11 +4950,9 @@ chatCommandP = '+' -> '👍' '-' -> '👎' ')' -> '😀' - '!' -> '🎉' - '?' -> '😕' + ',' -> '😢' '*' -> head "❤️" '^' -> '🚀' - '%' -> '👀' c -> c refChar c = c > ' ' && c /= '#' && c /= '@' liveMessageP = " live=" *> onOffP <|> pure False diff --git a/src/Simplex/Chat/Protocol.hs b/src/Simplex/Chat/Protocol.hs index dea2b5557b..49bd4db91f 100644 --- a/src/Simplex/Chat/Protocol.hs +++ b/src/Simplex/Chat/Protocol.hs @@ -267,7 +267,7 @@ instance FromJSON MREmojiChar where mrEmojiChar :: Char -> Either String MREmojiChar mrEmojiChar c - | c `elem` ("👍👎😀🎉😕❤️🚀👀" :: String) = Right $ MREmojiChar c + | c `elem` ("👍👎😀😢❤️🚀" :: String) = Right $ MREmojiChar c | otherwise = Left "bad emoji" data FileChunk = FileChunk {chunkNo :: Integer, chunkBytes :: ByteString} | FileChunkCancel