core: support for live messages (#1577)

This commit is contained in:
Evgeny Poberezkin
2022-12-16 07:51:04 +00:00
committed by GitHub
parent acfb98bd81
commit 6b8705e9f4
9 changed files with 188 additions and 163 deletions

View File

@@ -367,8 +367,12 @@ parseMsgContainer v =
where
mc = ExtMsgContent <$> v .: "content" <*> v .:? "file" <*> v .:? "ttl" <*> v .:? "live"
extMsgContent :: MsgContent -> Maybe FileInvitation -> Maybe Int -> ExtMsgContent
extMsgContent mc file ttl = ExtMsgContent mc file ttl Nothing
extMsgContent :: MsgContent -> Maybe FileInvitation -> ExtMsgContent
extMsgContent mc file = ExtMsgContent mc file Nothing Nothing
justTrue :: Bool -> Maybe Bool
justTrue True = Just True
justTrue False = Nothing
instance FromJSON MsgContent where
parseJSON (J.Object v) =