Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15463905
D9415.id22467.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9415.id22467.diff
View Options
diff --git a/src/applications/notification/client/PhabricatorNotificationClient.php b/src/applications/notification/client/PhabricatorNotificationClient.php
--- a/src/applications/notification/client/PhabricatorNotificationClient.php
+++ b/src/applications/notification/client/PhabricatorNotificationClient.php
@@ -2,7 +2,7 @@
final class PhabricatorNotificationClient {
- const EXPECT_VERSION = 6;
+ const EXPECT_VERSION = 7;
public static function getServerStatus() {
$uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js
--- a/support/aphlict/server/aphlict_server.js
+++ b/support/aphlict/server/aphlict_server.js
@@ -142,7 +142,7 @@
var msg = JSON.parse(body);
debug.log('notification: ' + JSON.stringify(msg));
- broadcast(msg.data);
+ broadcast(msg.data, msg.subscribers);
response.end();
});
} else if (request.url == '/status/') {
@@ -159,7 +159,7 @@
'messages.in': messages_in,
'messages.out': messages_out,
'log': config.log,
- 'version': 6
+ 'version': 7
};
response.write(JSON.stringify(status));
@@ -173,10 +173,16 @@
}).listen(config.admin, config.host);
-function broadcast(data) {
+function broadcast(data, subscribers) {
var listeners = clients.getListeners();
for (var id in listeners) {
var listener = listeners[id];
+
+ if (!subscribed(listener, subscribers)) {
+ debug.log('Not sending to %s', listener.getUser());
+ continue;
+ }
+
try {
listener.writeMessage(data);
@@ -189,6 +195,16 @@
}
}
+function subscribed(listener, subscribers) {
+ for (var i in subscribers) {
+ if (listener.getUser() == subscribers[i]) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
// If we're configured to drop permissions, get rid of them now that we've
// bound to the ports we need and opened logfiles.
if (config.user) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 3, 4:23 AM (2 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7729938
Default Alt Text
D9415.id22467.diff (1 KB)
Attached To
Mode
D9415: Only send Aphlict notifications to subscribed users.
Attached
Detach File
Event Timeline
Log In to Comment