Differential D12032 Diff 28963 src/applications/differential/query/DifferentialInlineCommentQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialInlineCommentQuery.php
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | if ($this->phids !== null) { | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->viewerAndChangesetIDs) { | if ($this->viewerAndChangesetIDs) { | ||||
list($phid, $ids) = $this->viewerAndChangesetIDs; | list($phid, $ids) = $this->viewerAndChangesetIDs; | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'changesetID IN (%Ld) AND | 'changesetID IN (%Ld) AND | ||||
(authorPHID = %s OR transactionPHID IS NOT NULL)', | ((authorPHID = %s AND isDeleted = 0) OR transactionPHID IS NOT NULL)', | ||||
$ids, | $ids, | ||||
$phid); | $phid); | ||||
} | } | ||||
if ($this->draftComments) { | if ($this->draftComments) { | ||||
list($phid, $rev_id) = $this->draftComments; | list($phid, $rev_id) = $this->draftComments; | ||||
$rev_phid = queryfx_one( | $rev_phid = queryfx_one( | ||||
$conn_r, | $conn_r, | ||||
'SELECT phid FROM %T WHERE id = %d', | 'SELECT phid FROM %T WHERE id = %d', | ||||
id(new DifferentialRevision())->getTableName(), | id(new DifferentialRevision())->getTableName(), | ||||
$rev_id); | $rev_id); | ||||
if (!$rev_phid) { | if (!$rev_phid) { | ||||
throw new PhabricatorEmptyQueryException(); | throw new PhabricatorEmptyQueryException(); | ||||
} | } | ||||
$rev_phid = $rev_phid['phid']; | $rev_phid = $rev_phid['phid']; | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'authorPHID = %s AND revisionPHID = %s AND transactionPHID IS NULL', | 'authorPHID = %s AND revisionPHID = %s AND transactionPHID IS NULL | ||||
AND isDeleted = 0', | |||||
$phid, | $phid, | ||||
$rev_phid); | $rev_phid); | ||||
} | } | ||||
if ($this->draftsByAuthors) { | if ($this->draftsByAuthors) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'authorPHID IN (%Ls) AND transactionPHID IS NULL', | 'authorPHID IN (%Ls) AND isDeleted = 0 AND transactionPHID IS NULL', | ||||
$this->draftsByAuthors); | $this->draftsByAuthors); | ||||
} | } | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($where); | ||||
} | } | ||||
} | } |