diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 78dc60a..6f7cf8a 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -395,6 +395,7 @@ class QvitterPlugin extends Plugin { // replies and mentions (no notifications for these if this is a repeat) else { + $reply_notification_to = false; // check for reply to insert in notifications if($notice->reply_to) { $replyparent = $notice->getParent(); diff --git a/actions/apinewnotifications.php b/actions/apinewnotifications.php index 746c487..ffe0121 100644 --- a/actions/apinewnotifications.php +++ b/actions/apinewnotifications.php @@ -55,9 +55,10 @@ class ApiNewNotificationsAction extends ApiAction { parent::handle(); - $user_id = Profile::current()->id; + $new_notifications = array(); - if($user_id) { + if(Profile::current()) { + $user_id = Profile::current()->id; $notification = new QvitterNotification(); $notification->selectAdd(); diff --git a/actions/apiqvitternotifications.php b/actions/apiqvitternotifications.php index 236304c..122cc0b 100644 --- a/actions/apiqvitternotifications.php +++ b/actions/apiqvitternotifications.php @@ -127,7 +127,11 @@ 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, diff --git a/actions/qvitter.php b/actions/qvitter.php index 5a58759..a8bfe64 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -102,9 +102,9 @@ class QvitterAction extends ApiAction