diff --git a/src/Vervis/Actor/Group.hs b/src/Vervis/Actor/Group.hs index ac4d6d3..3a17068 100644 --- a/src/Vervis/Actor/Group.hs +++ b/src/Vervis/Actor/Group.hs @@ -853,89 +853,85 @@ groupAdd now groupID (Verse authorIdMsig body) add = do -- Meaning: An actor accepted something -- Behavior: --- * Check if I know the activity that's being Accepted: --- * Is it an Invite to be a collaborator in me? --- * Verify the Accept is by the Invite target --- * Is it a Join to be a collaborator in me? --- * Verify the Accept is authorized --- * Is it an Invite to be a component of me? --- * Nothing to check at this point +-- * Is it an Invite to be a collaborator in me? +-- * Verify the Accept is by the Invite target +-- * Verify the Collab isn't enabled yet +-- * Insert the Accept to my inbox +-- * Record the Accept and enable the Collab in DB +-- * Forward the Accept to my followers +-- * Send a regular collaborator-Grant +-- * To: Accepter (i.e. Invite target) +-- * CC: Invite sender, Accepter's followers, my followers -- --- * Give me a new child active SourceOriginUs --- * Verify we haven't yet seen child's Accept --- * Give me a new child passive SourceOriginThem --- * Option 1: We haven't seen child's Accept yet --- * Verify sender is the child --- * Option 2: We saw it, but not my collaborator's Accept --- * Verify the Accept is authorized --- * Otherwise respond with error, no Accept is needed --- * Give me a new parent active DestOriginUs --- * Respond with error, we aren't supposed to get any Accept --- * Give me a new parent passive DestOriginThem --- * Option 1: I haven't yet seen parent's Accept --- * Verify sender is the parent --- * Option 2: I saw it, but not my collaborator's Accept --- * Verify the accept is authorized --- * Otherwise respond with error, no Accept is needed +-- * Is it a Join to be a collaborator in me? +-- * Verify the Accept is authorized +-- * Verify the Collab isn't enabled yet +-- * Insert the Accept to my inbox +-- * Record the Accept and enable the Collab in DB +-- * Forward the Accept to my followers +-- * Send a regular collaborator-Grant +-- * To: Join sender +-- * CC: Accept sender, Join sender's followers, my followers -- --- * If it's none of these, respond with error --- --- * In collab mode, verify the Collab isn't enabled yet --- --- * Insert the Accept to my inbox --- --- * In collab mode, record the Accept and enable the Collab in DB --- --- * In child-active mode, --- * If sender is the child, record the Accept into the Source record --- * Prepare to send degelator-Grant +-- * Give me a new child active SourceOriginUs +-- * Verify we haven't yet seen child's Accept +-- * Insert the Accept to my inbox +-- * If sender is the child, record the Accept into the Source record +-- * Prepare to send degelator-Grant -- * Otherwise nothing to do --- * In child-passive mode, --- * Option 1: Record child's Accept in Source record --- * Option 2: Record my collaborator's Accept --- * Prepare to send delegator-Grant --- * In parent-passive mode, --- * Option 1: Record parent's Accept in the Dest record --- * Option 2: Record my collaborator's Accept in the Dest record --- * Prepare to send my own Accept --- --- * Forward the Accept to my followers --- --- * Possibly send a Grant/Accept: --- * For Invite-collab mode: --- * Regular collaborator-Grant --- * To: Accepter (i.e. Invite target) --- * CC: Invite sender, Accepter's followers, my followers --- * For Join-as-collab mode: --- * Regular collaborator-Grant --- * To: Join sender --- * CC: Accept sender, Join sender's followers, my followers --- --- * Child-active +-- * Forward the Accept to my followers +-- * Possibly send a Grant: +-- * Child-active -- * If sender is the child -- * delegator-Grant -- * To: Child -- * CC: -- - Child's followers -- - My followers --- * Child-passive --- * In option 2 --- * delegator-Grant --- * To: Child --- * CC: --- - Child's followers --- - My followers --- - The Accept sender (my collaborator) --- * Parent-passive --- * In option 2 --- * Accept --- * Object: The Add --- * Fulfills: My collaborator's Accept --- * To: Parent --- * CC: --- - Parent's followers --- - My followers --- - The Accept sender (my collaborator) +-- +-- * Give me a new child passive SourceOriginThem +-- * Option 1: We haven't seen child's Accept yet +-- * Verify sender is the child +-- * Option 2: We saw it, but not my collaborator's Accept +-- * Verify the Accept is authorized +-- * Otherwise respond with error, no Accept is needed +-- * Insert the Accept to my inbox +-- * Option 1: Record child's Accept in Source record +-- * Option 2: Record my collaborator's Accept +-- * Prepare to send delegator-Grant +-- * Forward the Accept to my followers +-- * Possibly send a Grant: +-- * In option 2 +-- * delegator-Grant +-- * To: Child +-- * CC: +-- - Child's followers +-- - My followers +-- - The Accept sender (my collaborator) +-- +-- * Give me a new parent active DestOriginUs +-- * Respond with error, we aren't supposed to get any Accept +-- +-- * Give me a new parent passive DestOriginThem +-- * Option 1: I haven't yet seen parent's Accept +-- * Verify sender is the parent +-- * Option 2: I saw it, but not my collaborator's Accept +-- * Verify the accept is authorized +-- * Otherwise respond with error, no Accept is needed +-- * Insert the Accept to my inbox +-- * Option 1: Record parent's Accept in the Dest record +-- * Option 2: Record my collaborator's Accept in the Dest record +-- * Prepare to send my own Accept +-- * Forward the Accept to my followers +-- * Possibly send an Accept: +-- * In option 2 +-- * Object: The Add +-- * Fulfills: My collaborator's Accept +-- * To: Parent +-- * CC: +-- - Parent's followers +-- - My followers +-- - The Accept sender (my collaborator) -- -- * Remove-Parent-Passive mode: -- * Verify the Source is enabled