Merge remote-tracking branch 'upstream/develop' into move-delivery

This commit is contained in:
Michael 2022-12-30 21:40:09 +00:00
commit 4eceb2d26f
37 changed files with 712 additions and 132 deletions

View file

@ -624,7 +624,7 @@ class Contact
public static function getPublicAndUserContactID(int $cid, int $uid): array
{
// We have to use the legacy function as long as the post update hasn't finished
if (DI::config()->get('system', 'post_update_version') < 1427) {
if (DI::keyValue()->get('post_update_version') < 1427) {
return self::legacyGetPublicAndUserContactID($cid, $uid);
}
@ -2953,7 +2953,7 @@ class Contact
}
if (($network != '') && ($ret['network'] != $network)) {
Logger::notice('Expected network ' . $network . ' does not match actual network ' . $ret['network']);
$result['message'] = DI::l10n()->t('Expected network %s does not match actual network %s', $network, $ret['network']);
return $result;
}

View file

@ -2145,7 +2145,7 @@ class GServer
*/
private static function discoverFederation()
{
$last = DI::config()->get('poco', 'last_federation_discovery');
$last = DI::keyValue()->get('poco_last_federation_discovery');
if ($last) {
$next = $last + (24 * 60 * 60);
@ -2189,7 +2189,7 @@ class GServer
}
}
DI::config()->set('poco', 'last_federation_discovery', time());
DI::keyValue()->set('poco_last_federation_discovery', time());
}
/**

View file

@ -3016,6 +3016,8 @@ class Item
$item['hashtags'] = $tags['hashtags'];
$item['mentions'] = $tags['mentions'];
$item['body'] = preg_replace("#\s*\[attachment .*?].*?\[/attachment]\s*#ism", "\n", $item['body']);
if (!$is_preview) {
$item['body'] = Post\Media::removeFromEndOfBody($item['body'] ?? '');
}
@ -3065,8 +3067,6 @@ class Item
$attachments = Post\Media::splitAttachments($item['uri-id'], $shared_links, $item['has-media'] ?? false);
$item['body'] = self::replaceVisualAttachments($attachments, $item['body'] ?? '');
$item['body'] = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", "\n", $item['body']);
self::putInCache($item);
$item['body'] = $body;
$s = $item["rendered-html"];
@ -3166,7 +3166,7 @@ class Item
],
]);
}
/**
* Check if the body contains a link