@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.

Move message posting to PhabricatorNotificationClient

Summary: Ref T4324. Centralize communication with the notification server. This will probably get less messy eventually.

Test Plan: Posted some messages.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4324

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

+14 -5
+5 -5
src/applications/feed/PhabricatorFeedStoryPublisher.php
··· 161 161 } 162 162 163 163 private function sendNotification($chrono_key) { 164 - $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); 165 164 166 165 $data = array( 167 166 'key' => (string)$chrono_key, 168 167 ); 169 168 170 - id(new HTTPSFuture($server_uri, $data)) 171 - ->setMethod('POST') 172 - ->setTimeout(1) 173 - ->resolve(); 169 + try { 170 + PhabricatorNotificationClient::postMessage($data); 171 + } catch (Exception $ex) { 172 + // Ignore, these are not critical. 173 + } 174 174 } 175 175 176 176 /**
+9
src/applications/notification/client/PhabricatorNotificationClient.php
··· 25 25 return $status; 26 26 } 27 27 28 + public static function postMessage(array $data) { 29 + $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri'); 30 + 31 + id(new HTTPSFuture($server_uri, $data)) 32 + ->setMethod('POST') 33 + ->setTimeout(1) 34 + ->resolvex(); 35 + } 36 + 28 37 }