Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2895493
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/tokens/feed/PhabricatorTokenGivenFeedStory.php b/src/applications/tokens/feed/PhabricatorTokenGivenFeedStory.php
index 831f2cd507..7a646fd0f5 100644
--- a/src/applications/tokens/feed/PhabricatorTokenGivenFeedStory.php
+++ b/src/applications/tokens/feed/PhabricatorTokenGivenFeedStory.php
@@ -1,56 +1,65 @@
<?php
final class PhabricatorTokenGivenFeedStory
extends PhabricatorFeedStory {
public function getPrimaryObjectPHID() {
return $this->getValue('objectPHID');
}
public function getRequiredHandlePHIDs() {
$phids = array();
$phids[] = $this->getValue('objectPHID');
$phids[] = $this->getValue('authorPHID');
return $phids;
}
public function getRequiredObjectPHIDs() {
$phids = array();
$phids[] = $this->getValue('tokenPHID');
return $phids;
}
public function renderView() {
$view = $this->newStoryView();
$view->setAppIcon('token-dark');
$author_phid = $this->getValue('authorPHID');
$href = $this->getHandle($this->getPrimaryObjectPHID())->getURI();
$view->setHref($href);
$view->setTitle($this->renderTitle());
$view->setImage($this->getHandle($author_phid)->getImageURI());
return $view;
}
private function renderTitle() {
$token = $this->getObject($this->getValue('tokenPHID'));
$title = pht(
'%s awarded %s a %s token.',
$this->linkTo($this->getValue('authorPHID')),
$this->linkTo($this->getValue('objectPHID')),
$token->getName());
return $title;
}
public function renderText() {
$old_target = $this->getRenderingTarget();
$this->setRenderingTarget(PhabricatorApplicationTransaction::TARGET_TEXT);
$title = $this->renderTitle();
$this->setRenderingTarget($old_target);
return $title;
}
+ public function renderAsTextForDoorkeeper(
+ DoorkeeperFeedStoryPublisher $publisher) {
+ // TODO: This is slightly wrong, as it does not respect implied context
+ // on the publisher, so it will always say "awarded D123 a token" when it
+ // should sometimes say "awarded this revision a token".
+ return $this->renderText();
+ }
+
+
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Jan 19 2025, 21:32 (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128982
Default Alt Text
(2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment