summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-16 04:28:54 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-20 19:42:27 +0100
commit3bd92edd9cff16f4304e526d57fa71f6ecfb3ca0 (patch)
tree2b72bda091c8b89dec1d226691c02d3b10083ecb
parentdf5cd18394dea317b51432f7a214d4f88f5ba2e4 (diff)
downloadnextcloud-server-3bd92edd9cff16f4304e526d57fa71f6ecfb3ca0.tar.gz
nextcloud-server-3bd92edd9cff16f4304e526d57fa71f6ecfb3ca0.zip
Use the display name in the avatar for a circle share
Before, the avatar for a circle share was generated using the "share_with" field as the seed for "imageplaceholder". Due to this, when the "share_with" field is set to the circle ID the character shown in the avatar was just a random character instead of the first character of the display name. Now the "share_with" is still used as the seed for the colour, but the display name is used as the text of the avatar. This adds support for "share_with" fields set to the circle ID while being backwards compatible with "share_with" fields set to the circle name. Note that when "share_with" fields is set to the circle name the colour of the avatar is different in the list of suggested sharees and in the list of current sharees, but that also happened before these changes (due to a different seed being used in each place). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--core/js/sharedialogshareelistview.js2
-rw-r--r--core/js/sharedialogview.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index 6c256d3de37..8ec53810b51 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -241,7 +241,7 @@
shareWithTitle: shareWithTitle,
shareType: shareType,
shareId: this.model.get('shares')[shareIndex].id,
- modSeed: shareType !== OC.Share.SHARE_TYPE_USER,
+ modSeed: shareType !== OC.Share.SHARE_TYPE_USER && shareType !== OC.Share.SHARE_TYPE_CIRCLE,
isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE,
isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL,
isCircleShare: shareType === OC.Share.SHARE_TYPE_CIRCLE,
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 6b65e46b254..d2c63490141 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -338,7 +338,7 @@
}
var insert = $("<div class='share-autocomplete-item'/>");
var avatar = $("<div class='avatardiv'></div>").appendTo(insert);
- if (item.value.shareType === OC.Share.SHARE_TYPE_USER) {
+ if (item.value.shareType === OC.Share.SHARE_TYPE_USER || item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) {
avatar.avatar(item.value.shareWith, 32, undefined, undefined, undefined, item.label);
} else {
avatar.imageplaceholder(text, undefined, 32);