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

Add Maniphest Task email creator to CCs

Summary: Fixes T9369.

Test Plan:
- Sent a mail with Mail.app to `bugs@local.phacility.com`.
- Used "View Raw Mail", copy-pasted it into `mail.txt` on disk.
- Ran `cat mail.txt | ./scripts/mail/manage_mail.php --process-duplicates`.
- Saw task get created and me get added as CC.
- Changed "To" to include another user, ran command again, saw task get created and other user get added as CC.

Reviewers: chad

Reviewed By: chad

Subscribers: Korvin

Maniphest Tasks: T9369

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

+21 -10
+1 -1
src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php
··· 56 56 ->setMailReceiver(ConpherenceThread::initializeNewRoom($sender)) 57 57 ->setMailAddedParticipantPHIDs($phids) 58 58 ->setActor($sender) 59 - ->setExcludeMailRecipientPHIDs($mail->loadExcludeMailRecipientPHIDs()) 59 + ->setExcludeMailRecipientPHIDs($mail->loadAllRecipientPHIDs()) 60 60 ->processEmail($mail); 61 61 62 62 if ($conpherence) {
+1 -1
src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
··· 24 24 25 25 $handler->setActor($sender); 26 26 $handler->setExcludeMailRecipientPHIDs( 27 - $mail->loadExcludeMailRecipientPHIDs()); 27 + $mail->loadAllRecipientPHIDs()); 28 28 if ($this->getApplicationEmail()) { 29 29 $handler->setApplicationEmail($this->getApplicationEmail()); 30 30 }
+13 -2
src/applications/maniphest/mail/ManiphestReplyHandler.php
··· 19 19 20 20 $object = $this->getMailReceiver(); 21 21 $is_new = !$object->getID(); 22 + $actor = $this->getActor(); 22 23 23 24 $xactions = array(); 24 25 25 26 if ($is_new) { 26 - $xactions[] = $object->getApplicationTransactionTemplate() 27 + $xactions[] = $this->newTransaction() 27 28 ->setTransactionType(ManiphestTransaction::TYPE_TITLE) 28 29 ->setNewValue(nonempty($mail->getSubject(), pht('Untitled Task'))); 29 30 30 - $xactions[] = $object->getApplicationTransactionTemplate() 31 + $xactions[] = $this->newTransaction() 31 32 ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) 32 33 ->setNewValue($body); 34 + 35 + $actor_phid = $actor->getPHID(); 36 + if ($actor_phid) { 37 + $xactions[] = $this->newTransaction() 38 + ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) 39 + ->setNewValue( 40 + array( 41 + '+' => array($actor_phid), 42 + )); 43 + } 33 44 } 34 45 35 46 return $xactions;
+1 -1
src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php
··· 49 49 return $handler 50 50 ->setMailReceiver($object) 51 51 ->setActor($sender) 52 - ->setExcludeMailRecipientPHIDs($mail->loadExcludeMailRecipientPHIDs()) 52 + ->setExcludeMailRecipientPHIDs($mail->loadAllRecipientPHIDs()) 53 53 ->processEmail($mail); 54 54 } 55 55
+1 -1
src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
··· 82 82 return $this->getRawEmailAddresses(idx($this->headers, 'to')); 83 83 } 84 84 85 - public function loadExcludeMailRecipientPHIDs() { 85 + public function loadAllRecipientPHIDs() { 86 86 $addresses = array_merge( 87 87 $this->getToAddresses(), 88 88 $this->getCCAddresses());
+4 -4
src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php
··· 39 39 return $editor; 40 40 } 41 41 42 - private function newTransaction() { 42 + protected function newTransaction() { 43 43 return $this->getMailReceiver()->getApplicationTransactionTemplate(); 44 44 } 45 45 ··· 80 80 $xactions = $this->didReceiveMail($mail, $body); 81 81 82 82 // If this object is subscribable, subscribe all the users who were 83 - // CC'd on the message. 83 + // recipients on the message. 84 84 if ($object instanceof PhabricatorSubscribableInterface) { 85 - $subscriber_phids = $mail->loadCCPHIDs(); 85 + $subscriber_phids = $mail->loadAllRecipientPHIDs(); 86 86 if ($subscriber_phids) { 87 87 $xactions[] = $this->newTransaction() 88 88 ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) 89 89 ->setNewValue( 90 90 array( 91 - '+' => array($viewer->getPHID()), 91 + '+' => $subscriber_phids, 92 92 )); 93 93 } 94 94 }