Link Search Menu Expand Document

5.7 User.AcceptInvitation


AcceptInvitation(senderUsername string, invitationPtr UUID, filename string) (err 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. 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:

  1. The caller already has a file with the given filename in their personal file namespace.
  2. The caller is unable to verify that the secure file share invitation pointed to by the given invitationPtr was created by senderUsername.
  3. The invitation is no longer valid due to revocation.
  4. 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

err (error)


Do not forget that your design must satisfy all requirements, including:
  • There must only be a single copy of the file.
  • Users can have multiple active user sessions at once.