Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 3ad15f5

Browse files
committed
Do not post "change" notifications or alerts when just copying a file to another workspace. Fix #1274
1 parent 31ac233 commit 3ad15f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/plugins/core.notifications/NotificationCenter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function persistChangeHookToFeed(AJXP_Node $oldNode = null, AJXP_Node $ne
146146

147147
$nodes = [];
148148
if($oldNode !== null && $newNode !== null && $oldNode->getRepositoryId() !== $newNode->getRepositoryId()){
149-
$nodes[] = $oldNode;
149+
if(!$copy) $nodes[] = $oldNode;
150150
$nodes[] = $newNode;
151151
}else{
152152
$nodes[] = ($oldNode === null ? $newNode : $oldNode);
@@ -559,6 +559,9 @@ public function generateNotificationFromChangeHook(AJXP_Node $oldNode = null, AJ
559559
$primaryNode = $newNode;
560560
$secondNode = $oldNode;
561561
} else if ($targetNotif == "old") {
562+
if($oldNode->getRepositoryId() !== $newNode->getRepositoryId() && $copy){
563+
return false;
564+
}
562565
$type = $copy ? AJXP_NOTIF_NODE_COPY_TO : AJXP_NOTIF_NODE_MOVE_TO;
563566
$primaryNode = $oldNode;
564567
$secondNode = $newNode;

0 commit comments

Comments
 (0)