Merge pull request #2371 from nextcloud/issue-2369-add-share-indicator-for-mail-shares

Add share indicator for mail shares
This commit is contained in:
Lukas Reschke 2016-12-01 12:17:56 +01:00 committed by GitHub
commit a87638c6ab
4 changed files with 23 additions and 3 deletions

View file

@ -120,7 +120,8 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
\OCP\Share::SHARE_TYPE_USER,
\OCP\Share::SHARE_TYPE_GROUP,
\OCP\Share::SHARE_TYPE_LINK,
\OCP\Share::SHARE_TYPE_REMOTE
\OCP\Share::SHARE_TYPE_REMOTE,
\OCP\Share::SHARE_TYPE_EMAIL,
];
foreach ($requestedShareTypes as $requestedShareType) {
// one of each type is enough to find out about the types

View file

@ -114,6 +114,8 @@
shareType = parseInt(shareType, 10);
if (shareType === OC.Share.SHARE_TYPE_LINK) {
hasLink = true;
} else if (shareType === OC.Share.SHARE_TYPE_EMAIL) {
hasLink = true;
} else if (shareType === OC.Share.SHARE_TYPE_USER) {
hasShares = true;
} else if (shareType === OC.Share.SHARE_TYPE_GROUP) {
@ -159,8 +161,17 @@
shareTab.on('sharesChanged', function(shareModel) {
var fileInfoModel = shareModel.fileInfoModel;
var $tr = fileList.findFileEl(fileInfoModel.get('name'));
// We count email shares as link share
var hasLinkShare = shareModel.hasLinkShare();
shareModel.get('shares').forEach(function (share) {
if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) {
hasLinkShare = true;
}
});
OCA.Sharing.Util._updateFileListDataAttributes(fileList, $tr, shareModel);
if (!OCA.Sharing.Util._updateFileActionIcon($tr, shareModel.hasUserShares(), shareModel.hasLinkShare())) {
if (!OCA.Sharing.Util._updateFileActionIcon($tr, shareModel.hasUserShares(), hasLinkShare)) {
// remove icon, if applicable
OC.Share.markFileAsShared($tr, false, false);
}

View file

@ -5,7 +5,7 @@
<description>Share provider which allows you to share files by mail</description>
<licence>AGPL</licence>
<author>Bjoern Schiessle</author>
<version>1.0.0</version>
<version>1.0.1</version>
<namespace>ShareByMail</namespace>
<category>other</category>
<dependencies>
@ -13,6 +13,10 @@
</dependencies>
<default_enable/>
<types>
<filesystem/>
</types>
<activity>
<providers>
<provider>OCA\ShareByMail\Activity</provider>

View file

@ -206,6 +206,10 @@ class ProviderFactory implements IProviderFactory {
}
public function getAllProviders() {
$shareByMail = $this->getShareByMailProvider();
if ($shareByMail !== null) {
return [$this->defaultShareProvider(), $this->federatedShareProvider(), $shareByMail];
}
return [$this->defaultShareProvider(), $this->federatedShareProvider()];
}
}