]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/EmailSummary/lib/useremailsummaryhandler.php
Merge branch 'master' of gitorious.org:social/mainline into social-master
[quix0rs-gnu-social.git] / plugins / EmailSummary / lib / useremailsummaryhandler.php
index fe814a3fb5ba0610b5547a980f4ae63381c1b263..f900d93595108d3238493e419b96a08e1d0739fe 100644 (file)
@@ -103,7 +103,7 @@ class UserEmailSummaryHandler extends QueueHandler
         }
 
         // An InboxNoticeStream for a certain user, scoped to its own view
-        $stream = new InboxNoticeStream($profile, $profile);
+        $stream = new InboxNoticeStream($profile);
 
         $notice = $stream->getNotices(0, self::MAX_NOTICES, $since_id);
 
@@ -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)) {
@@ -173,7 +173,7 @@ class UserEmailSummaryHandler extends QueueHandler
             $out->text(' ');
             $out->raw($notice->rendered);
             $out->elementStart('div', array('style' => 'font-size: 0.8em; padding-top: 4px;'));
-            $noticeurl = $notice->getUrl();
+            $noticeurl = $notice->getLocalUrl();
             // above should always return an URL
             assert(!empty($noticeurl));
             $out->elementStart('a', array('rel' => 'bookmark',
@@ -189,7 +189,7 @@ class UserEmailSummaryHandler extends QueueHandler
             $out->elementEnd('div');
             $out->elementEnd('td');
             $out->elementEnd('tr');
-        }
+        } while ($notice->fetch());
 
         $out->elementEnd('table');