]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
We should assume all verbs and such are their full URIs in our db
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Mar 2016 10:57:52 +0000 (12:57 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 29 Mar 2016 10:57:52 +0000 (12:57 +0200)
classes/Profile.php
lib/noticestream.php

index 87168ace4a612b8f03591b30b5a81ee834e07344..fb6a62127393cd6cb9edb8067c8eca4f5f349ea6 100644 (file)
@@ -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);
index 2b04a89ca4297c4ba905634af275f2f4ec188626..72325a0fe484f505febe8a2d81f90f1d18cba54c 100644 (file)
@@ -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;
         }
     }