aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/shareitemmodel.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r--core/js/shareitemmodel.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index d4fbc3543a7..8afc4954902 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -350,6 +350,27 @@
});
},
+ legacyFillCurrentShares: function(shares) {
+ OC.Share.currentShares = {};
+ OC.Share.itemShares = [];
+ _.each(shares,
+ /**
+ * @param {OC.Share.Types.ShareInfo} share
+ */
+ function(share) {
+ if (!OC.Share.currentShares[share.share_type]) {
+ OC.Share.currentShares[share.share_type] = [];
+ }
+ OC.Share.currentShares[share.share_type].push(share);
+
+ if (!OC.Share.itemShares[share.share_type]) {
+ OC.Share.itemShares[share.share_type] = [];
+ }
+ OC.Share.itemShares[share.share_type].push(share.share_with);
+ }
+ );
+ },
+
parse: function(data) {
if(data === false) {
console.warn('no data was returned');
@@ -372,9 +393,12 @@
});
}
+ var shares = _.toArray(data.shares);
+ this.legacyFillCurrentShares(shares);
+
return {
reshare: data.reshare,
- shares: _.toArray(data.shares),
+ shares: shares,
permissions: permissions,
allowPublicUploadStatus: allowPublicUploadStatus
};