forked from GNUsocial/gnu-social
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.
This commit is contained in:
parent
2f506dde28
commit
bf0f22744d
|
@ -117,8 +117,8 @@ class UserEmailSummaryHandler extends QueueHandler
|
||||||
|
|
||||||
$new_top = null;
|
$new_top = null;
|
||||||
|
|
||||||
if ($notice instanceof ArrayWrapper) {
|
if ($notice->fetch()) {
|
||||||
$new_top = $notice->_items[0]->id;
|
$new_top = $notice->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRANS: Subject for e-mail.
|
// TRANS: Subject for e-mail.
|
||||||
|
@ -145,7 +145,7 @@ class UserEmailSummaryHandler extends QueueHandler
|
||||||
$out->elementStart('table', array('width' => '550px',
|
$out->elementStart('table', array('width' => '550px',
|
||||||
'style' => 'border: none; border-collapse: collapse;', 'cellpadding' => '6'));
|
'style' => 'border: none; border-collapse: collapse;', 'cellpadding' => '6'));
|
||||||
|
|
||||||
while ($notice->fetch()) {
|
do {
|
||||||
$profile = Profile::getKV('id', $notice->profile_id);
|
$profile = Profile::getKV('id', $notice->profile_id);
|
||||||
|
|
||||||
if (empty($profile)) {
|
if (empty($profile)) {
|
||||||
|
@ -189,7 +189,7 @@ class UserEmailSummaryHandler extends QueueHandler
|
||||||
$out->elementEnd('div');
|
$out->elementEnd('div');
|
||||||
$out->elementEnd('td');
|
$out->elementEnd('td');
|
||||||
$out->elementEnd('tr');
|
$out->elementEnd('tr');
|
||||||
}
|
} while ($notice->fetch());
|
||||||
|
|
||||||
$out->elementEnd('table');
|
$out->elementEnd('table');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue