From 307a1b3c5e171ebcba566c1016a5e0adc75303c5 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:23:45 +0000 Subject: [PATCH] fix for ghc 8.10.7 --- simplex-chat.cabal | 14 +++++++------- src/Simplex/Chat.hs | 2 +- src/Simplex/Chat/Store/Files.hs | 3 +-- src/Simplex/Chat/Types.hs | 1 - src/Simplex/Chat/View.hs | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/simplex-chat.cabal b/simplex-chat.cabal index c3791ac11..f238a99f3 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -186,7 +186,7 @@ library , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -238,7 +238,7 @@ executable simplex-bot , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -291,7 +291,7 @@ executable simplex-bot-advanced , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -346,7 +346,7 @@ executable simplex-broadcast-bot , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -400,7 +400,7 @@ executable simplex-chat , memory ==0.15.* , mtl ==2.2.* , network ==3.1.* - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -458,7 +458,7 @@ executable simplex-directory-service , memory ==0.15.* , mtl ==2.2.* , network >=3.1.2.7 && <3.2 - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 @@ -542,7 +542,7 @@ test-suite simplex-chat-test , memory ==0.15.* , mtl ==2.2.* , network ==3.1.* - , network-transport ==0.5.6 + , network-transport ==0.5.4 , optparse-applicative >=0.15 && <0.17 , process ==1.6.* , random >=1.1 && <1.3 diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index a1728b5dc..bac065f7a 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2247,7 +2247,7 @@ processChatCommand = \case forwardFile chatName fileId sendCommand = withUser $ \user -> do withStore (\db -> getFileTransfer db user fileId) >>= \case FTRcv RcvFileTransfer {fileStatus = RFSComplete RcvFileInfo {filePath}, cryptoArgs} -> forward filePath cryptoArgs - FTSnd {fileTransferMeta = FileTransferMeta {filePath, xftpSndFile}} -> forward filePath $ xftpSndFile >>= \f -> f.cryptoArgs + FTSnd {fileTransferMeta = FileTransferMeta {filePath, xftpSndFile}} -> forward filePath $ xftpSndFile >>= \XFTPSndFile {cryptoArgs} -> cryptoArgs _ -> throwChatError CEFileNotReceived {fileId} where forward path cfArgs = processChatCommand . sendCommand chatName $ CryptoFile path cfArgs diff --git a/src/Simplex/Chat/Store/Files.hs b/src/Simplex/Chat/Store/Files.hs index e3b1d4462..996a44b06 100644 --- a/src/Simplex/Chat/Store/Files.hs +++ b/src/Simplex/Chat/Store/Files.hs @@ -2,7 +2,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -904,7 +903,7 @@ getLocalCryptoFile db userId fileId sent = _ -> do unless sent $ throwError $ SEFileNotFound fileId FileTransferMeta {filePath, xftpSndFile} <- getFileTransferMeta_ db userId fileId - pure $ CryptoFile filePath $ xftpSndFile >>= \f -> f.cryptoArgs + pure $ CryptoFile filePath $ xftpSndFile >>= \XFTPSndFile {cryptoArgs} -> cryptoArgs updateDirectCIFileStatus :: forall d. MsgDirectionI d => DB.Connection -> User -> Int64 -> CIFileStatus d -> ExceptT StoreError IO AChatItem updateDirectCIFileStatus db user fileId fileStatus = do diff --git a/src/Simplex/Chat/Types.hs b/src/Simplex/Chat/Types.hs index 34f2a4f10..ddeee38d8 100644 --- a/src/Simplex/Chat/Types.hs +++ b/src/Simplex/Chat/Types.hs @@ -9,7 +9,6 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 60d2a4cba..314139f20 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -487,7 +487,7 @@ viewGroupSubscribed :: GroupInfo -> [StyledString] viewGroupSubscribed g = [membershipIncognito g <> ttyFullGroup g <> ": connected to server(s)"] showSMPServer :: SMPServer -> String -showSMPServer srv = B.unpack $ strEncode srv.host +showSMPServer ProtocolServer {host} = B.unpack $ strEncode host viewHostEvent :: AProtocolType -> TransportHost -> String viewHostEvent p h = map toUpper (B.unpack $ strEncode p) <> " host " <> B.unpack (strEncode h)