kopia lustrzana https://github.com/nextcloud/social
type in database for Follow
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/82/head
rodzic
39ce6745e1
commit
8a2fd1842b
|
@ -77,6 +77,13 @@
|
|||
<primary>true</primary>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>type</name>
|
||||
<type>text</type>
|
||||
<length>31</length>
|
||||
<notnull>false</notnull>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>actor_id</name>
|
||||
<type>text</type>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<name>Social</name>
|
||||
<summary>🎉 Nextcloud becomes part of the federated social networks!</summary>
|
||||
<description><![CDATA[test]]></description>
|
||||
<version>0.0.53</version>
|
||||
<version>0.0.54</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="maxence@artificial-owl.com">Maxence Lange</author>
|
||||
<author mail="jus@bitgrid.net">Julius Härtl</author>
|
||||
|
|
|
@ -56,6 +56,7 @@ class FollowsRequest extends FollowsRequestBuilder {
|
|||
$qb = $this->getFollowsInsertSql();
|
||||
$qb->setValue('id', $qb->createNamedParameter($follow->getId()))
|
||||
->setValue('actor_id', $qb->createNamedParameter($follow->getActorId()))
|
||||
->setValue('type', $qb->createNamedParameter($follow->getType()))
|
||||
->setValue('object_id', $qb->createNamedParameter($follow->getObjectId()))
|
||||
->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId()));
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder {
|
|||
$qb = $this->dbConnection->getQueryBuilder();
|
||||
|
||||
/** @noinspection PhpMethodParametersCountMismatchInspection */
|
||||
$qb->select('f.id', 'f.actor_id', 'f.object_id', 'f.follow_id', 'f.creation')
|
||||
$qb->select('f.id', 'f.type', 'f.actor_id', 'f.object_id', 'f.follow_id', 'f.creation')
|
||||
->from(self::TABLE_SERVER_FOLLOWS, 'f');
|
||||
|
||||
$this->defaultSelectAlias = 'f';
|
||||
|
@ -128,10 +128,7 @@ class FollowsRequestBuilder extends CoreRequestBuilder {
|
|||
*/
|
||||
protected function parseFollowsSelectSql($data): Follow {
|
||||
$follow = new Follow();
|
||||
$follow->setId($data['id'])
|
||||
->setActorId($data['actor_id'])
|
||||
->setObjectId($data['object_id']);
|
||||
$follow->setFollowId($data['follow_id']);
|
||||
$follow->importFromDatabase($data);
|
||||
|
||||
try {
|
||||
$actor = $this->parseCacheActorsLeftJoin($data);
|
||||
|
|
|
@ -88,6 +88,16 @@ class Follow extends ACore implements JsonSerializable {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*/
|
||||
public function importFromDatabase(array $data) {
|
||||
parent::importFromDatabase($data);
|
||||
|
||||
$this->setFollowId($this->get('follow_id', $data, ''));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
{
|
||||
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
||||
"sensitive": "as:sensitive",
|
||||
"movedTo": {
|
||||
"@id": "as:movedTo",
|
||||
"@type": "@id"
|
||||
},
|
||||
"Hashtag": "as:Hashtag",
|
||||
"ostatus": "http://ostatus.org#",
|
||||
"atomUri": "ostatus:atomUri",
|
||||
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
|
||||
"conversation": "ostatus:conversation",
|
||||
"toot": "http://joinmastodon.org/ns#",
|
||||
"Emoji": "toot:Emoji",
|
||||
"focalPoint": {
|
||||
"@container": "@list",
|
||||
"@id": "toot:focalPoint"
|
||||
},
|
||||
"featured": {
|
||||
"@id": "toot:featured",
|
||||
"@type": "@id"
|
||||
},
|
||||
"schema": "http://schema.org#",
|
||||
"PropertyValue": "schema:PropertyValue",
|
||||
"value": "schema:value"
|
||||
}
|
||||
],
|
||||
"id": "https://mastodon.social/users/twospirit#delete",
|
||||
"type": "Delete",
|
||||
"actor": "https://mastodon.social/users/twospirit",
|
||||
"to": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"object": "https://mastodon.social/users/twospirit",
|
||||
"signature": {
|
||||
"type": "RsaSignature2017",
|
||||
"creator": "https://mastodon.social/users/twospirit#main-key",
|
||||
"created": "2018-11-26T14:33:30Z",
|
||||
"signatureValue": "e20O0AYwAGLgHyb/xD1fO+v7gnE8aONFR3iMb/4ULd+Qjz4fV1/ay0IRFdatWGRP4uG/XzjdW6hJTR69wjQUag9k0JOvHkOssUHIXkmBEsKZURyEVWrjT1+Dyx1ZFwsbhjSXCkvbz70mq+1JPx2zDK+fTsG8TPIKBpvj9LYmQbF3Z4n7wRRxibCCL8oGlrHlwWwABYkZKoruLYJya9a6eVvbCD1P5TO+M1CUdMHhqez8k3ll50ZsGRlHqnojR0V9AjMixuMNMx4qvcC+wwJb4QBorfPJDh843Pw4lybwbs5/bXwErxR+Infc61w/dkyw1MvZdPYD2dy+uOHdndRRdQ=="
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue