We should assume all verbs and such are their full URIs in our db

This commit is contained in:
Mikael Nordfeldth 2016-03-29 12:57:52 +02:00
parent cb212ba41c
commit 2f91cb0df7
2 changed files with 4 additions and 6 deletions

View File

@ -841,10 +841,8 @@ class Profile extends Managed_DataObject
$notices = new Notice(); $notices = new Notice();
$notices->profile_id = $this->getID(); $notices->profile_id = $this->getID();
$notices->whereAddIn('verb', $notices->verb = ActivityVerb::POST;
[ActivityUtils::resolveUri(ActivityVerb::POST, true), ActivityVerb::POST], $cnt = (int) $notices->count('id'); // Not sure if I imagine this, but 'id' was faster than the defaulting 'uri'?
$notices->columnType('verb'));
$cnt = (int) $notices->count(); // we don't have to provide anything as Notice is key'd
if (!empty($c)) { if (!empty($c)) {
$c->set(Cache::key('profile:notice_count:'.$this->getID()), $cnt); $c->set(Cache::key('profile:notice_count:'.$this->getID()), $cnt);

View File

@ -48,9 +48,9 @@ abstract class NoticeStream
public function __construct() public function __construct()
{ {
foreach ($this->selectVerbs as $key=>$val) { 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)] = $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;
} }
} }