1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 04:31:13 +01:00

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
This commit is contained in:
Afaque Hussain 2013-05-06 11:34:48 -07:00 committed by epriestley
parent 16ba0275c0
commit f76ecd9e76
3 changed files with 33 additions and 2 deletions

View file

@ -260,10 +260,10 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
$receiver->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); $receiver->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
$editor = new ManiphestTransactionEditor(); $editor = new ManiphestTransactionEditor();
$editor->setActor($user); $editor->setActor($user->getPhabricatorUser());
$handler = $editor->buildReplyHandler($receiver); $handler = $editor->buildReplyHandler($receiver);
$handler->setActor($user); $handler->setActor($user->getPhabricatorUser());
$handler->setExcludeMailRecipientPHIDs( $handler->setExcludeMailRecipientPHIDs(
$this->loadExcludeMailRecipientPHIDs()); $this->loadExcludeMailRecipientPHIDs());
$handler->processEmail($this); $handler->processEmail($this);

View file

@ -20,4 +20,11 @@ final class PhabricatorExternalAccount extends PhabricatorUserDAO {
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }
public function getPhabricatorUser() {
$tmp_usr = id(new PhabricatorUser())
->makeEphemeral()
->setPHID($this->getPHID());
return $tmp_usr;
}
} }

View file

@ -205,6 +205,13 @@ final class PhabricatorObjectHandleData {
->execute(); ->execute();
return mpull($vars, null, 'getPHID'); 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; 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: default:
$loader = null; $loader = null;
if (isset($external_loaders[$type])) { if (isset($external_loaders[$type])) {