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

Use Application PHIDs for XUSR

Summary: Ref T2715. XUSR -> apps

Test Plan: `phid.query`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

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

+52 -32
+2
src/__phutil_library_map__.php
··· 1366 1366 'PhabricatorPeopleLdapController' => 'applications/people/controller/PhabricatorPeopleLdapController.php', 1367 1367 'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php', 1368 1368 'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php', 1369 + 'PhabricatorPeoplePHIDTypeExternal' => 'applications/people/phid/PhabricatorPeoplePHIDTypeExternal.php', 1369 1370 'PhabricatorPeopleProfileController' => 'applications/people/controller/PhabricatorPeopleProfileController.php', 1370 1371 'PhabricatorPeopleProfileEditController' => 'applications/people/controller/PhabricatorPeopleProfileEditController.php', 1371 1372 'PhabricatorPeopleProfilePictureController' => 'applications/people/controller/PhabricatorPeopleProfilePictureController.php', ··· 3387 3388 1 => 'PhabricatorApplicationSearchResultsControllerInterface', 3388 3389 ), 3389 3390 'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController', 3391 + 'PhabricatorPeoplePHIDTypeExternal' => 'PhabricatorPHIDType', 3390 3392 'PhabricatorPeopleProfileController' => 'PhabricatorPeopleController', 3391 3393 'PhabricatorPeopleProfileEditController' => 'PhabricatorPeopleController', 3392 3394 'PhabricatorPeopleProfilePictureController' => 'PhabricatorPeopleController',
-4
src/applications/auth/query/PhabricatorExternalAccountQuery.php
··· 68 68 } 69 69 70 70 public function willFilterPage(array $accounts) { 71 - if (!$accounts) { 72 - return $accounts; 73 - } 74 - 75 71 if ($this->needImages) { 76 72 $file_phids = mpull($accounts, 'getProfileImagePHID'); 77 73 $file_phids = array_filter($file_phids);
+3 -2
src/applications/metamta/query/PhabricatorMetaMTAActorQuery.php
··· 28 28 $actors[$phid] = id(new PhabricatorMetaMTAActor())->setPHID($phid); 29 29 } 30 30 31 - // TODO: Move this to PhabricatorPHIDType. 31 + // TODO: Move this to PhabricatorPHIDType, or the objects, or some 32 + // interface. 32 33 33 34 foreach ($type_map as $type => $phids) { 34 35 switch ($type) { 35 36 case PhabricatorPHIDConstants::PHID_TYPE_USER: 36 37 $this->loadUserActors($actors, $phids); 37 38 break; 38 - case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 39 + case PhabricatorPeoplePHIDTypeExternal::TYPECONST: 39 40 $this->loadExternalUserActors($actors, $phids); 40 41 break; 41 42 case PhabricatorMailingListPHIDTypeList::TYPECONST:
+46
src/applications/people/phid/PhabricatorPeoplePHIDTypeExternal.php
··· 1 + <?php 2 + 3 + final class PhabricatorPeoplePHIDTypeExternal extends PhabricatorPHIDType { 4 + 5 + const TYPECONST = 'XUSR'; 6 + 7 + public function getTypeConstant() { 8 + return self::TYPECONST; 9 + } 10 + 11 + public function getTypeName() { 12 + return pht('External Account'); 13 + } 14 + 15 + public function newObject() { 16 + return new PhabricatorExternalAccount(); 17 + } 18 + 19 + public function loadObjects( 20 + PhabricatorObjectQuery $query, 21 + array $phids) { 22 + 23 + return id(new PhabricatorExternalAccountQuery()) 24 + ->setViewer($query->getViewer()) 25 + ->withPHIDs($phids) 26 + ->execute(); 27 + } 28 + 29 + public function loadHandles( 30 + PhabricatorHandleQuery $query, 31 + array $handles, 32 + array $objects) { 33 + 34 + foreach ($handles as $phid => $handle) { 35 + $account = $objects[$phid]; 36 + 37 + $display_name = $account->getDisplayName(); 38 + $handle->setName($display_name); 39 + } 40 + } 41 + 42 + public function canLoadNamedObject($name) { 43 + return false; 44 + } 45 + 46 + }
+1 -1
src/applications/people/storage/PhabricatorExternalAccount.php
··· 33 33 34 34 public function generatePHID() { 35 35 return PhabricatorPHID::generateNewPHID( 36 - PhabricatorPHIDConstants::PHID_TYPE_XUSR); 36 + PhabricatorPeoplePHIDTypeExternal::TYPECONST); 37 37 } 38 38 39 39 public function getConfiguration() {
-1
src/applications/phid/PhabricatorPHIDConstants.php
··· 30 30 31 31 const PHID_TYPE_XACT = 'XACT'; 32 32 const PHID_TYPE_XCMT = 'XCMT'; 33 - const PHID_TYPE_XUSR = 'XUSR'; 34 33 35 34 const PHID_TYPE_BOOK = 'BOOK'; 36 35 const PHID_TYPE_ATOM = 'ATOM';
-24
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 114 114 ->execute(); 115 115 return mpull($posts, null, 'getPHID'); 116 116 117 - case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 118 - $xusr_dao = new PhabricatorExternalAccount(); 119 - $xusrs = $xusr_dao->loadAllWhere( 120 - 'phid in (%Ls)', 121 - $phids); 122 - return mpull($xusrs, null, 'getPHID'); 123 - 124 117 case PhabricatorPHIDConstants::PHID_TYPE_LEGD: 125 118 $legds = id(new LegalpadDocumentQuery()) 126 119 ->needDocumentBodies(true) ··· 322 315 $handle->setURI( 323 316 '/M'.$image->getMockID().'/'.$image->getID().'/'); 324 317 $handle->setComplete(true); 325 - } 326 - $handles[$phid] = $handle; 327 - } 328 - break; 329 - 330 - case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 331 - foreach ($phids as $phid) { 332 - $handle = new PhabricatorObjectHandle(); 333 - $handle->setPHID($phid); 334 - $handle->setType($type); 335 - if (empty($objects[$phid])) { 336 - $handle->setName('Unknown Display Name'); 337 - } else { 338 - $xusr = $objects[$phid]; 339 - $display_name = $xusr->getDisplayName(); 340 - $handle->setName($display_name); 341 - $handle->setFullName($display_name.' (External User)'); 342 318 } 343 319 $handles[$phid] = $handle; 344 320 }