Page MenuHomePhabricator

D15765.id.diff
No OneTemporary

D15765.id.diff

diff --git a/src/applications/diffusion/controller/DiffusionPushEventViewController.php b/src/applications/diffusion/controller/DiffusionPushEventViewController.php
--- a/src/applications/diffusion/controller/DiffusionPushEventViewController.php
+++ b/src/applications/diffusion/controller/DiffusionPushEventViewController.php
@@ -50,8 +50,7 @@
$updates_table = id(new DiffusionPushLogListView())
->setUser($viewer)
- ->setLogs($logs)
- ->setHandles($this->loadViewerHandles(mpull($logs, 'getPusherPHID')));
+ ->setLogs($logs);
$update_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('All Pushed Updates'))
diff --git a/src/applications/diffusion/view/DiffusionPushLogListView.php b/src/applications/diffusion/view/DiffusionPushLogListView.php
--- a/src/applications/diffusion/view/DiffusionPushLogListView.php
+++ b/src/applications/diffusion/view/DiffusionPushLogListView.php
@@ -3,7 +3,6 @@
final class DiffusionPushLogListView extends AphrontView {
private $logs;
- private $handles;
public function setLogs(array $logs) {
assert_instances_of($logs, 'PhabricatorRepositoryPushLog');
@@ -11,15 +10,20 @@
return $this;
}
- public function setHandles(array $handles) {
- $this->handles = $handles;
- return $this;
- }
-
public function render() {
$logs = $this->logs;
- $viewer = $this->getUser();
- $handles = $this->handles;
+ $viewer = $this->getViewer();
+
+ $handle_phids = array();
+ foreach ($logs as $log) {
+ $handle_phids[] = $log->getPusherPHID();
+ $device_phid = $log->getDevicePHID();
+ if ($device_phid) {
+ $handle_phids[] = $device_phid;
+ }
+ }
+
+ $handles = $viewer->loadHandles($handle_phids);
// Figure out which repositories are editable. We only let you see remote
// IPs if you have edit capability on a repository.
@@ -62,7 +66,7 @@
$device_phid = $log->getDevicePHID();
if ($device_phid) {
- $device = $handles[$device_phid]->renderLink();
+ $device = $viewer->renderHandle($device_phid);
$any_host = true;
} else {
$device = null;
@@ -81,7 +85,7 @@
'href' => $repository->getURI(),
),
$repository->getDisplayName()),
- $handles[$log->getPusherPHID()]->renderLink(),
+ $viewer->renderHandle($log->getPusherPHID()),
$remote_address,
$log->getPushEvent()->getRemoteProtocol(),
$device,
diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
@@ -92,25 +92,13 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
- protected function getRequiredHandlePHIDsForResultList(
- array $logs,
- PhabricatorSavedQuery $query) {
- $phids = array();
- $phids[] = mpull($logs, 'getPusherPHID');
- $phids[] = mpull($logs, 'getDevicePHID');
- $phids = array_mergev($phids);
- $phids = array_filter($phids);
- return $phids;
- }
-
protected function renderResultList(
array $logs,
PhabricatorSavedQuery $query,
array $handles) {
$table = id(new DiffusionPushLogListView())
- ->setUser($this->requireViewer())
- ->setHandles($handles)
+ ->setViewer($this->requireViewer())
->setLogs($logs);
return id(new PhabricatorApplicationSearchResultView())

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 15, 7:07 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7654865
Default Alt Text
D15765.id.diff (3 KB)

Event Timeline