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:
parent
16ba0275c0
commit
f76ecd9e76
3 changed files with 33 additions and 2 deletions
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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])) {
|
||||||
|
|
Loading…
Reference in a new issue