Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Manipulate share type
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed Apr 25, 2022
1 parent 93afcf5 commit fee5570
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Empty file.
19 changes: 19 additions & 0 deletions src/shareInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
* @classdesc ShareInfo class, stores information regarding a share
* @param {object} ShareInfo containing information like id, url etc. of the share
*/

const USER_TYPE_USER = 0
const USER_TYPE_GUEST = 1
const SHARE_TYPE_USER = 0;
const SHARE_TYPE_GROUP = 1;
const SHARE_TYPE_LINK = 3;
const SHARE_TYPE_GUEST = 4;

class ShareInfo {
constructor (shareInfo) {
this.shareInfo = {}
Expand All @@ -17,6 +25,17 @@ class ShareInfo {
this.shareInfo[key] = shareInfo[key]
}
}

/**
* Oc10 does not emit if a share receiver is a user or a guest,
* therefore we check if the property `share_with_user_type` is present and set to `USER_TYPE_GUEST`,
* if so we manipulate the `share_type` property and set it to `SHARE_TYPE_GUEST`
*/
if(this.shareInfo?.share_with_user_type === USER_TYPE_GUEST){
this.shareInfo.share_type = SHARE_TYPE_GUEST
}


}

/**
Expand Down

0 comments on commit fee5570

Please sign in to comment.