From 100d5d9a4707dd7f5f6572d69dd55cb3d62b955f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 20 Oct 2020 13:58:01 +0200 Subject: Add labels to mail shares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the email is shown on a second line if a label is set. Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files_sharing/lib/Controller/ShareAPIController.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'apps/files_sharing/lib/Controller') diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index a051f9141ff..044a2f51c19 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -558,11 +558,11 @@ class ShareAPIController extends OCSController { // Only share by mail have a recipient if ($shareType === IShare::TYPE_EMAIL) { $share->setSharedWith($shareWith); - } else { - // Only link share have a label - if (!empty($label)) { - $share->setLabel($label); - } + } + + // If we have a label, use it + if (!empty($label)) { + $share->setLabel($label); } if ($sendPasswordByTalk === 'true') { @@ -1127,8 +1127,7 @@ class ShareAPIController extends OCSController { $share->setPassword($password); } - // only link shares have labels - if ($share->getShareType() === IShare::TYPE_LINK && $label !== null) { + if ($label !== null) { if (strlen($label) > 255) { throw new OCSBadRequestException("Maxmimum label length is 255"); } -- cgit v1.2.3