kopia lustrzana https://github.com/nextcloud/social
source in other objects
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/32/head
rodzic
d31dcf4e87
commit
86e0853ff5
|
|
@ -80,7 +80,7 @@ class CacheActorsRequestBuilder extends CoreRequestBuilder {
|
||||||
'ca.id', 'ca.account', 'ca.following', 'ca.followers', 'ca.inbox',
|
'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.preferred_username', 'ca.name', 'ca.summary',
|
'ca.preferred_username', 'ca.name', 'ca.summary',
|
||||||
'ca.public_key', 'ca.local', 'ca.creation'
|
'ca.public_key', 'ca.local', 'ca.source', 'ca.creation'
|
||||||
)
|
)
|
||||||
->from(self::TABLE_CACHE_ACTORS, 'ca');
|
->from(self::TABLE_CACHE_ACTORS, 'ca');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,8 @@ class CoreRequestBuilder {
|
||||||
// TODO: Pagination should use published date, once we can properly query the db for that
|
// TODO: Pagination should use published date, once we can properly query the db for that
|
||||||
$qb->andWhere(
|
$qb->andWhere(
|
||||||
$expr->lt(
|
$expr->lt(
|
||||||
$this->defaultSelectAlias . '.creation', $qb->createNamedParameter($dt, IQueryBuilder::PARAM_DATE),
|
$this->defaultSelectAlias . '.creation',
|
||||||
|
$qb->createNamedParameter($dt, IQueryBuilder::PARAM_DATE),
|
||||||
IQueryBuilder::PARAM_DATE
|
IQueryBuilder::PARAM_DATE
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -248,7 +249,7 @@ class CoreRequestBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param IQueryBuilder $qb
|
* @param IQueryBuilder $qb
|
||||||
* @param string $field"
|
* @param string $field
|
||||||
* @param string|integer|array $values
|
* @param string|integer|array $values
|
||||||
*/
|
*/
|
||||||
private function limitToDBField(IQueryBuilder &$qb, $field, $values) {
|
private function limitToDBField(IQueryBuilder &$qb, $field, $values) {
|
||||||
|
|
@ -309,6 +310,7 @@ class CoreRequestBuilder {
|
||||||
->selectAlias('ca.name', 'cacheactor_name')
|
->selectAlias('ca.name', 'cacheactor_name')
|
||||||
->selectAlias('ca.summary', 'cacheactor_summary')
|
->selectAlias('ca.summary', 'cacheactor_summary')
|
||||||
->selectAlias('ca.public_key', 'cacheactor_public_key')
|
->selectAlias('ca.public_key', 'cacheactor_public_key')
|
||||||
|
->selectAlias('ca.source', 'cacheactor_source')
|
||||||
->selectAlias('ca.creation', 'cacheactor_creation')
|
->selectAlias('ca.creation', 'cacheactor_creation')
|
||||||
->leftJoin(
|
->leftJoin(
|
||||||
$this->defaultSelectAlias, CoreRequestBuilder::TABLE_CACHE_ACTORS, 'ca',
|
$this->defaultSelectAlias, CoreRequestBuilder::TABLE_CACHE_ACTORS, 'ca',
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ class NotesRequest extends NotesRequestBuilder {
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function save(Note $note): int {
|
public function save(Note $note): int {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$qb = $this->getNotesInsertSql();
|
$qb = $this->getNotesInsertSql();
|
||||||
$qb->setValue('id', $qb->createNamedParameter($note->getId()))
|
$qb->setValue('id', $qb->createNamedParameter($note->getId()))
|
||||||
|
|
@ -88,7 +87,11 @@ class NotesRequest extends NotesRequestBuilder {
|
||||||
->setValue('published', $qb->createNamedParameter($note->getPublished()))
|
->setValue('published', $qb->createNamedParameter($note->getPublished()))
|
||||||
->setValue('attributed_to', $qb->createNamedParameter($note->getAttributedTo()))
|
->setValue('attributed_to', $qb->createNamedParameter($note->getAttributedTo()))
|
||||||
->setValue('in_reply_to', $qb->createNamedParameter($note->getInReplyTo()))
|
->setValue('in_reply_to', $qb->createNamedParameter($note->getInReplyTo()))
|
||||||
->setValue('creation', $qb->createNamedParameter(new \DateTime('now'), IQueryBuilder::PARAM_DATE));
|
->setValue('source', $qb->createNamedParameter($note->getSource()))
|
||||||
|
->setValue(
|
||||||
|
'creation',
|
||||||
|
$qb->createNamedParameter(new \DateTime('now'), IQueryBuilder::PARAM_DATE)
|
||||||
|
);
|
||||||
$qb->execute();
|
$qb->execute();
|
||||||
|
|
||||||
return $qb->getLastInsertId();
|
return $qb->getLastInsertId();
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ class NotesRequestBuilder extends CoreRequestBuilder {
|
||||||
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
||||||
$qb->select(
|
$qb->select(
|
||||||
'sn.id', 'sn.to', 'sn.to_array', 'sn.cc', 'sn.bcc', 'sn.content', 'sn.summary',
|
'sn.id', 'sn.to', 'sn.to_array', 'sn.cc', 'sn.bcc', 'sn.content', 'sn.summary',
|
||||||
'sn.published', 'sn.attributed_to', 'sn.in_reply_to', 'sn.creation'
|
'sn.published', 'sn.attributed_to', 'sn.in_reply_to', 'sn.source', 'sn.creation'
|
||||||
)
|
)
|
||||||
->from(self::TABLE_SERVER_NOTES, 'sn');
|
->from(self::TABLE_SERVER_NOTES, 'sn');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ class ImportService {
|
||||||
}
|
}
|
||||||
|
|
||||||
$item->import($data);
|
$item->import($data);
|
||||||
|
$item->setSource(json_encode($data, JSON_UNESCAPED_SLASHES));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$object = $this->createItem($this->getArray('object', $data, []), $item);
|
$object = $this->createItem($this->getArray('object', $data, []), $item);
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue