Add "Password protected by Talk" option to shares

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2020-01-13 12:14:25 +01:00
parent 092a1fb90f
commit 897111404a
4 changed files with 69 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -195,6 +195,15 @@
{{ t('files_sharing', 'Enter a password') }} {{ t('files_sharing', 'Enter a password') }}
</ActionInput> </ActionInput>
<!-- password protected by Talk -->
<ActionCheckbox v-if="isPasswordProtectedByTalkAvailable"
:checked.sync="isPasswordProtectedByTalk"
:disabled="saving"
class="share-link-password-talk-checkbox"
@change="queueUpdate('sendPasswordByTalk')">
{{ t('files_sharing', 'Video verification') }}
</ActionCheckbox>
<!-- expiration date --> <!-- expiration date -->
<ActionCheckbox :checked.sync="hasExpirationDate" <ActionCheckbox :checked.sync="hasExpirationDate"
:disabled="config.isDefaultExpireDateEnforced || saving" :disabled="config.isDefaultExpireDateEnforced || saving"
@ -418,6 +427,35 @@ export default {
}, },
}, },
/**
* Is Talk enabled?
* @returns {boolean}
*/
isTalkEnabled() {
return OC.appswebroots['spreed'] !== undefined
},
/**
* Is it possible to protect the password by Talk?
* @returns {boolean}
*/
isPasswordProtectedByTalkAvailable() {
return this.isPasswordProtected && this.isTalkEnabled
},
/**
* Is the current share password protected by Talk?
* @returns {boolean}
*/
isPasswordProtectedByTalk: {
get: function() {
return this.share.sendPasswordByTalk
},
set: async function(enabled) {
this.share.sendPasswordByTalk = enabled
},
},
/** /**
* Is the current share an email share ? * Is the current share an email share ?
* @returns {boolean} * @returns {boolean}

View File

@ -306,6 +306,28 @@ export default class Share {
this.#share.password = password this.#share.password = password
} }
/**
* Password protection by Talk of the share
*
* @returns {Boolean}
* @readonly
* @memberof Share
*/
get sendPasswordByTalk() {
return this.#share.send_password_by_talk
}
/**
* Password protection by Talk of the share
*
* @param {Boolean} sendPasswordByTalk whether to send the password by Talk
* or not
* @memberof Share
*/
set sendPasswordByTalk(sendPasswordByTalk) {
this.#share.send_password_by_talk = sendPasswordByTalk
}
// SHARED ITEM DATA --------------------------------------------- // SHARED ITEM DATA ---------------------------------------------
/** /**
* Get the shared item absolute full path * Get the shared item absolute full path