core: keep chat item edit history (#2410)

This commit is contained in:
spaced4ndy
2023-05-08 20:07:51 +04:00
committed by GitHub
parent 27762492d7
commit c87f4e68f7
14 changed files with 415 additions and 30 deletions
+21
View File
@@ -1451,3 +1451,24 @@ jsonCIDeleted :: CIDeleted d -> JSONCIDeleted
jsonCIDeleted = \case
CIDeleted -> JCIDDeleted
CIModerated m -> JCIDModerated m
data ChatItemInfo = ChatItemInfo
{ chatItemId :: ChatItemId,
itemTs :: UTCTime,
createdAt :: UTCTime,
updatedAt :: UTCTime,
itemVersions :: [ChatItemVersion]
}
deriving (Eq, Show, Generic)
instance ToJSON ChatItemInfo where toEncoding = J.genericToEncoding J.defaultOptions
data ChatItemVersion = ChatItemVersion
{ chatItemVersionId :: Int64,
msgContent :: MsgContent,
itemVersionTs :: UTCTime,
createdAt :: UTCTime
}
deriving (Eq, Show, Generic)
instance ToJSON ChatItemVersion where toEncoding = J.genericToEncoding J.defaultOptions