directory: store log (#2863)

* directory: store log

* store log test (fails)

* fix store log
This commit is contained in:
Evgeny Poberezkin
2023-08-07 08:25:15 +01:00
committed by GitHub
parent 4826a62d36
commit 53662ef077
9 changed files with 417 additions and 154 deletions
+3 -3
View File
@@ -4847,13 +4847,13 @@ createInternalChatItem user cd content itemTs_ = do
ci <- liftIO $ mkChatItem cd ciId content Nothing Nothing Nothing Nothing False itemTs createdAt
toView $ CRNewChatItem user (AChatItem (chatTypeI @c) (msgDirection @d) (toChatInfo cd) ci)
getCreateActiveUser :: SQLiteStore -> IO User
getCreateActiveUser st = do
getCreateActiveUser :: SQLiteStore -> Bool -> IO User
getCreateActiveUser st testView = do
user <-
withTransaction st getUsers >>= \case
[] -> newUser
users -> maybe (selectUser users) pure (find activeUser users)
putStrLn $ "Current user: " <> userStr user
unless testView $ putStrLn $ "Current user: " <> userStr user
pure user
where
newUser :: IO User