Conpherence - fix unread counts

Summary: we weren't updating the "latest seen transaction PHID" properly. do that and ONLY do it from the view handler so we know the user got a real good chance of actually seeing the message. also we weren't searching through the transactions correctly; fix that.

Test Plan: sent a test user some messages. noted the proper count of unread messages.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Maniphest Tasks: T2399

Differential Revision: https://secure.phabricator.com/D4677
This commit is contained in:
Bob Trahan
2013-01-26 18:53:30 -08:00
parent 9437bc019d
commit 22ce74c5a8
4 changed files with 12 additions and 10 deletions

View File

@@ -49,8 +49,10 @@ final class ConpherenceViewController extends
$this->setConpherence($conpherence);
$participant = $conpherence->getParticipant($user->getPHID());
$transactions = $conpherence->getTransactions();
$latest_transaction = end($transactions);
$write_guard = AphrontWriteGuard::beginScopedUnguardedWrites();
$participant->markUpToDate();
$participant->markUpToDate($latest_transaction);
unset($write_guard);
$header = $this->renderHeaderPaneContent();