diff --git a/apps/android/.idea/deploymentTargetDropDown.xml b/apps/android/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 57b651efa..000000000 --- a/apps/android/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/cabal.project b/cabal.project index 276b67617..7d40f79f3 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,7 @@ packages: . source-repository-package type: git location: git://github.com/simplex-chat/simplexmq.git - tag: 9c4778b12920db632322be27c3faf74bc9db3676 + tag: c1f5f9d8461e254c0c67c65de36f0860306b3d72 source-repository-package type: git diff --git a/sha256map.nix b/sha256map.nix index e8b0e6bb4..b03bfc42e 100644 --- a/sha256map.nix +++ b/sha256map.nix @@ -1,5 +1,5 @@ { - "git://github.com/simplex-chat/simplexmq.git"."9c4778b12920db632322be27c3faf74bc9db3676" = "0vkqkg0nl1z0ccggj1bjqv1i57vijhmw4qfm2myv07z88ch8brg8"; + "git://github.com/simplex-chat/simplexmq.git"."c1f5f9d8461e254c0c67c65de36f0860306b3d72" = "1qbj4xgg27qwm67187vkn87jggd3q47v4vylh915kbxw7npilalj"; "git://github.com/simplex-chat/aeson.git"."3eb66f9a68f103b5f1489382aad89f5712a64db7" = "0kilkx59fl6c3qy3kjczqvm8c3f4n3p0bdk9biyflf51ljnzp4yp"; "git://github.com/simplex-chat/haskell-terminal.git"."f708b00009b54890172068f168bf98508ffcd495" = "0zmq7lmfsk8m340g47g5963yba7i88n4afa6z93sg9px5jv1mijj"; "git://github.com/zw3rk/android-support.git"."3c3a5ab0b8b137a072c98d3d0937cbdc96918ddb" = "1r6jyxbim3dsvrmakqfyxbd6ms6miaghpbwyl0sr6dzwpgaprz97"; diff --git a/simplex-chat.cabal b/simplex-chat.cabal index 7b964a27d..d568e817a 100644 --- a/simplex-chat.cabal +++ b/simplex-chat.cabal @@ -17,8 +17,8 @@ build-type: Simple extra-source-files: README.md -if (os(linux)) - ghc-option: -DANDROID +if (os(darwin)) + ghc-option: -DIOS library exposed-modules: diff --git a/stack.yaml b/stack.yaml index 2b0db498a..739d0f5a1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -48,7 +48,7 @@ extra-deps: # - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561 # - ../simplexmq - github: simplex-chat/simplexmq - commit: 9c4778b12920db632322be27c3faf74bc9db3676 + commit: c1f5f9d8461e254c0c67c65de36f0860306b3d72 # - terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977 - github: simplex-chat/aeson commit: 3eb66f9a68f103b5f1489382aad89f5712a64db7 diff --git a/tests/MobileTests.hs b/tests/MobileTests.hs index f48cf7131..e0f219e80 100644 --- a/tests/MobileTests.hs +++ b/tests/MobileTests.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE NamedFieldPuns #-} module MobileTests where @@ -16,13 +17,32 @@ mobileTests = do it "start new chat with existing user" testChatApi noActiveUser :: String +#if defined(IOS) noActiveUser = "{\"resp\":{\"chatCmdError\":{\"chatError\":{\"error\":{\"errorType\":{\"noActiveUser\":{}}}}}}}" +#else +noActiveUser = "{\"resp\":{\"type\":\"chatCmdError\",\"chatError\":{\"type\":\"error\",\"errorType\":{\"type\":\"noActiveUser\"}}}}" +#endif activeUserExists :: String +#if defined(IOS) activeUserExists = "{\"resp\":{\"chatCmdError\":{\"chatError\":{\"error\":{\"errorType\":{\"activeUserExists\":{}}}}}}}" +#else +activeUserExists = "{\"resp\":{\"type\":\"chatCmdError\",\"chatError\":{\"type\":\"error\",\"errorType\":{\"type\":\"activeUserExists\"}}}}" +#endif activeUser :: String +#if defined(IOS) activeUser = "{\"resp\":{\"activeUser\":{\"user\":{\"userId\":1,\"userContactId\":1,\"localDisplayName\":\"alice\",\"profile\":{\"displayName\":\"alice\",\"fullName\":\"Alice\"},\"activeUser\":true}}}}" +#else +activeUser = "{\"resp\":{\"type\":\"activeUser\",\"user\":{\"userId\":1,\"userContactId\":1,\"localDisplayName\":\"alice\",\"profile\":{\"displayName\":\"alice\",\"fullName\":\"Alice\"},\"activeUser\":true}}}" +#endif + +chatStarted :: String +#if defined(IOS) +chatStarted = "{\"resp\":{\"chatStarted\":{}}}" +#else +chatStarted = "{\"resp\":{\"type\":\"chatStarted\"}}" +#endif testChatApiNoUser :: IO () testChatApiNoUser = withTmpFiles $ do @@ -30,7 +50,7 @@ testChatApiNoUser = withTmpFiles $ do chatSendCmd cc "/u" `shouldReturn` noActiveUser chatSendCmd cc "/_start" `shouldReturn` noActiveUser chatSendCmd cc "/u alice Alice" `shouldReturn` activeUser - chatSendCmd cc "/_start" `shouldReturn` "{\"resp\":{\"chatStarted\":{}}}" + chatSendCmd cc "/_start" `shouldReturn` chatStarted testChatApi :: IO () testChatApi = withTmpFiles $ do @@ -40,4 +60,4 @@ testChatApi = withTmpFiles $ do cc <- chatInit testDBPrefix chatSendCmd cc "/u" `shouldReturn` activeUser chatSendCmd cc "/u alice Alice" `shouldReturn` activeUserExists - chatSendCmd cc "/_start" `shouldReturn` "{\"resp\":{\"chatStarted\":{}}}" + chatSendCmd cc "/_start" `shouldReturn` chatStarted