mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-11 04:07:10 +00:00
22 lines
699 B
Haskell
22 lines
699 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
|
|
env <- newServiceState opts
|
|
let cfg = terminalChatConfig {chatHooks = defaultChatHooks {acceptMember = Just $ acceptMemberHook opts env}}
|
|
simplexChatCore cfg (mkChatOpts opts) $ directoryService st opts env
|