Add collaborators uuid to properly render the avatar and for later grouping

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-10-17 21:57:22 +02:00
parent e5cae301eb
commit a1c6e44700
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
3 changed files with 11 additions and 1 deletions

View file

@ -468,7 +468,10 @@
if (item.value.shareType === OC.Share.SHARE_TYPE_USER || item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { 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); avatar.avatar(item.value.shareWith, 32, undefined, undefined, undefined, item.label);
} else { } else {
avatar.imageplaceholder(text, undefined, 32); if (typeof item.uuid === 'undefined') {
item.uuid = text;
}
avatar.imageplaceholder(item.uuid, text, 32);
} }
$("<div class='autocomplete-item-text'></div>") $("<div class='autocomplete-item-text'></div>")

View file

@ -121,6 +121,7 @@ class MailPlugin implements ISearchPlugin {
if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) { if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$singleResult = [[ $singleResult = [[
'label' => $displayName, 'label' => $displayName,
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_USER, 'shareType' => Share::SHARE_TYPE_USER,
'shareWith' => $cloud->getUser(), 'shareWith' => $cloud->getUser(),
@ -142,6 +143,7 @@ class MailPlugin implements ISearchPlugin {
if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) { if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
$userResults['wide'][] = [ $userResults['wide'][] = [
'label' => $displayName, 'label' => $displayName,
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_USER, 'shareType' => Share::SHARE_TYPE_USER,
'shareWith' => $cloud->getUser(), 'shareWith' => $cloud->getUser(),
@ -160,6 +162,7 @@ class MailPlugin implements ISearchPlugin {
} }
$result['exact'][] = [ $result['exact'][] = [
'label' => $displayName, 'label' => $displayName,
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_EMAIL, 'shareType' => Share::SHARE_TYPE_EMAIL,
'shareWith' => $emailAddress, 'shareWith' => $emailAddress,
@ -168,6 +171,7 @@ class MailPlugin implements ISearchPlugin {
} else { } else {
$result['wide'][] = [ $result['wide'][] = [
'label' => $displayName, 'label' => $displayName,
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_EMAIL, 'shareType' => Share::SHARE_TYPE_EMAIL,
'shareWith' => $emailAddress, 'shareWith' => $emailAddress,
@ -194,6 +198,7 @@ class MailPlugin implements ISearchPlugin {
if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) { if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) {
$result['exact'][] = [ $result['exact'][] = [
'label' => $search, 'label' => $search,
'uuid' => $search,
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_EMAIL, 'shareType' => Share::SHARE_TYPE_EMAIL,
'shareWith' => $search, 'shareWith' => $search,

View file

@ -89,6 +89,7 @@ class RemotePlugin implements ISearchPlugin {
} }
$result['exact'][] = [ $result['exact'][] = [
'label' => $contact['FN'] . " ($cloudId)", 'label' => $contact['FN'] . " ($cloudId)",
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_REMOTE, 'shareType' => Share::SHARE_TYPE_REMOTE,
'shareWith' => $cloudId, 'shareWith' => $cloudId,
@ -98,6 +99,7 @@ class RemotePlugin implements ISearchPlugin {
} else { } else {
$result['wide'][] = [ $result['wide'][] = [
'label' => $contact['FN'] . " ($cloudId)", 'label' => $contact['FN'] . " ($cloudId)",
'uuid' => $contact['UID'],
'value' => [ 'value' => [
'shareType' => Share::SHARE_TYPE_REMOTE, 'shareType' => Share::SHARE_TYPE_REMOTE,
'shareWith' => $cloudId, 'shareWith' => $cloudId,