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

Adding Handle Suport

Summary: Added PHID_TYPE_XUSR to loadObjectsofType() of PhabricatorObjectHandle data. Was trying to solve the setActor() issue. Created a getPhabricator method in PhabricatorExternalAccount. When I try to set authorPHID using setAuthorPHID() in PhabricatorExternalAccount it's saying bad setter call, if I don't, then it's saying authorPHID can't be null. Sending you diff for comments on this.

Test Plan:
{F42523}

{F42525}

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

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

authored by

Afaque Hussain and committed by
epriestley
f76ecd9e 16ba0275

+33 -2
+2 -2
src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
··· 260 260 $receiver->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); 261 261 262 262 $editor = new ManiphestTransactionEditor(); 263 - $editor->setActor($user); 263 + $editor->setActor($user->getPhabricatorUser()); 264 264 $handler = $editor->buildReplyHandler($receiver); 265 265 266 - $handler->setActor($user); 266 + $handler->setActor($user->getPhabricatorUser()); 267 267 $handler->setExcludeMailRecipientPHIDs( 268 268 $this->loadExcludeMailRecipientPHIDs()); 269 269 $handler->processEmail($this);
+7
src/applications/people/storage/PhabricatorExternalAccount.php
··· 20 20 ) + parent::getConfiguration(); 21 21 } 22 22 23 + public function getPhabricatorUser() { 24 + $tmp_usr = id(new PhabricatorUser()) 25 + ->makeEphemeral() 26 + ->setPHID($this->getPHID()); 27 + return $tmp_usr; 28 + } 29 + 23 30 }
+24
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 205 205 ->execute(); 206 206 return mpull($vars, null, 'getPHID'); 207 207 208 + case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 209 + $xusr_dao = new PhabricatorExternalAccount(); 210 + $xusrs = $xusr_dao->loadAllWhere( 211 + 'phid in (%Ls)', 212 + $phids); 213 + return mpull($xusrs, null, 'getPHID'); 214 + 208 215 } 209 216 } 210 217 ··· 676 683 $handle->setFullName('Phlux Variable "'.$key.'"'); 677 684 $handle->setURI('/phlux/view/'.$key.'/'); 678 685 $handle->setComplete(true); 686 + } 687 + $handles[$phid] = $handle; 688 + } 689 + break; 690 + 691 + case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 692 + foreach ($phids as $phid) { 693 + $handle = new PhabricatorObjectHandle(); 694 + $handle->setPHID($phid); 695 + $handle->setType($type); 696 + if (empty($objects[$phid])) { 697 + $handle->setName('Unknown Display Name'); 698 + } else { 699 + $xusr = $objects[$phid]; 700 + $display_name = $xusr->getDisplayName(); 701 + $handle->setName($display_name); 702 + $handle->setFullName($display_name.' (External User)'); 679 703 } 680 704 $handles[$phid] = $handle; 681 705 }