5.7. User.AcceptInvitation: Add a shared file to personal file namespace

AcceptInvitation(senderUsername string, invitationPtr UUID, filename string) error

Accepts the secure file share invitation created by senderUsername and located at invitationPtr in Datastore by giving the corresponding file a name of filename in the caller’s personal namespace.

After this function returns successfully, the caller should be able to take the actions detailed in Sharing and Revoking #1. Note that the first parameter to the StoreFile(), LoadFile(), and AppendToFile() functions in the client API is a filename in the caller’s personal namespace; accepting the invitation allows the caller to choose a name for the shared file in their personal namespace.

After this function returns successfully, the given invitation is considered accepted. Calling this function on an invitation that is already accepted is undefined behavior and will not be tested, which means your client can handle that scenario in any way that you feel makes sense.

Returns an error if:

  • the caller already has a file with the given filename in their personal file namespace; or

  • the caller is unable to verify that the secure file share invitation pointed to by the given invitationPtr was created by senderUsername; or

  • the invitation is no longer valid due to revocation; or

  • the caller is unable to verify the integrity of the secure file share invitation pointed to by the given invitationPtr.

Parameters
  • senderUsername (string) – The username of the sender.

  • invitationPtr (UUID) – The UUID storage key at which the sender’s secure file share invitation is stored in the Datastore.

  • filename (string) – The filename that the recipient would like to assign to the shared file in their personal file namespace.

Return type

error

Warning

Do not forget that your design must satisfy all requirements, including:

  1. There must only be a single copy of the file (see Sharing and Revoking).

  2. Users can have multiple active user sessions at once (see User Sessions).