mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: update version response (#1819)
* core: update version response * add simplexmq commit and version to version info * refactor
This commit is contained in:
committed by
GitHub
parent
8ff8f9d695
commit
114b76e3f8
@@ -112,7 +112,7 @@ responseToView user_ ChatConfig {logLevel, 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 -> viewVersionInfo logLevel info
|
||||
CRChatCmdError e -> viewChatError logLevel e
|
||||
CRInvitation cReq -> viewConnReqInvitation cReq
|
||||
CRSentConfirmation -> ["confirmation sent!"]
|
||||
@@ -1142,6 +1142,15 @@ instance ToJSON WCallCommand where
|
||||
toEncoding = J.genericToEncoding . taggedObjectJSON $ dropPrefix "WCCall"
|
||||
toJSON = J.genericToJSON . taggedObjectJSON $ dropPrefix "WCCall"
|
||||
|
||||
viewVersionInfo :: ChatLogLevel -> CoreVersionInfo -> [StyledString]
|
||||
viewVersionInfo logLevel CoreVersionInfo {version, buildTimestamp, simplexmqVersion, simplexmqCommit} =
|
||||
map plain $
|
||||
if logLevel <= CLLInfo
|
||||
then [versionString version <> parens buildTimestamp, updateStr, "simplexmq: " <> simplexmqVersion <> parens simplexmqCommit]
|
||||
else [versionString version, updateStr]
|
||||
where
|
||||
parens s = " (" <> s <> ")"
|
||||
|
||||
viewChatError :: ChatLogLevel -> ChatError -> [StyledString]
|
||||
viewChatError logLevel = \case
|
||||
ChatError err -> case err of
|
||||
|
||||
Reference in New Issue
Block a user