core: include commit information in /v response (#1705)

This commit is contained in:
Evgeny Poberezkin
2023-01-07 16:38:35 +00:00
committed by GitHub
parent 113c67ec95
commit 3d4e4e2ef9
5 changed files with 40 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ responseToView user_ testView liveItems ts = \case
CRFileTransferStatus ftStatus -> viewFileTransferStatus ftStatus
CRUserProfile p -> viewUserProfile p
CRUserProfileNoChange -> ["user profile did not change"]
CRVersionInfo _ -> [plain versionStr, plain updateStr]
CRVersionInfo _ info -> [plain versionStr, viewCoreVersionInfo info, plain updateStr]
CRChatCmdError e -> viewChatError e
CRInvitation cReq -> viewConnReqInvitation cReq
CRSentConfirmation -> ["confirmation sent!"]
@@ -1127,6 +1127,10 @@ instance ToJSON WCallCommand where
toEncoding = J.genericToEncoding . taggedObjectJSON $ dropPrefix "WCCall"
toJSON = J.genericToJSON . taggedObjectJSON $ dropPrefix "WCCall"
viewCoreVersionInfo :: CoreVersionInfo -> StyledString
viewCoreVersionInfo CoreVersionInfo {commitHash, commitMessage, commitDate} =
plain $ "commit " <> commitHash <> ": " <> commitMessage <> " (" <> commitDate <> ")"
viewChatError :: ChatError -> [StyledString]
viewChatError = \case
ChatError err -> case err of