From aeef10eb47a9b72ada5b8fde7d0667bff069de92 Mon Sep 17 00:00:00 2001
From: Tom Needham <tom@owncloud.com>
Date: Sat, 9 Aug 2014 00:21:29 +0100
Subject: [PATCH] Add scrollto to the url if sharing a file for long file lists

---
 lib/private/share/mailnotifications.php | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php
index 62ab210b99..1f4645eed9 100644
--- a/lib/private/share/mailnotifications.php
+++ b/lib/private/share/mailnotifications.php
@@ -100,13 +100,19 @@ class MailNotifications {
 			}
 
 			// Link to folder, or root folder if a file
+
 			if ($itemType === 'folder') {
-				$foldername =  $filename;
+				$args = array(
+					'dir' => $filename,
+				);
 			} else {
-				$foldername = "/";
+				$args = array(
+					'dir' => '/',
+					'scrollto' => $filename,
+				);
 			}
 
-			$link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername));
+			$link = \OCP\Util::linkToAbsolute('files', 'index.php', $args);
 
 			list($htmlMail, $alttextMail) = $this->createMailBody($filename, $link, $expiration);
 
-- 
GitLab