Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14063518
D11275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11275.diff
View Options
diff --git a/src/applications/notification/controller/PhabricatorNotificationIndividualController.php b/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
--- a/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
@@ -5,30 +5,49 @@
public function processRequest() {
$request = $this->getRequest();
- $user = $request->getUser();
+ $viewer = $request->getUser();
$stories = id(new PhabricatorNotificationQuery())
- ->setViewer($user)
- ->withUserPHIDs(array($user->getPHID()))
+ ->setViewer($viewer)
+ ->withUserPHIDs(array($viewer->getPHID()))
->withKeys(array($request->getStr('key')))
->execute();
if (!$stories) {
- return id(new AphrontAjaxResponse())->setContent(
- array(
- 'pertinent' => false,
- ));
+ return $this->buildEmptyResponse();
}
- $builder = new PhabricatorNotificationBuilder($stories);
+ $story = head($stories);
+ if ($story->getAuthorPHID() === $viewer->getPHID()) {
+ // Don't show the user individual notifications about their own
+ // actions. Primarily, this stops pages from showing notifications
+ // immediately after you click "Submit" on a comment form if the
+ // notification server returns faster than the web server.
+
+ // TODO: It would be nice to retain the "page updated" bubble on copies
+ // of the page that are open in other tabs, but there isn't an obvious
+ // way to do this easily.
+
+ return $this->buildEmptyResponse();
+ }
+
+ $builder = new PhabricatorNotificationBuilder(array($story));
$content = $builder->buildView()->render();
$response = array(
'pertinent' => true,
- 'primaryObjectPHID' => head($stories)->getPrimaryObjectPHID(),
+ 'primaryObjectPHID' => $story->getPrimaryObjectPHID(),
'content' => hsprintf('%s', $content),
);
return id(new AphrontAjaxResponse())->setContent($response);
}
+
+ private function buildEmptyResponse() {
+ return id(new AphrontAjaxResponse())->setContent(
+ array(
+ 'pertinent' => false,
+ ));
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 6:51 PM (22 h, 51 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728684
Default Alt Text
D11275.diff (2 KB)
Attached To
Mode
D11275: Don't show notifications about your own actions
Attached
Detach File
Event Timeline
Log In to Comment