[Pkg-owncloud-commits] [owncloud] 74/121: we need the recipient as a additional parameter to know for which share the notification was send

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 4c6c22c4e3c5dd6dbb524548ce8b1e97fc7bcc7f
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Wed Aug 13 17:02:51 2014 +0200

    we need the recipient as a additional parameter to know for which share the notification was send
---
 core/ajax/share.php         | 4 ++--
 lib/private/share/share.php | 7 ++++---
 lib/public/share.php        | 5 +++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/core/ajax/share.php b/core/ajax/share.php
index 37f374c..451c761 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -107,7 +107,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 			$mailNotification = new OC\Share\MailNotifications();
 			$result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType);
 
-			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, true);
+			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, true);
 
 			if (empty($result)) {
 				OCP\JSON::success();
@@ -126,7 +126,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 			$shareType = $_POST['shareType'];
 			$itemType = $_POST['itemType'];
 			$recipient = $_POST['recipient'];
-			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, false);
+			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, false);
 			OCP\JSON::success();
 			break;
 
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index daed424..22e354e 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -820,17 +820,18 @@ class Share extends \OC\Share\Constants {
 	 * @param string $itemType
 	 * @param string $itemSource
 	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
+	 * @param string $recipient with whom was the file shared
 	 * @param boolean $status
 	 */
-	public static function setSendMailStatus($itemType, $itemSource, $shareType, $status) {
+	public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
 		$status = $status ? 1 : 0;
 
 		$query = \OC_DB::prepare(
 				'UPDATE `*PREFIX*share`
 					SET `mail_send` = ?
-					WHERE `item_type` = ? AND `item_source` = ? AND `share_type` = ?');
+					WHERE `item_type` = ? AND `item_source` = ? AND `share_type` = ? AND `share_with` = ?');
 
-		$result = $query->execute(array($status, $itemType, $itemSource, $shareType));
+		$result = $query->execute(array($status, $itemType, $itemSource, $shareType, $recipient));
 
 		if($result === false) {
 			\OC_Log::write('OCP\Share', 'Couldn\'t set send mail status', \OC_Log::ERROR);
diff --git a/lib/public/share.php b/lib/public/share.php
index e6519dd..bb9c6ec 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -274,10 +274,11 @@ class Share extends \OC\Share\Constants {
 	 * @param string $itemType
 	 * @param string $itemSource
 	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
+	 * @param string $recipient with whom was the item shared
 	 * @param bool $status
 	 */
-	public static function setSendMailStatus($itemType, $itemSource, $shareType, $status) {
-		return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $status);
+	public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
+		return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
 	}
 
 	/**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list