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

Mark Maniphest notifications read if we send the user an email

Summary:
See D3784, T1403. When we send a user an email and a notification from Maniphest, mark the notification as read.

(It would be nice to do the thing with `multiplexMail()` a little less hackily, but it gets very complicated to do correctly because we require handles but sometimes do not have an actor/user so I'm punting for now.)

Test Plan: Acted on a task, verified notification was marked read because I received an email.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1403

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

+17 -6
+17 -6
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 218 218 $email_cc, 219 219 $task->getCCPHIDs()); 220 220 221 - $this->publishFeedStory($task, $transactions); 221 + $mail = $this->sendEmail($task, $transactions, $email_to, $email_cc); 222 222 223 - // TODO: Do this offline via timeline 223 + $this->publishFeedStory( 224 + $task, 225 + $transactions, 226 + $mail->buildRecipientList()); 227 + 228 + // TODO: Do this offline via workers 224 229 PhabricatorSearchManiphestIndexer::indexTask($task); 225 230 226 - $this->sendEmail($task, $transactions, $email_to, $email_cc); 227 231 } 228 232 229 233 protected function getSubjectPrefix() { ··· 300 304 foreach ($mails as $mail) { 301 305 $mail->saveAndSend(); 302 306 } 307 + 308 + $template->addTos($email_to); 309 + $template->addCCs($email_cc); 310 + return $template; 303 311 } 304 312 305 313 public function buildReplyHandler(ManiphestTask $task) { ··· 310 318 return $handler_object; 311 319 } 312 320 313 - private function publishFeedStory(ManiphestTask $task, array $transactions) { 321 + private function publishFeedStory( 322 + ManiphestTask $task, 323 + array $transactions, 324 + array $mailed_phids) { 314 325 assert_instances_of($transactions, 'ManiphestTransaction'); 315 326 316 327 $actions = array(ManiphestAction::ACTION_UPDATE); ··· 344 355 $actor_phid = head($transactions)->getAuthorPHID(); 345 356 $author_phid = $task->getAuthorPHID(); 346 357 347 - 348 358 id(new PhabricatorFeedStoryPublisher()) 349 - ->setStoryType(PhabricatorFeedStoryTypeConstants::STORY_MANIPHEST) 359 + ->setStoryType('PhabricatorFeedStoryManiphest') 350 360 ->setStoryData(array( 351 361 'taskPHID' => $task->getPHID(), 352 362 'transactionIDs' => mpull($transactions, 'getID'), ··· 376 386 $owner_phid, 377 387 $actor_phid)), 378 388 $task->getCCPHIDs())) 389 + ->setMailRecipientPHIDs($mailed_phids) 379 390 ->publish(); 380 391 } 381 392