@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Enable notifications by default

Summary: I think we've sorted out enough of the problems with these to turn them on for everyone. The real-time component remains configuration-dependent.

Test Plan: Turned off "notification.enabled", still saw notifications.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4120

+37 -39
+4 -1
conf/default.conf.php
··· 191 191 192 192 // -- Notifications --------------------------------------------------------- // 193 193 194 - 'notification.enabled' => false, 194 + // Set this to true to enable real-time notifications. You must also run a 195 + // notification server for this to work. Consult the documentation in 196 + // "Notifications User Guide: Setup and Configuration" for instructions. 197 + 'notification.enabled' => false, 195 198 196 199 // Client port for the realtime server to listen on, and for realtime clients 197 200 // to connect to. Use "localhost" if you are running the notification server
+1 -1
src/applications/feed/PhabricatorFeedStoryPublisher.php
··· 99 99 implode(', ', $sql)); 100 100 } 101 101 102 + $this->insertNotifications($chrono_key); 102 103 if (PhabricatorEnv::getEnvConfig('notification.enabled')) { 103 - $this->insertNotifications($chrono_key); 104 104 $this->sendNotification($chrono_key); 105 105 } 106 106
+14 -16
src/applications/notification/storage/PhabricatorFeedStoryNotification.php
··· 18 18 PhabricatorUser $user, 19 19 $object_phid) { 20 20 21 - if (PhabricatorEnv::getEnvConfig('notification.enabled')) { 22 - $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 21 + $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 23 22 24 - $notification_table = new PhabricatorFeedStoryNotification(); 25 - $conn = $notification_table->establishConnection('w'); 23 + $notification_table = new PhabricatorFeedStoryNotification(); 24 + $conn = $notification_table->establishConnection('w'); 26 25 27 - queryfx( 28 - $conn, 29 - "UPDATE %T 30 - SET hasViewed = 1 31 - WHERE userPHID = %s 32 - AND primaryObjectPHID = %s 33 - AND hasViewed = 0", 34 - $notification_table->getTableName(), 35 - $user->getPHID(), 36 - $object_phid); 26 + queryfx( 27 + $conn, 28 + "UPDATE %T 29 + SET hasViewed = 1 30 + WHERE userPHID = %s 31 + AND primaryObjectPHID = %s 32 + AND hasViewed = 0", 33 + $notification_table->getTableName(), 34 + $user->getPHID(), 35 + $object_phid); 37 36 38 - unset($unguarded); 39 - } 37 + unset($unguarded); 40 38 } 41 39 42 40 public function countUnread(PhabricatorUser $user) {
+16 -17
src/docs/userguide/notifications.diviner
··· 5 5 6 6 = Overview = 7 7 8 - Phabricator can be configured to notify users when events happen in real time, 9 - so they'll get a message in their browser window if something has happened or 10 - the object they're looking at has been updated. 8 + By default, Phabricator delivers information about events (like users creating 9 + tasks or commenting on code reviews) through email and in-application 10 + notifications. 11 11 12 - NOTE: This feature is new and still needs some work. 12 + Phabricator can also be configured to deliver notifications in real time, by 13 + popping up by popping up a message in any open browser windows if something has 14 + happened or an object has been updated. 13 15 14 - = Enabling Notifications = 16 + To enable real-time notifications: 15 17 16 - To enable notifications, set `notification.enabled` to `true` in your 17 - configuration. This will enable the notification menu in the menu bar, and 18 - notifications will be published when users take actions. 18 + - Set `notification.enabled` in your configuration to true. 19 + - Run the notification server, as described below. 19 20 20 - NOTE: This setting will be turned on for everyone soon. 21 + This document describes the process in detail. 21 22 22 23 = Running the Aphlict Server = 23 24 ··· 52 53 aphlict is restarted. 53 54 54 55 In most cases, the defaults are appropriate, except that you should set 55 - `notification.user` to some valid user so Aphlict isn't running as root. 56 + `notification.user` to some valid system user so Aphlict isn't running as root. 56 57 57 58 == Verifying Server Status == 58 59 ··· 62 63 63 64 == Testing the Server == 64 65 65 - The easiest way to test the server is to open a Maniphest Task or Differential 66 - Revision in two browser windows at the same time, then comment on it with one. 67 - You should get a notification in the other window. 66 + The easiest way to test the server is to have two users login and comment on 67 + the same Maniphest Task or Differential Revision. They should receive in-browser 68 + notifications about the other user's activity. 68 69 69 - NOTE: This will stop working soon, since we'll soon stop delivering 70 - notifications about your own actions. We'll provide an alternate way to test 71 - operation when this stops working. 70 + NOTE: This is cumbersome. There will be better testing tools at some point. 72 71 73 72 == Debugging Server Problems == 74 73 ··· 85 84 86 85 The server also generates a log, by default in `/var/log/aphlict.log`. You can 87 86 change this location by changing `notification.log` in your configuration. The 88 - log may contain information useful in resolving issues. 87 + log may contain information useful in resolving issues.
+1 -2
src/view/page/PhabricatorStandardPageView.php
··· 323 323 $user = $request->getUser(); 324 324 325 325 $container = null; 326 - if (PhabricatorEnv::getEnvConfig('notification.enabled') && 327 - $user->isLoggedIn()) { 326 + if ($user->isLoggedIn()) { 328 327 329 328 $aphlict_object_id = celerity_generate_unique_node_id(); 330 329 $aphlict_container_id = celerity_generate_unique_node_id();
+1 -2
src/view/page/menu/PhabricatorMainMenuView.php
··· 52 52 $menus = array(); 53 53 $alerts = array(); 54 54 55 - if (PhabricatorEnv::getEnvConfig('notification.enabled') && 56 - $user->isLoggedIn()) { 55 + if ($user->isLoggedIn()) { 57 56 list($menu, $dropdown) = $this->renderNotificationMenu(); 58 57 $alerts[] = $menu; 59 58 $menus[] = $dropdown;