diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-10-29 20:19:46 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-10-29 21:36:21 +0100 |
commit | 5736b214b44bf34b3d2c0d6921c5044a6ad4378b (patch) | |
tree | 72c5ae2354fc1ebb93eff86e81876875e3277619 /src/Erebos/Identity.hs | |
parent | e51286039a0413cfbc456b0a9386c8ea369fdce3 (diff) |
Chatroom-specific identity
Changelog: Chatroom-specific identity
Diffstat (limited to 'src/Erebos/Identity.hs')
-rw-r--r-- | src/Erebos/Identity.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Erebos/Identity.hs b/src/Erebos/Identity.hs index f2094f6..577e5ac 100644 --- a/src/Erebos/Identity.hs +++ b/src/Erebos/Identity.hs @@ -13,7 +13,7 @@ module Erebos.Identity ( createIdentity, validateIdentity, validateIdentityF, validateIdentityFE, validateExtendedIdentity, validateExtendedIdentityF, validateExtendedIdentityFE, - loadIdentity, loadUnifiedIdentity, + loadIdentity, loadMbIdentity, loadUnifiedIdentity, loadMbUnifiedIdentity, mergeIdentity, toUnifiedIdentity, toComposedIdentity, updateIdentity, updateOwners, @@ -282,9 +282,15 @@ validateExtendedIdentityFE mdata = do loadIdentity :: String -> LoadRec ComposedIdentity loadIdentity name = maybe (throwError "identity validation failed") return . validateExtendedIdentityF =<< loadRefs name +loadMbIdentity :: String -> LoadRec (Maybe ComposedIdentity) +loadMbIdentity name = return . validateExtendedIdentityF =<< loadRefs name + loadUnifiedIdentity :: String -> LoadRec UnifiedIdentity loadUnifiedIdentity name = maybe (throwError "identity validation failed") return . validateExtendedIdentity =<< loadRef name +loadMbUnifiedIdentity :: String -> LoadRec (Maybe UnifiedIdentity) +loadMbUnifiedIdentity name = return . (validateExtendedIdentity =<<) =<< loadMbRef name + gatherPrevious :: Set (Stored (Signed ExtendedIdentityData)) -> [Stored (Signed ExtendedIdentityData)] -> Set (Stored (Signed ExtendedIdentityData)) gatherPrevious res (n:ns) | n `S.member` res = gatherPrevious res ns |