diff --git a/package.yaml b/package.yaml index 2ac89be665..c78393562c 100644 --- a/package.yaml +++ b/package.yaml @@ -27,7 +27,6 @@ dependencies: - email-validate == 2.3.* - exceptions == 0.10.* - filepath == 1.4.* - - githash == 0.1.* - http-types == 0.12.* - mtl == 2.2.* - network >= 3.1.2.7 && < 3.2 diff --git a/simplex-chat.cabal b/simplex-chat.cabal index d3f31b4c39..b8bf55e631 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -108,7 +108,6 @@ library , email-validate ==2.3.* , exceptions ==0.10.* , filepath ==1.4.* - , githash ==0.1.* , http-types ==0.12.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 @@ -152,7 +151,6 @@ executable simplex-bot , email-validate ==2.3.* , exceptions ==0.10.* , filepath ==1.4.* - , githash ==0.1.* , http-types ==0.12.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 @@ -197,7 +195,6 @@ executable simplex-bot-advanced , email-validate ==2.3.* , exceptions ==0.10.* , filepath ==1.4.* - , githash ==0.1.* , http-types ==0.12.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 @@ -243,7 +240,6 @@ executable simplex-chat , email-validate ==2.3.* , exceptions ==0.10.* , filepath ==1.4.* - , githash ==0.1.* , http-types ==0.12.* , mtl ==2.2.* , network ==3.1.* @@ -297,7 +293,6 @@ test-suite simplex-chat-test , email-validate ==2.3.* , exceptions ==0.10.* , filepath ==1.4.* - , githash ==0.1.* , hspec ==2.7.* , http-types ==0.12.* , mtl ==2.2.* diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 299bfaaaff..b708e293a9 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -1207,7 +1207,7 @@ processChatCommand = \case updateGroupProfileByName gName $ \p -> p {groupPreferences = Just . setGroupPreference' SGFTimedMessages pref $ groupPreferences p} QuitChat -> liftIO exitSuccess - ShowVersion -> pure $ CRVersionInfo versionNumber coreVersionInfo + ShowVersion -> pure $ CRVersionInfo versionNumber DebugLocks -> do chatLockName <- atomically . tryReadTMVar =<< asks chatLock agentLocks <- withAgent debugAgentLocks diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 3f8bcbf53e..8266f49dea 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -8,7 +8,6 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StrictData #-} -{-# LANGUAGE TemplateHaskell #-} module Simplex.Chat.Controller where @@ -34,7 +33,6 @@ import Data.Time (ZonedTime) import Data.Time.Clock (UTCTime) import Data.Version (showVersion) import GHC.Generics (Generic) -import GitHash import Numeric.Natural import qualified Paths_simplex_chat as SC import Simplex.Chat.Call @@ -63,19 +61,6 @@ import UnliftIO.STM versionNumber :: String versionNumber = showVersion SC.version -coreVersionInfo :: CoreVersionInfo -coreVersionInfo = - CoreVersionInfo - { commitHash = giHash gi, - commitDate = giCommitDate gi, - commitMessage = giCommitMessage gi, - branch = giBranch gi, - tag = giTag gi, - dirty = giDirty gi - } - where - gi = $$tGitInfoCwd - versionStr :: String versionStr = "SimpleX Chat v" <> versionNumber @@ -349,7 +334,7 @@ data ChatResponse | CRFileTransferStatus (FileTransfer, [Integer]) -- TODO refactor this type to FileTransferStatus | CRUserProfile {profile :: Profile} | CRUserProfileNoChange - | CRVersionInfo {version :: String, coreVersion :: CoreVersionInfo} + | CRVersionInfo {version :: String} | CRInvitation {connReqInvitation :: ConnReqInvitation} | CRSentConfirmation | CRSentInvitation {customUserProfile :: Maybe Profile} @@ -558,18 +543,6 @@ tmeToPref currentTTL tme = uncurry TimedMessagesPreference $ case tme of TMEEnableKeepTTL -> (FAYes, currentTTL) TMEDisableKeepTTL -> (FANo, currentTTL) -data CoreVersionInfo = CoreVersionInfo - { commitHash :: String, - commitDate :: String, - commitMessage :: String, - branch :: String, - tag :: String, - dirty :: Bool - } - deriving (Show, Generic) - -instance ToJSON CoreVersionInfo where toEncoding = J.genericToEncoding J.defaultOptions - data ChatError = ChatError {errorType :: ChatErrorType} | ChatErrorAgent {agentError :: AgentErrorType, connectionEntity_ :: Maybe ConnectionEntity} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 5f0096d67b..154d1d8cfc 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -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 _ info -> [plain versionStr, viewCoreVersionInfo info, plain updateStr] + CRVersionInfo _ -> [plain versionStr, plain updateStr] CRChatCmdError e -> viewChatError e CRInvitation cReq -> viewConnReqInvitation cReq CRSentConfirmation -> ["confirmation sent!"] @@ -1127,10 +1127,6 @@ 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