mirror of
https://github.com/nextcloud/server.git
synced 2024-07-30 08:15:57 +02:00
we need the recipient as a additional parameter to know for which share the notification was send
This commit is contained in:
parent
f282a5cff0
commit
d9f35d8c15
@ -107,7 +107,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|
|||||||
$mailNotification = new OC\Share\MailNotifications();
|
$mailNotification = new OC\Share\MailNotifications();
|
||||||
$result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType);
|
$result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType);
|
||||||
|
|
||||||
\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, true);
|
\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, true);
|
||||||
|
|
||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
OCP\JSON::success();
|
OCP\JSON::success();
|
||||||
@ -126,7 +126,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|
|||||||
$shareType = $_POST['shareType'];
|
$shareType = $_POST['shareType'];
|
||||||
$itemType = $_POST['itemType'];
|
$itemType = $_POST['itemType'];
|
||||||
$recipient = $_POST['recipient'];
|
$recipient = $_POST['recipient'];
|
||||||
\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, false);
|
\OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, false);
|
||||||
OCP\JSON::success();
|
OCP\JSON::success();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -820,17 +820,18 @@ class Share extends \OC\Share\Constants {
|
|||||||
* @param string $itemType
|
* @param string $itemType
|
||||||
* @param string $itemSource
|
* @param string $itemSource
|
||||||
* @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
|
* @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
|
* @param boolean $status
|
||||||
*/
|
*/
|
||||||
public static function setSendMailStatus($itemType, $itemSource, $shareType, $status) {
|
public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
|
||||||
$status = $status ? 1 : 0;
|
$status = $status ? 1 : 0;
|
||||||
|
|
||||||
$query = \OC_DB::prepare(
|
$query = \OC_DB::prepare(
|
||||||
'UPDATE `*PREFIX*share`
|
'UPDATE `*PREFIX*share`
|
||||||
SET `mail_send` = ?
|
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) {
|
if($result === false) {
|
||||||
\OC_Log::write('OCP\Share', 'Couldn\'t set send mail status', \OC_Log::ERROR);
|
\OC_Log::write('OCP\Share', 'Couldn\'t set send mail status', \OC_Log::ERROR);
|
||||||
|
@ -274,10 +274,11 @@ class Share extends \OC\Share\Constants {
|
|||||||
* @param string $itemType
|
* @param string $itemType
|
||||||
* @param string $itemSource
|
* @param string $itemSource
|
||||||
* @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
|
* @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
|
* @param bool $status
|
||||||
*/
|
*/
|
||||||
public static function setSendMailStatus($itemType, $itemSource, $shareType, $status) {
|
public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
|
||||||
return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $status);
|
return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user