-- ------------------------------------------
-- Friendica 2024.09-dev (Yellow Archangel)
--- DB_UPDATE_VERSION 1571
+-- DB_UPDATE_VERSION 1572
-- ------------------------------------------
`manually-approve` boolean COMMENT '',
`discoverable` boolean COMMENT 'Mastodon extension: true if profile is published in their directory',
`suspended` boolean COMMENT 'Mastodon extension: true if profile is suspended',
+ `posting-restricted` boolean COMMENT 'lemmy:postingRestrictedToMods',
`nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
`name` varchar(255) COMMENT '',
`about` text COMMENT '',
`apcontact`.`outbox` AS `ap-outbox`,
`apcontact`.`sharedinbox` AS `ap-sharedinbox`,
`apcontact`.`generator` AS `ap-generator`,
+ `apcontact`.`posting-restricted` AS `ap-posting-restricted`,
`apcontact`.`following_count` AS `ap-following_count`,
`apcontact`.`followers_count` AS `ap-followers_count`,
`apcontact`.`statuses_count` AS `ap-statuses_count`,
`apcontact`.`outbox` AS `ap-outbox`,
`apcontact`.`sharedinbox` AS `ap-sharedinbox`,
`apcontact`.`generator` AS `ap-generator`,
+ `apcontact`.`posting-restricted` AS `ap-posting-restricted`,
`apcontact`.`following_count` AS `ap-following_count`,
`apcontact`.`followers_count` AS `ap-followers_count`,
`apcontact`.`statuses_count` AS `ap-statuses_count`,
Fields
------
-| Field | Description | Type | Null | Key | Default | Extra |
-| ---------------- | ------------------------------------------------------------------- | -------------- | ---- | --- | ------------------- | ----- |
-| url | URL of the contact | varbinary(383) | NO | PRI | NULL | |
-| uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
-| uuid | | varbinary(255) | YES | | NULL | |
-| type | | varchar(20) | NO | | NULL | |
-| following | | varbinary(383) | YES | | NULL | |
-| followers | | varbinary(383) | YES | | NULL | |
-| inbox | | varbinary(383) | NO | | NULL | |
-| outbox | | varbinary(383) | YES | | NULL | |
-| sharedinbox | | varbinary(383) | YES | | NULL | |
-| featured | Address for the collection of featured posts | varbinary(383) | YES | | NULL | |
-| featured-tags | Address for the collection of featured tags | varbinary(383) | YES | | NULL | |
-| manually-approve | | boolean | YES | | NULL | |
-| discoverable | Mastodon extension: true if profile is published in their directory | boolean | YES | | NULL | |
-| suspended | Mastodon extension: true if profile is suspended | boolean | YES | | NULL | |
-| nick | | varchar(255) | NO | | | |
-| name | | varchar(255) | YES | | NULL | |
-| about | | text | YES | | NULL | |
-| xmpp | XMPP address | varchar(255) | YES | | NULL | |
-| matrix | Matrix address | varchar(255) | YES | | NULL | |
-| photo | | varbinary(383) | YES | | NULL | |
-| header | Header picture | varbinary(383) | YES | | NULL | |
-| addr | | varchar(255) | YES | | NULL | |
-| alias | | varbinary(383) | YES | | NULL | |
-| pubkey | | text | YES | | NULL | |
-| subscribe | | varbinary(383) | YES | | NULL | |
-| baseurl | baseurl of the ap contact | varbinary(383) | YES | | NULL | |
-| gsid | Global Server ID | int unsigned | YES | | NULL | |
-| generator | Name of the contact's system | varchar(255) | YES | | NULL | |
-| following_count | Number of following contacts | int unsigned | YES | | 0 | |
-| followers_count | Number of followers | int unsigned | YES | | 0 | |
-| statuses_count | Number of posts | int unsigned | YES | | 0 | |
-| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
+| Field | Description | Type | Null | Key | Default | Extra |
+| ------------------ | ------------------------------------------------------------------- | -------------- | ---- | --- | ------------------- | ----- |
+| url | URL of the contact | varbinary(383) | NO | PRI | NULL | |
+| uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
+| uuid | | varbinary(255) | YES | | NULL | |
+| type | | varchar(20) | NO | | NULL | |
+| following | | varbinary(383) | YES | | NULL | |
+| followers | | varbinary(383) | YES | | NULL | |
+| inbox | | varbinary(383) | NO | | NULL | |
+| outbox | | varbinary(383) | YES | | NULL | |
+| sharedinbox | | varbinary(383) | YES | | NULL | |
+| featured | Address for the collection of featured posts | varbinary(383) | YES | | NULL | |
+| featured-tags | Address for the collection of featured tags | varbinary(383) | YES | | NULL | |
+| manually-approve | | boolean | YES | | NULL | |
+| discoverable | Mastodon extension: true if profile is published in their directory | boolean | YES | | NULL | |
+| suspended | Mastodon extension: true if profile is suspended | boolean | YES | | NULL | |
+| posting-restricted | lemmy:postingRestrictedToMods | boolean | YES | | NULL | |
+| nick | | varchar(255) | NO | | | |
+| name | | varchar(255) | YES | | NULL | |
+| about | | text | YES | | NULL | |
+| xmpp | XMPP address | varchar(255) | YES | | NULL | |
+| matrix | Matrix address | varchar(255) | YES | | NULL | |
+| photo | | varbinary(383) | YES | | NULL | |
+| header | Header picture | varbinary(383) | YES | | NULL | |
+| addr | | varchar(255) | YES | | NULL | |
+| alias | | varbinary(383) | YES | | NULL | |
+| pubkey | | text | YES | | NULL | |
+| subscribe | | varbinary(383) | YES | | NULL | |
+| baseurl | baseurl of the ap contact | varbinary(383) | YES | | NULL | |
+| gsid | Global Server ID | int unsigned | YES | | NULL | |
+| generator | Name of the contact's system | varchar(255) | YES | | NULL | |
+| following_count | Number of following contacts | int unsigned | YES | | 0 | |
+| followers_count | Number of followers | int unsigned | YES | | 0 | |
+| statuses_count | Number of posts | int unsigned | YES | | 0 | |
+| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
Indexes
------------
return $fetched_contact;
}
+ if (!empty($compacted['https://webfinger.net/#'])) {
+ $apcontact['addr'] = JsonLD::fetchElement($compacted, 'https://webfinger.net/#');
+ }
+
if (empty($apcontact['addr']) && ($apcontact['type'] != 'Tombstone')) {
try {
$apcontact['addr'] = $apcontact['nick'] . '@' . (new Uri($apcontact['url']))->getAuthority();
}
$apcontact['manually-approve'] = (int)JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');
-
+ $apcontact['posting-restricted'] = (int)JsonLD::fetchElement($compacted, 'lemmy:postingRestrictedToMods');
$apcontact['suspended'] = (int)JsonLD::fetchElement($compacted, 'toot:suspended');
if (!empty($compacted['as:generator'])) {
}
}
+ $author = Contact::selectFirstAccount(['ap-posting-restricted'], ['id' => $item['author-id']]);
+ if (!empty($author['ap-posting-restricted'])) {
+ $item['restrictions'] = $item['restrictions'] | Item::CANT_REPLY;
+ }
+
$item['location'] = $activity['location'];
if (!empty($activity['latitude']) && !empty($activity['longitude'])) {
* @param boolean $trust_source Do we trust the source?
* @param boolean $push Message had been pushed to our system
* @param array $signer The signer of the post
+ * @param string $http_signer
+ * @param int $completion
*
* @return bool
*
'fedibird' => (object)['@id' => 'http://fedibird.com/ns#', '@type' => '@id'],
'misskey' => (object)['@id' => 'https://misskey-hub.net/ns#', '@type' => '@id'],
'pixelfed' => (object)['@id' => 'http://pixelfed.org/ns#', '@type' => '@id'],
+ 'lemmy' => (object)['@id' => 'https://join-lemmy.org/ns#', '@type' => '@id'],
];
$orig_json = $json;
// This file is required several times during the test in DbaDefinition which justifies this condition
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1571);
+ define('DB_UPDATE_VERSION', 1572);
}
return [
"manually-approve" => ["type" => "boolean", "comment" => ""],
"discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
"suspended" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is suspended"],
+ "posting-restricted" => ["type" => "boolean", "comment" => "lemmy:postingRestrictedToMods"],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"name" => ["type" => "varchar(255)", "comment" => ""],
"about" => ["type" => "text", "comment" => ""],
"ap-outbox" => ["apcontact", "outbox"],
"ap-sharedinbox" => ["apcontact", "sharedinbox"],
"ap-generator" => ["apcontact", "generator"],
+ "ap-posting-restricted" => ["apcontact", "posting-restricted"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],
"ap-outbox" => ["apcontact", "outbox"],
"ap-sharedinbox" => ["apcontact", "sharedinbox"],
"ap-generator" => ["apcontact", "generator"],
+ "ap-posting-restricted" => ["apcontact", "posting-restricted"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],