diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php index c2418370a6..67b17c9069 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php @@ -260,10 +260,10 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO { $receiver->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); $editor = new ManiphestTransactionEditor(); - $editor->setActor($user); + $editor->setActor($user->getPhabricatorUser()); $handler = $editor->buildReplyHandler($receiver); - $handler->setActor($user); + $handler->setActor($user->getPhabricatorUser()); $handler->setExcludeMailRecipientPHIDs( $this->loadExcludeMailRecipientPHIDs()); $handler->processEmail($this); diff --git a/src/applications/people/storage/PhabricatorExternalAccount.php b/src/applications/people/storage/PhabricatorExternalAccount.php index cffffdb482..0f0e9ef92b 100644 --- a/src/applications/people/storage/PhabricatorExternalAccount.php +++ b/src/applications/people/storage/PhabricatorExternalAccount.php @@ -20,4 +20,11 @@ final class PhabricatorExternalAccount extends PhabricatorUserDAO { ) + parent::getConfiguration(); } + public function getPhabricatorUser() { + $tmp_usr = id(new PhabricatorUser()) + ->makeEphemeral() + ->setPHID($this->getPHID()); + return $tmp_usr; + } + } diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index 2a9743a1d1..c018e65a1e 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -205,6 +205,13 @@ final class PhabricatorObjectHandleData { ->execute(); return mpull($vars, null, 'getPHID'); + case PhabricatorPHIDConstants::PHID_TYPE_XUSR: + $xusr_dao = new PhabricatorExternalAccount(); + $xusrs = $xusr_dao->loadAllWhere( + 'phid in (%Ls)', + $phids); + return mpull($xusrs, null, 'getPHID'); + } } @@ -681,6 +688,23 @@ final class PhabricatorObjectHandleData { } break; + case PhabricatorPHIDConstants::PHID_TYPE_XUSR: + foreach ($phids as $phid) { + $handle = new PhabricatorObjectHandle(); + $handle->setPHID($phid); + $handle->setType($type); + if (empty($objects[$phid])) { + $handle->setName('Unknown Display Name'); + } else { + $xusr = $objects[$phid]; + $display_name = $xusr->getDisplayName(); + $handle->setName($display_name); + $handle->setFullName($display_name.' (External User)'); + } + $handles[$phid] = $handle; + } + break; + default: $loader = null; if (isset($external_loaders[$type])) {