core: only send voice messages without acceptance (#1444)

* core: only send voice messages without acceptance

* remove some unnecessary changes

* update

* refactor receiveInlineMode
This commit is contained in:
Evgeny Poberezkin
2022-11-26 22:39:56 +00:00
committed by GitHub
parent ade8c97b16
commit 7f0355ec67
9 changed files with 98 additions and 58 deletions
+6
View File
@@ -265,6 +265,7 @@ cmToQuotedMsg = \case
_ -> Nothing
data MsgContentTag = MCText_ | MCLink_ | MCImage_ | MCVoice_ | MCFile_ | MCUnknown_ Text
deriving (Eq)
instance StrEncoding MsgContentTag where
strEncode = \case
@@ -341,6 +342,11 @@ durationText duration =
| n <= 9 = '0' : show n
| otherwise = show n
isVoice :: MsgContent -> Bool
isVoice = \case
MCVoice {} -> True
_ -> False
msgContentTag :: MsgContent -> MsgContentTag
msgContentTag = \case
MCText _ -> MCText_