aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-16 03:51:45 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-08-24 18:06:48 +0200
commit7ce520e83e432fcff3909670158d9a3df1069527 (patch)
treee7e4073998b53fcbe616caba8d09088ceb5062d0
parent5c07f9c2ec41c41a526ab34d4316b6826c1e0cc6 (diff)
downloadnextcloud-server-7ce520e83e432fcff3909670158d9a3df1069527.tar.gz
nextcloud-server-7ce520e83e432fcff3909670158d9a3df1069527.zip
Add support for rooms in the list of candidates to share with UI
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--core/js/sharedialogview.js34
1 files changed, 29 insertions, 5 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 9fa1847d3d5..90da279bdb9 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -159,13 +159,16 @@
},
function (result) {
if (result.ocs.meta.statuscode === 100) {
- var filter = function(users, groups, remotes, remote_groups, emails, circles) {
+ var filter = function(users, groups, remotes, remote_groups, emails, circles, rooms) {
if (typeof(emails) === 'undefined') {
emails = [];
}
if (typeof(circles) === 'undefined') {
circles = [];
}
+ if (typeof(rooms) === 'undefined') {
+ rooms = [];
+ }
var usersLength;
var groupsLength;
@@ -173,6 +176,7 @@
var remoteGroupsLength;
var emailsLength;
var circlesLength;
+ var roomsLength;
var i, j;
@@ -251,6 +255,14 @@
break;
}
}
+ } else if (share.share_type === OC.Share.SHARE_TYPE_ROOM) {
+ roomsLength = rooms.length;
+ for (j = 0; j < roomsLength; j++) {
+ if (rooms[j].value.shareWith === share.share_with) {
+ rooms.splice(j, 1);
+ break;
+ }
+ }
}
}
};
@@ -261,7 +273,8 @@
result.ocs.data.exact.remotes,
result.ocs.data.exact.remote_groups,
result.ocs.data.exact.emails,
- result.ocs.data.exact.circles
+ result.ocs.data.exact.circles,
+ result.ocs.data.exact.rooms
);
var exactUsers = result.ocs.data.exact.users;
@@ -276,8 +289,12 @@
if (typeof(result.ocs.data.circles) !== 'undefined') {
exactCircles = result.ocs.data.exact.circles;
}
+ var exactRooms = [];
+ if (typeof(result.ocs.data.rooms) !== 'undefined') {
+ exactRooms = result.ocs.data.exact.rooms;
+ }
- var exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactRemoteGroups).concat(exactEmails).concat(exactCircles);
+ var exactMatches = exactUsers.concat(exactGroups).concat(exactRemotes).concat(exactRemoteGroups).concat(exactEmails).concat(exactCircles).concat(exactRooms);
filter(
result.ocs.data.users,
@@ -285,7 +302,8 @@
result.ocs.data.remotes,
result.ocs.data.remote_groups,
result.ocs.data.emails,
- result.ocs.data.circles
+ result.ocs.data.circles,
+ result.ocs.data.rooms
);
var users = result.ocs.data.users;
@@ -301,8 +319,12 @@
if (typeof(result.ocs.data.circles) !== 'undefined') {
circles = result.ocs.data.circles;
}
+ var rooms = [];
+ if (typeof(result.ocs.data.rooms) !== 'undefined') {
+ rooms = result.ocs.data.rooms;
+ }
- var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(lookup);
+ var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);
deferred.resolve(suggestions, exactMatches);
} else {
@@ -432,6 +454,8 @@
text = t('core', '{sharee} (email)', { sharee: text }, undefined, { escape: false });
} else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) {
text = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false});
+ } else if (item.value.shareType === OC.Share.SHARE_TYPE_ROOM) {
+ text = t('core', '{sharee} (conversation)', { sharee: text }, undefined, { escape: false });
}
var insert = $("<div class='share-autocomplete-item'/>");
var avatar = $("<div class='avatardiv'></div>").appendTo(insert);