add Type to cached actor

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/58/head
Maxence Lange 2018-11-27 15:55:24 -01:00
rodzic bd1e0ee244
commit bb06cc1063
4 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -268,6 +268,13 @@
<primary>true</primary>
</field>
<field>
<name>type</name>
<type>text</type>
<length>31</length>
<notnull>true</notnull>
</field>
<field>
<name>account</name>
<type>text</type>

Wyświetl plik

@ -113,6 +113,7 @@ class ActorsRequestBuilder extends CoreRequestBuilder {
$actor = new Person();
$actor->importFromDatabase($data);
$actor->setType('Person');
$actor->setInbox($actor->getId() . '/inbox')
->setOutbox($actor->getId() . '/outbox')
->setFollowers($actor->getId() . '/followers')

Wyświetl plik

@ -69,6 +69,7 @@ class CacheActorsRequest extends CacheActorsRequestBuilder {
$qb = $this->getCacheActorsInsertSql();
$qb->setValue('id', $qb->createNamedParameter($actor->getId()))
->setValue('account', $qb->createNamedParameter($actor->getAccount()))
->setValue('type', $qb->createNamedParameter($actor->getType()))
->setValue('local', $qb->createNamedParameter(($actor->isLocal()) ? '1' : '0'))
->setValue('following', $qb->createNamedParameter($actor->getFollowing()))
->setValue('followers', $qb->createNamedParameter($actor->getFollowers()))

Wyświetl plik

@ -78,7 +78,7 @@ class CacheActorsRequestBuilder extends CoreRequestBuilder {
/** @noinspection PhpMethodParametersCountMismatchInspection */
$qb->select(
'ca.id', 'ca.account', 'ca.following', 'ca.followers', 'ca.inbox',
'ca.shared_inbox', 'ca.outbox', 'ca.featured', 'ca.url',
'ca.shared_inbox', 'ca.outbox', 'ca.featured', 'ca.url', 'ca.type',
'ca.preferred_username', 'ca.name', 'ca.summary',
'ca.public_key', 'ca.local', 'ca.source', 'ca.creation'
)