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

Commit 348e4ab

Browse files
committed
Fix some notifications issues with shared users.
1 parent 0d5b97b commit 348e4ab

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,16 +1996,16 @@ public function createSharedRepository($httpVars, $repository, $accessDriver, $u
19961996
$userObject->save("superuser");
19971997
if ($this->watcher !== false) {
19981998
// Register a watch on the current folder for shared user
1999-
if ($uWatches[$userName] == "true") {
1999+
if ($uWatches[$userName]) {
20002000
$this->watcher->setWatchOnFolder(
2001-
new AJXP_Node($this->urlBase.$file),
2001+
new AJXP_Node("pydio://".$newRepoUniqueId."/"),
20022002
$userName,
20032003
MetaWatchRegister::$META_WATCH_USERS_CHANGE,
20042004
array(AuthService::getLoggedUser()->getId())
20052005
);
20062006
} else {
20072007
$this->watcher->removeWatchFromFolder(
2008-
new AJXP_Node($this->urlBase.$file),
2008+
new AJXP_Node("pydio://".$newRepoUniqueId."/"),
20092009
$userName,
20102010
true
20112011
);

core/src/plugins/core.mailer/class.AjxpMailer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function sendMail($recipients, $subject, $body, $from = null, $imageLink
7474
$coreFromName = ConfService::getCoreConf("FROM_NAME", "mailer");
7575
$from = array("adress" => $coreFrom, "name" => $coreFromName);
7676
}
77+
$rowBody = $body;
7778
$images = array();
7879
if(!empty($prepend)) $subject = $prepend ." ". $subject;
7980
if(!empty($append)) $subject .= " ".$append;
@@ -99,7 +100,7 @@ public function sendMail($recipients, $subject, $body, $from = null, $imageLink
99100
$this->sendMailImpl($recipients, $subject, $body, $from, $images);
100101
if (AJXP_SERVER_DEBUG) {
101102
$line = "------------------------------------------------------------------------\n";
102-
file_put_contents($this->mailCache, "Sending mail from ".print_r($from, true)." to ".print_r($recipients, true)."\n\n$subject\n\n$body\n".$line, FILE_APPEND);
103+
file_put_contents($this->mailCache, $line."Sending mail from ".print_r($from, true)." to ".print_r($recipients, true)."\nSubject: $subject\nBody:\n$rowBody\n", FILE_APPEND);
103104
}
104105
}
105106

core/src/plugins/meta.watch/class.MetaWatchRegister.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ public function collectWatches($node, $watchType)
241241
$usersMeta = isSet($nodeMeta[self::$META_WATCH_USERS_NAMESPACE]) ? $nodeMeta[self::$META_WATCH_USERS_NAMESPACE] : false;
242242
$ids = $this->loadWatchesFromMeta($watchType, $currentUserId, $source, $watchMeta, $usersMeta);
243243
foreach($ids as $id){
244-
$result["ancestors"][] = array("node" => $source, "id" => $id);
244+
// Do not send notification to myself!
245+
if($id !== $currentUserId){
246+
$result["ancestors"][] = array("node" => $source, "id" => $id);
247+
}
245248
}
246249
}
247250

0 commit comments

Comments
 (0)