mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +01:00
Update Chatlog for handleRequest
Summary: Updates Chatlog Test Plan: Use Chatlog Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13763
This commit is contained in:
parent
d902dd6589
commit
deb20d6dae
2 changed files with 14 additions and 21 deletions
|
@ -7,12 +7,11 @@ final class PhabricatorChatLogChannelListController
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processRequest() {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
$viewer = $request->getViewer();
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$channels = id(new PhabricatorChatLogChannelQuery())
|
$channels = id(new PhabricatorChatLogChannelQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$list = new PHUIObjectItemListView();
|
$list = new PHUIObjectItemListView();
|
||||||
|
|
|
@ -3,19 +3,13 @@
|
||||||
final class PhabricatorChatLogChannelLogController
|
final class PhabricatorChatLogChannelLogController
|
||||||
extends PhabricatorChatLogController {
|
extends PhabricatorChatLogController {
|
||||||
|
|
||||||
private $channelID;
|
|
||||||
|
|
||||||
public function shouldAllowPublic() {
|
public function shouldAllowPublic() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$this->channelID = $data['channelID'];
|
$viewer = $request->getViewer();
|
||||||
}
|
$id = $request->getURIData('channelID');
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$uri = clone $request->getRequestURI();
|
$uri = clone $request->getRequestURI();
|
||||||
$uri->setQueryParams(array());
|
$uri->setQueryParams(array());
|
||||||
|
@ -25,12 +19,12 @@ final class PhabricatorChatLogChannelLogController
|
||||||
$pager->setPageSize(250);
|
$pager->setPageSize(250);
|
||||||
|
|
||||||
$query = id(new PhabricatorChatLogQuery())
|
$query = id(new PhabricatorChatLogQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withChannelIDs(array($this->channelID));
|
->withChannelIDs(array($id));
|
||||||
|
|
||||||
$channel = id(new PhabricatorChatLogChannelQuery())
|
$channel = id(new PhabricatorChatLogChannelQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withIDs(array($this->channelID))
|
->withIDs(array($id))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
if (!$channel) {
|
if (!$channel) {
|
||||||
|
@ -115,7 +109,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
|
|
||||||
$href = $uri->alter('at', $block['id']);
|
$href = $uri->alter('at', $block['id']);
|
||||||
$timestamp = $block['epoch'];
|
$timestamp = $block['epoch'];
|
||||||
$timestamp = phabricator_datetime($timestamp, $user);
|
$timestamp = phabricator_datetime($timestamp, $viewer);
|
||||||
$timestamp = phutil_tag(
|
$timestamp = phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
@ -189,7 +183,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
->addTextCrumb($channel->getChannelName(), $uri);
|
->addTextCrumb($channel->getChannelName(), $uri);
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($user)
|
->setUser($viewer)
|
||||||
->setMethod('GET')
|
->setMethod('GET')
|
||||||
->setAction($uri)
|
->setAction($uri)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -273,7 +267,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
AphrontRequest $request,
|
AphrontRequest $request,
|
||||||
PhabricatorChatLogQuery $query) {
|
PhabricatorChatLogQuery $query) {
|
||||||
|
|
||||||
$user = $request->getUser();
|
$viewer = $request->getViewer();
|
||||||
|
|
||||||
$at_id = $request->getInt('at');
|
$at_id = $request->getInt('at');
|
||||||
$at_date = $request->getStr('date');
|
$at_date = $request->getStr('date');
|
||||||
|
@ -298,7 +292,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if ($at_date) {
|
} else if ($at_date) {
|
||||||
$timestamp = PhabricatorTime::parseLocalTime($at_date, $user);
|
$timestamp = PhabricatorTime::parseLocalTime($at_date, $viewer);
|
||||||
|
|
||||||
if ($timestamp) {
|
if ($timestamp) {
|
||||||
$context_logs = $query
|
$context_logs = $query
|
||||||
|
|
Loading…
Reference in a new issue