mirror of
https://code.naskya.net/repos/ndqEd
synced 2025-03-20 15:14:54 +09:00
C2S: Re-implement and enable resolveC, followC, undoC
This commit is contained in:
parent
fa7f765e2e
commit
8f8354ea5e
18 changed files with 946 additions and 563 deletions
src/Web
|
@ -1513,21 +1513,21 @@ encodeCreate (Create obj target)
|
|||
|
||||
data Follow u = Follow
|
||||
{ followObject :: ObjURI u
|
||||
, followContext :: Maybe (ObjURI u)
|
||||
, followContext :: Maybe LocalURI
|
||||
, followHide :: Bool
|
||||
}
|
||||
|
||||
parseFollow :: UriMode u => Object -> Parser (Follow u)
|
||||
parseFollow o =
|
||||
Follow
|
||||
<$> o .: "object"
|
||||
<*> o .:? "context"
|
||||
parseFollow o = do
|
||||
u@(ObjURI h _) <- o .: "object"
|
||||
Follow u
|
||||
<$> withAuthorityMaybeO h (o .:? "context")
|
||||
<*> o .:? "hide" .!= False
|
||||
|
||||
encodeFollow :: UriMode u => Follow u -> Series
|
||||
encodeFollow (Follow obj mcontext hide)
|
||||
= "object" .= obj
|
||||
<> "context" .=? mcontext
|
||||
<> "context" .=? (ObjURI (objUriAuthority obj) <$> mcontext)
|
||||
<> "hide" .= hide
|
||||
|
||||
data Grant u = Grant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue