Skip to content

Commit

Permalink
Include previous commenters in high-priority mention list
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Nov 4, 2024
1 parent 774e089 commit b8137f2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/mentionlister.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ function __construct($user, $prow, $cvis, $reason) {
$this->add_reviewers($prow, $user, $cvis);
}

// XXX todo: list previous commentees in privileged position?
// XXX todo: list lead?
// XXX list lead?
if ($prow
&& $prow->shepherdContactId > 0
&& $prow->shepherdContactId !== $user->contactId) {
$this->add_shepherd($prow, $user);
}

if ($prow) {
$this->add_commenters($prow, $user, $cvis);
}

if ((!$prow || !$prow->has_author($user))
&& $user->can_view_pc()) {
if (!$prow
Expand Down Expand Up @@ -122,6 +125,21 @@ private function add_shepherd($prow, $user) {
}
}

/** @param PaperInfo $prow
* @param Contact $user
* @param int $cvis */
private function add_commenters($prow, $user, $cvis) {
foreach ($prow->viewable_comment_skeletons($user) as $crow) {
if (!in_array($crow->contactId, $this->rcids)
&& $user->can_view_comment_identity($prow, $crow)
&& ($commenter = $crow->commenter())
&& !$commenter->is_dormant()) {
$this->lists["reviewers"][] = $commenter;
$this->rcids[] = $crow->contactId;
}
}
}


/** @return array<string,list<Author|Contact>> */
function lists() {
Expand Down

0 comments on commit b8137f2

Please sign in to comment.