From d1005c67a9bec6d8b6412b41b4ad1331a8291a9d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 4 Jun 2015 20:21:49 +0200 Subject: [PATCH] No need to check logged in user It's always the notice's author we want to check this for anyway. I kept getting errors like, which are now fixed: Trying to get property of non-object in /srv/www/vhosts/se/umeahackerspace/social/%/htdocs/local/plugins/Qvitter/QvitterPlugin.php on line 594 I guess it might also screw up (somehow?) if some future awesome notice handling thing decided to run the StartNoticeDistribute event when the session is not currently used by the notice's author. But that's a bit far-fetched. --- QvitterPlugin.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/QvitterPlugin.php b/QvitterPlugin.php index aeea84d..66b0188 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -588,10 +588,9 @@ class QvitterPlugin extends Plugin { // mark reply/mention-notifications as read if we're replying to a notice we're notified about if($notice->reply_to) { - $user = common_current_user(); $notification_to_mark_as_seen = QvitterNotification::pkeyGet(array('is_seen' => 0, 'notice_id' => $notice->reply_to, - 'to_profile_id' => $user->id)); + 'to_profile_id' => $notice->profile_id)); if($notification_to_mark_as_seen instanceof QvitterNotification && ($notification_to_mark_as_seen->ntype == 'mention' || $notification_to_mark_as_seen->ntype == 'reply')) { $orig = clone($notification_to_mark_as_seen);