From c5285189ae1fbd8a0c0ea12bbd3aadc121ae9a68 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Thu, 6 Aug 2015 18:54:15 +0200 Subject: [PATCH] maybe solves the notification issue on gnusocial.de https://gnusocial.de/notice/6701227 --- actions/apiqvitternotifications.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/actions/apiqvitternotifications.php b/actions/apiqvitternotifications.php index 8fe31f0..ca195cc 100644 --- a/actions/apiqvitternotifications.php +++ b/actions/apiqvitternotifications.php @@ -1,5 +1,5 @@ \\\\_\ · · \\) \____) · · · - · · + · · · · · Qvitter is free software: you can redistribute it and / or modify it · · under the terms of the GNU Affero General Public License as published by · @@ -30,7 +30,7 @@ · along with Qvitter. If not, see . · · · · Contact h@nnesmannerhe.im if you have any questions. · - · · + · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */ if (!defined('STATUSNET')) { @@ -82,7 +82,7 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction */ function showTimeline() { - $notice = null; + $notice = null; $notifications_populated = array(); @@ -93,7 +93,13 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction if($notification->notice_id === null) { continue; } else { - $notice = self::twitterSimpleStatusArray(Notice::getKV($notification->notice_id)); + $notice_object = Notice::getKV($notification->notice_id); + if($notice_object instanceof Notice) { + $notice = self::twitterSimpleStatusArray($notice_object); + } else { + continue; + } + } } @@ -134,17 +140,17 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction $notices = array(); $profile = ($this->auth_user) ? $this->auth_user->getProfile() : null; - + if(!$profile instanceof Profile) { return false; } - + $stream = new NotificationStream($profile); $notifications = $stream->getNotifications(($this->page - 1) * $this->count, $this->count, $this->since_id, - $this->max_id); + $this->max_id); $notifications = $notifications->fetchAll(); @@ -205,5 +211,5 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction return null; } - + }