mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-23 14:35:48 +00:00
21 lines
650 B
Haskell
21 lines
650 B
Haskell
{-# LANGUAGE NamedFieldPuns #-}
|
|
|
|
module Main where
|
|
|
|
import Directory.Options
|
|
import Directory.Service
|
|
import Directory.Store
|
|
import Simplex.Chat.Controller (ChatConfig (..), ChatHooks (..), defaultChatHooks)
|
|
import Simplex.Chat.Core
|
|
import Simplex.Chat.Terminal (terminalChatConfig)
|
|
|
|
main :: IO ()
|
|
main = do
|
|
opts@DirectoryOpts {directoryLog, runCLI} <- welcomeGetOpts
|
|
st <- restoreDirectoryStore directoryLog
|
|
if runCLI
|
|
then directoryServiceCLI st opts
|
|
else do
|
|
let cfg = terminalChatConfig {chatHooks = defaultChatHooks {acceptMember = Just acceptMemberHook}}
|
|
simplexChatCore cfg (mkChatOpts opts) $ directoryService st opts
|