Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/editor/PhrictionDocumentEditor.php
| Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | if ($project_phid) { | ||||
| $related_phids[] = $project_phid; | $related_phids[] = $project_phid; | ||||
| } | } | ||||
| if ($this->fromDocumentPHID) { | if ($this->fromDocumentPHID) { | ||||
| $related_phids[] = $this->fromDocumentPHID; | $related_phids[] = $this->fromDocumentPHID; | ||||
| } | } | ||||
| if ($feed_action) { | if ($feed_action) { | ||||
| $content = id(new PhutilUTF8StringTruncator()) | |||||
| ->setMaximumGlyphs(140) | |||||
| ->truncateString($new_content->getContent()); | |||||
| id(new PhabricatorFeedStoryPublisher()) | id(new PhabricatorFeedStoryPublisher()) | ||||
| ->setRelatedPHIDs($related_phids) | ->setRelatedPHIDs($related_phids) | ||||
| ->setStoryAuthorPHID($this->getActor()->getPHID()) | ->setStoryAuthorPHID($this->getActor()->getPHID()) | ||||
| ->setStoryTime(time()) | ->setStoryTime(time()) | ||||
| ->setStoryType(PhabricatorFeedStoryTypeConstants::STORY_PHRICTION) | ->setStoryType(PhabricatorFeedStoryTypeConstants::STORY_PHRICTION) | ||||
| ->setStoryData( | ->setStoryData( | ||||
| array( | array( | ||||
| 'phid' => $document->getPHID(), | 'phid' => $document->getPHID(), | ||||
| 'action' => $feed_action, | 'action' => $feed_action, | ||||
| 'content' => phutil_utf8_shorten($new_content->getContent(), 140), | 'content' => $content, | ||||
| 'project' => $project_phid, | 'project' => $project_phid, | ||||
| 'movedFromPHID' => $this->fromDocumentPHID, | 'movedFromPHID' => $this->fromDocumentPHID, | ||||
| )) | )) | ||||
| ->publish(); | ->publish(); | ||||
| } | } | ||||
| // TODO: Migrate to ApplicationTransactions fast, so we get rid of this code | // TODO: Migrate to ApplicationTransactions fast, so we get rid of this code | ||||
| $subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID( | $subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID( | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||