protected function saveComment(PhabricatorInlineCommentInterface $inline) { $inline->openTransaction(); $inline->save(); DifferentialDraft::markHasDraft($inline->getAuthorPHID(), $inline->getRevisionPHID(), $inline->getPHID()); $inline->saveTransaction(); }
public function isCompatible(PhabricatorInlineCommentInterface $comment) { return $this->getAuthorPHID() === $comment->getAuthorPHID() && $this->getSyntheticAuthor() === $comment->getSyntheticAuthor() && $this->getContent() === $comment->getContent(); }
private function renderInlineComment(PhabricatorInlineCommentInterface $comment) { $user = $this->user; $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft(); $allow_reply = (bool) $this->user; $on_right = $this->isCommentOnRightSideWhenDisplayed($comment); return id(new DifferentialInlineCommentView())->setInlineComment($comment)->setOnRight($on_right)->setHandles($this->handles)->setMarkupEngine($this->markupEngine)->setEditable($edit)->setAllowReply($allow_reply)->render(); }
protected function buildInlineComment(PhabricatorInlineCommentInterface $comment, $on_right = false) { $user = $this->getUser(); $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft() && $this->getShowEditAndReplyLinks(); $allow_reply = (bool) $user && $this->getShowEditAndReplyLinks(); $allow_done = !$comment->isDraft() && $this->getCanMarkDone(); return id(new PHUIDiffInlineCommentDetailView())->setUser($user)->setInlineComment($comment)->setIsOnRight($on_right)->setHandles($this->getHandles())->setMarkupEngine($this->getMarkupEngine())->setEditable($edit)->setAllowReply($allow_reply)->setCanMarkDone($allow_done)->setObjectOwnerPHID($this->getObjectOwnerPHID()); }
protected function buildInlineComment(PhabricatorInlineCommentInterface $comment, $on_right = false) { $user = $this->getUser(); $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft(); $allow_reply = (bool) $user; return id(new DifferentialInlineCommentView())->setInlineComment($comment)->setOnRight($on_right)->setHandles($this->getHandles())->setMarkupEngine($this->getMarkupEngine())->setEditable($edit)->setAllowReply($allow_reply); }