From 2f91cb0df7de37fd62588c6484b9f94bcd227c1d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 29 Mar 2016 12:57:52 +0200 Subject: [PATCH] We should assume all verbs and such are their full URIs in our db --- classes/Profile.php | 6 ++---- lib/noticestream.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/classes/Profile.php b/classes/Profile.php index 87168ace4a..fb6a621273 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -841,10 +841,8 @@ class Profile extends Managed_DataObject $notices = new Notice(); $notices->profile_id = $this->getID(); - $notices->whereAddIn('verb', - [ActivityUtils::resolveUri(ActivityVerb::POST, true), ActivityVerb::POST], - $notices->columnType('verb')); - $cnt = (int) $notices->count(); // we don't have to provide anything as Notice is key'd + $notices->verb = ActivityVerb::POST; + $cnt = (int) $notices->count('id'); // Not sure if I imagine this, but 'id' was faster than the defaulting 'uri'? if (!empty($c)) { $c->set(Cache::key('profile:notice_count:'.$this->getID()), $cnt); diff --git a/lib/noticestream.php b/lib/noticestream.php index 2b04a89ca4..72325a0fe4 100644 --- a/lib/noticestream.php +++ b/lib/noticestream.php @@ -48,9 +48,9 @@ abstract class NoticeStream public function __construct() { foreach ($this->selectVerbs as $key=>$val) { - // to avoid database inconsistency issues we select both relative and absolute verbs $this->selectVerbs[ActivityUtils::resolveUri($key)] = $val; - $this->selectVerbs[ActivityUtils::resolveUri($key, true)] = $val; + // to avoid database inconsistency issues we can select both relative and absolute verbs + //$this->selectVerbs[ActivityUtils::resolveUri($key, true)] = $val; } }