mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 03:16:05 +00:00
* directory: warn only on missing host member/contact relation * improve verification * log imported ID * fix userGroupRegId in case of duplicate * log updates of userGroupRegId * fix the fix * option to generate listings * clean up
28 lines
784 B
Haskell
28 lines
784 B
Haskell
{-# LANGUAGE LambdaCase #-}
|
|
{-# LANGUAGE NamedFieldPuns #-}
|
|
|
|
module Main where
|
|
|
|
import Directory.Options
|
|
import Directory.Service
|
|
import Directory.Store
|
|
import Directory.Store.Migrate
|
|
import Simplex.Chat.Terminal (terminalChatConfig)
|
|
|
|
main :: IO ()
|
|
main = do
|
|
opts@DirectoryOpts {directoryLog, migrateDirectoryLog, runCLI} <- welcomeGetOpts
|
|
case migrateDirectoryLog of
|
|
Just cmd -> migrate cmd opts terminalChatConfig
|
|
Nothing -> do
|
|
st <- openDirectoryLog directoryLog
|
|
if runCLI
|
|
then directoryServiceCLI st opts
|
|
else directoryService st opts terminalChatConfig
|
|
where
|
|
migrate = \case
|
|
MLCheck -> checkDirectoryLog
|
|
MLImport -> importDirectoryLogToDB
|
|
MLExport -> exportDBToDirectoryLog
|
|
MLListing -> saveGroupListingFiles
|