Skip to content

Commit

Permalink
Implement handle lookup in mini backend
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed May 22, 2024
1 parent 8c79463 commit 3f3ac72
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions libs/wire-subsystems/src/Wire/MiniBackend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ where

import Data.Default (Default (def))
import Data.Domain
import Data.Handle (Handle)
import Data.Id
import Data.LanguageCodes (ISO639_1 (EN))
import Data.LegalHold (defUserLegalHoldStatus)
Expand Down Expand Up @@ -367,9 +368,16 @@ staticUserStoreInterpreter = interpret $ \case
. maybe Imports.id setStoredUserName update.name
$ u
doUpdate u = pure u
-- TODO
LookupHandle {} -> pure Nothing
GlimpseHandle {} -> pure Nothing
LookupHandle h -> miniBackendLookupHandle h
GlimpseHandle h -> miniBackendLookupHandle h

miniBackendLookupHandle ::
Member (State MiniBackend) r =>
Handle ->
Sem r (Maybe UserId)
miniBackendLookupHandle h = do
users <- gets (.users)
pure $ fmap (.id) . listToMaybe $ filter ((== Just h) . (.handle)) users

-- | interprets galley by statically returning the values passed
miniGalleyAPIAccess ::
Expand Down

0 comments on commit 3f3ac72

Please sign in to comment.