On app start, launch only verified Persons

This commit is contained in:
Pere Lev 2023-06-10 10:56:02 +03:00
parent a41356c261
commit d5d6b0af61
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D

View file

@ -344,7 +344,7 @@ makeFoundation appSettings = do
loadTheater :: Env -> WorkerDB [(LocalActorBy Key, Env, Verse -> Act (Either Text Text, Act (), Next))]
loadTheater env = concat <$> sequenceA
[ selectAll LocalActorPerson
[ selectAllWhere LocalActorPerson (PersonVerified ==. True)
, selectAll LocalActorGroup
, selectAll LocalActorRepo
, selectAll LocalActorDeck
@ -358,6 +358,14 @@ makeFoundation appSettings = do
selectAll makeLocalActor =
map (\ xid -> (makeLocalActor xid, env, behave actorBehavior xid)) <$>
selectKeysList [] []
selectAllWhere
:: (PersistRecordBackend a SqlBackend, VervisActor a)
=> (Key a -> LocalActorBy Key)
-> Filter a
-> WorkerDB [(LocalActorBy Key, Env, Verse -> Act (Either Text Text, Act (), Next))]
selectAllWhere makeLocalActor filt =
map (\ xid -> (makeLocalActor xid, env, behave actorBehavior xid)) <$>
selectKeysList [filt] []
startPersonLauncher :: Theater -> Env -> IO (MVar (PersonId, MVar Bool))
startPersonLauncher theater env = do