[Pkg-owncloud-commits] [owncloud] 63/70: 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 17:40:11 UTC 2014


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

taffit pushed a commit to annotated tag v6.0.5RC1
in repository owncloud.

commit ca33b2af720883f021cd36e134da0d6a78397111
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Thu Aug 14 17:51:16 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/public/share.php | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/core/ajax/share.php b/core/ajax/share.php
index 1ec4a4f..c60c82a 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -164,7 +164,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
 				}
 			}
 
-			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, true);
+			\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, true);
 
 			if (empty($noMail)) {
 				OCP\JSON::success();
@@ -183,7 +183,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/public/share.php b/lib/public/share.php
index 7dd0d09..dfa24cd 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -484,7 +484,7 @@ class Share {
 								throw new \Exception($message);
  			}
  		}
-		
+
 		// Verify share type and sharing conditions are met
 		if ($shareType === self::SHARE_TYPE_USER) {
 			if ($shareWith == $uidOwner) {
@@ -740,17 +740,18 @@ class Share {
 	 * @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 bool $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);

-- 
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