Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15284842
D18600.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D18600.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -10,7 +10,7 @@
'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => 'e9473020',
- 'core.pkg.js' => '6c085267',
+ 'core.pkg.js' => '28552e58',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
'differential.pkg.js' => 'b71b8c5d',
@@ -374,7 +374,7 @@
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => 'e1d4b11a',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2',
- 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'a14cbdfc',
+ 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '4cc4f460',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9',
'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => '27ca6289',
'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443',
@@ -467,7 +467,7 @@
'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2',
'rsrc/js/core/KeyboardShortcutManager.js' => 'c19dd9b9',
'rsrc/js/core/MultirowRowManager.js' => 'b5d57730',
- 'rsrc/js/core/Notification.js' => '5c3349b2',
+ 'rsrc/js/core/Notification.js' => '008faf9c',
'rsrc/js/core/Prefab.js' => 'c5af80a2',
'rsrc/js/core/ShapedRequest.js' => '7cbe244b',
'rsrc/js/core/TextAreaUtils.js' => '320810c8',
@@ -585,7 +585,7 @@
'javelin-aphlict' => 'e1d4b11a',
'javelin-behavior' => '61cbc29a',
'javelin-behavior-aphlict-dropdown' => 'caade6f2',
- 'javelin-behavior-aphlict-listen' => 'a14cbdfc',
+ 'javelin-behavior-aphlict-listen' => '4cc4f460',
'javelin-behavior-aphlict-status' => '5e2634b9',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
'javelin-behavior-aphront-drag-and-drop-textarea' => '484a6e22',
@@ -789,7 +789,7 @@
'phabricator-keyboard-shortcut-manager' => 'c19dd9b9',
'phabricator-main-menu-view' => '1802a242',
'phabricator-nav-view-css' => 'faf6a6fc',
- 'phabricator-notification' => '5c3349b2',
+ 'phabricator-notification' => '008faf9c',
'phabricator-notification-css' => '457861ec',
'phabricator-notification-menu-css' => '10685bd4',
'phabricator-object-selector-css' => '85ee8ce6',
@@ -904,6 +904,13 @@
'unhandled-exception-css' => '4c96257a',
),
'requires' => array(
+ '008faf9c' => array(
+ 'javelin-install',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-util',
+ 'phabricator-notification-css',
+ ),
'013ffff9' => array(
'javelin-install',
'javelin-util',
@@ -1236,6 +1243,20 @@
'javelin-uri',
'phabricator-notification',
),
+ '4cc4f460' => array(
+ 'javelin-behavior',
+ 'javelin-aphlict',
+ 'javelin-stratcom',
+ 'javelin-request',
+ 'javelin-uri',
+ 'javelin-dom',
+ 'javelin-json',
+ 'javelin-router',
+ 'javelin-util',
+ 'javelin-leader',
+ 'javelin-sound',
+ 'phabricator-notification',
+ ),
'4d863052' => array(
'javelin-dom',
'javelin-util',
@@ -1326,13 +1347,6 @@
'javelin-vector',
'javelin-dom',
),
- '5c3349b2' => array(
- 'javelin-install',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-util',
- 'phabricator-notification-css',
- ),
'5c54cbf3' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1684,20 +1698,6 @@
'javelin-util',
'phabricator-keyboard-shortcut',
),
- 'a14cbdfc' => array(
- 'javelin-behavior',
- 'javelin-aphlict',
- 'javelin-stratcom',
- 'javelin-request',
- 'javelin-uri',
- 'javelin-dom',
- 'javelin-json',
- 'javelin-router',
- 'javelin-util',
- 'javelin-leader',
- 'javelin-sound',
- 'phabricator-notification',
- ),
'a3a63478' => array(
'phui-workcard-view-css',
),
diff --git a/src/applications/notification/builder/PhabricatorNotificationBuilder.php b/src/applications/notification/builder/PhabricatorNotificationBuilder.php
--- a/src/applications/notification/builder/PhabricatorNotificationBuilder.php
+++ b/src/applications/notification/builder/PhabricatorNotificationBuilder.php
@@ -153,8 +153,8 @@
foreach ($stories as $story) {
if ($story instanceof PhabricatorApplicationTransactionFeedStory) {
$dict[] = array(
- 'desktopReady' => $desktop_ready,
- 'webReady' => $web_ready,
+ 'showAnyNotification' => $web_ready,
+ 'showDesktopNotification' => $desktop_ready,
'title' => $story->renderText(),
'body' => $story->renderTextBody(),
'href' => $story->getURI(),
@@ -162,8 +162,8 @@
);
} else if ($story instanceof PhabricatorNotificationTestFeedStory) {
$dict[] = array(
- 'desktopReady' => $desktop_ready,
- 'webReady' => $web_ready,
+ 'showAnyNotification' => $web_ready,
+ 'showDesktopNotification' => $desktop_ready,
'title' => pht('Test Notification'),
'body' => $story->renderText(),
'href' => null,
@@ -171,8 +171,8 @@
);
} else {
$dict[] = array(
- 'desktopReady' => false,
- 'webReady' => false,
+ 'showWebNotification' => false,
+ 'showDesktopNotification' => false,
'title' => null,
'body' => null,
'href' => null,
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
@@ -38,15 +38,9 @@
$dict = $builder->buildDict();
$data = $dict[0];
- $response = array(
+ $response = $data + array(
'pertinent' => true,
'primaryObjectPHID' => $story->getPrimaryObjectPHID(),
- 'desktopReady' => $data['desktopReady'],
- 'webReady' => $data['webReady'],
- 'href' => $data['href'],
- 'icon' => $data['icon'],
- 'title' => $data['title'],
- 'body' => $data['body'],
'content' => hsprintf('%s', $content),
'uniqueID' => 'story/'.$story->getChronologicalKey(),
);
diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
--- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
+++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
@@ -78,12 +78,15 @@
JX.Stratcom.invoke('notification-panel-update', null, {});
var response = e.getData();
+ if (!response.showAnyNotification) {
+ return;
+ }
+
// Show the notification itself.
new JX.Notification()
.setContent(JX.$H(response.content))
- .setDesktopReady(response.desktopReady)
- .setWebReady(response.webReady)
.setKey(response.primaryObjectPHID)
+ .setShowAsDesktopNotification(response.showDesktopNotification)
.setTitle(response.title)
.setBody(response.body)
.setHref(response.href)
diff --git a/webroot/rsrc/js/core/Notification.js b/webroot/rsrc/js/core/Notification.js
--- a/webroot/rsrc/js/core/Notification.js
+++ b/webroot/rsrc/js/core/Notification.js
@@ -26,8 +26,7 @@
_visible : false,
_hideTimer : null,
_duration : 12000,
- _desktopReady : false,
- _webReady : false,
+ _asDesktop : false,
_key : null,
_title : null,
_body : null,
@@ -37,11 +36,6 @@
show : function() {
var self = JX.Notification;
- // This person doesn't like any real-time notification
- if (!this._desktopReady && !this._webReady) {
- return;
- }
-
if (!this._visible) {
this._visible = true;
@@ -51,7 +45,7 @@
if (self.supportsDesktopNotifications() &&
self.desktopNotificationsEnabled() &&
- this._desktopReady) {
+ this._asDesktop) {
// Note: specifying "tag" means that notifications with matching
// keys will aggregate.
var n = new window.Notification(this._title, {
@@ -94,13 +88,8 @@
return this;
},
- setDesktopReady : function(ready) {
- this._desktopReady = ready;
- return this;
- },
-
- setWebReady : function(ready) {
- this._webReady = ready;
+ setShowAsDesktopNotification : function(mode) {
+ this._asDesktop = mode;
return this;
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 5, 10:40 AM (22 h, 31 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225161
Default Alt Text
D18600.diff (8 KB)
Attached To
Mode
D18600: Make "No Notifications" setting less broad, and fix a bug with default display behavior
Attached
Detach File
Event Timeline
Log In to Comment