mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-26 03:14:36 +00:00
64381be91d
* initial mobile app design draft * add proposals * xcode project * refactor function to send to view as parameter * export C interface * remove unused files * run chat from chatInit * split chatStart to a separate function * replace file-embed with QQ * add mobile views * server using IP address * pass dbFilePrefix as parameter to chatInit * comment on enabling logging * fix mobile db config * update C API, make user non-optional in ChatController * restore SMP server addresses * revert the change in the tests * flip dependency - now Controller depends on Terminal * make ChatController independent of terminal package * fix Main.hs * add iOS .gitignore * refactor Simplex.Chat.Terminal Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
29 lines
831 B
Haskell
29 lines
831 B
Haskell
{-# LANGUAGE DuplicateRecordFields #-}
|
|
{-# LANGUAGE FlexibleContexts #-}
|
|
{-# LANGUAGE NamedFieldPuns #-}
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Main where
|
|
|
|
import Simplex.Chat
|
|
import Simplex.Chat.Controller (versionNumber)
|
|
import Simplex.Chat.Options
|
|
import Simplex.Chat.Terminal
|
|
import System.Directory (getAppUserDataDirectory)
|
|
import System.Terminal (withTerminal)
|
|
|
|
main :: IO ()
|
|
main = do
|
|
opts <- welcomeGetOpts
|
|
t <- withTerminal pure
|
|
simplexChat defaultChatConfig opts t
|
|
|
|
welcomeGetOpts :: IO ChatOpts
|
|
welcomeGetOpts = do
|
|
appDir <- getAppUserDataDirectory "simplex"
|
|
opts@ChatOpts {dbFilePrefix} <- getChatOpts appDir
|
|
putStrLn $ "SimpleX Chat v" ++ versionNumber
|
|
putStrLn $ "db: " <> dbFilePrefix <> "_chat.db, " <> dbFilePrefix <> "_agent.db"
|
|
putStrLn "type \"/help\" or \"/h\" for usage info"
|
|
pure opts
|