From: Joshua Judson Rosen Date: Mon, 24 Nov 2014 04:03:14 +0000 (-0500) Subject: UserEmailSummaryHandler: Update notice-fetching logic X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bf0f22744da62498e648de992df6528d9973da8b;p=quix0rs-gnu-social.git UserEmailSummaryHandler: Update notice-fetching logic InboxNoticeStream::getNotices() no longer returns an ArrayWrapper; just fetch notices normally via $notice->fetch(), so that we can actually get the top notice-ID and update email_summary_status accordingly--and not mail about the same notices repeatedly. --- diff --git a/plugins/EmailSummary/lib/useremailsummaryhandler.php b/plugins/EmailSummary/lib/useremailsummaryhandler.php index 8dbcefc11e..ec86e59d19 100644 --- a/plugins/EmailSummary/lib/useremailsummaryhandler.php +++ b/plugins/EmailSummary/lib/useremailsummaryhandler.php @@ -117,8 +117,8 @@ class UserEmailSummaryHandler extends QueueHandler $new_top = null; - if ($notice instanceof ArrayWrapper) { - $new_top = $notice->_items[0]->id; + if ($notice->fetch()) { + $new_top = $notice->id; } // TRANS: Subject for e-mail. @@ -145,7 +145,7 @@ class UserEmailSummaryHandler extends QueueHandler $out->elementStart('table', array('width' => '550px', 'style' => 'border: none; border-collapse: collapse;', 'cellpadding' => '6')); - while ($notice->fetch()) { + do { $profile = Profile::getKV('id', $notice->profile_id); if (empty($profile)) { @@ -189,7 +189,7 @@ class UserEmailSummaryHandler extends QueueHandler $out->elementEnd('div'); $out->elementEnd('td'); $out->elementEnd('tr'); - } + } while ($notice->fetch()); $out->elementEnd('table');