protected function nestCommentHistory(DifferentialTransactionComment $comment, array $comments_by_line_number, array $users_by_phid) { $nested = array(); $previous_comments = $comments_by_line_number[$comment->getChangesetID()][$comment->getLineNumber()]; foreach ($previous_comments as $previous_comment) { if ($previous_comment->getID() >= $comment->getID()) { break; } $nested = $this->indentForMail(array_merge($nested, explode("\n", $previous_comment->getContent()))); $user = idx($users_by_phid, $previous_comment->getAuthorPHID(), null); if ($user) { array_unshift($nested, pht('%s wrote:', $user->getUserName())); } } $nested = array_merge($nested, explode("\n", $comment->getContent())); return implode("\n", $nested); }
private function getInlineURI(DifferentialTransactionComment $comment) { $changeset = $this->getChangeset($comment->getChangesetID()); if (!$changeset) { return null; } $diff = $changeset->getDiff(); if (!$diff) { return null; } $revision = $diff->getRevision(); if (!$revision) { return null; } $link_href = '/' . $revision->getMonogram() . '#inline-' . $comment->getID(); $link_href = PhabricatorEnv::getProductionURI($link_href); return $link_href; }