Compare commits

..

5 commits

Author SHA1 Message Date
loma-one 31ca6165ee [pageheader] Improve visibility
Removed commented out code from your pull request
2023-10-03 10:51:42 +02:00
loma-one 3cd1a65f73 pageheader/pageheader.css aktualisiert 2023-09-23 18:28:54 +02:00
loma-one d0b12ae5fa Merge pull request '[Addon pageheader] Coloured box added' (#1) from loma-one-patch-1 into develop
Reviewed-on: loma-one/friendica-addons#1
2023-09-20 15:35:19 +02:00
loma-one 26dd4f0d71 Coloured box added 2023-09-20 15:32:18 +02:00
loma-one 8b8d58bd8c Coloured box added
Among other things, I use the page header to inform about current maintenance work or other upcoming work. The information should therefore be provided within an appropriate framework. With a little CSS, the page header gets a frame in green. The font was adjusted to an appropriate size.
2023-09-16 16:54:54 +02:00

View file

@ -990,12 +990,8 @@ function bluesky_fetch_feed(int $uid, string $feed)
$id = bluesky_process_post($entry->post, $uid, Item::PR_TAG, 0);
if (!empty($id)) {
$post = Post::selectFirst(['uri-id'], ['id' => $id]);
if (!empty($post['uri-id'])) {
$stored = Post\Category::storeFileByURIId($post['uri-id'], $uid, Post\Category::SUBCRIPTION, $feedname, $feedurl);
Logger::debug('Stored tag subscription for user', ['uri-id' => $post['uri-id'], 'uid' => $uid, 'name' => $feedname, 'url' => $feedurl, 'stored' => $stored]);
} else {
Logger::notice('Post not found', ['id' => $id, 'entry' => $entry]);
}
$stored = Post\Category::storeFileByURIId($post['uri-id'], $uid, Post\Category::SUBCRIPTION, $feedname, $feedurl);
Logger::debug('Stored tag subscription for user', ['uri-id' => $post['uri-id'], 'uid' => $uid, 'name' => $feedname, 'url' => $feedurl, 'stored' => $stored]);
}
if (!empty($entry->reason)) {
bluesky_process_reason($entry->reason, bluesky_get_uri($entry->post), $uid);
@ -1007,12 +1003,8 @@ function bluesky_process_post(stdClass $post, int $uid, int $post_reason, $level
{
$uri = bluesky_get_uri($post);
if ($id = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $uid])) {
return $id['id'];
}
if ($id = Post::selectFirst(['id'], ['extid' => $uri, 'uid' => $uid])) {
return $id['id'];
if ($id = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $uid]) || $id = Post::selectFirst(['id'], ['extid' => $uri, 'uid' => $uid])) {
return $id;
}
Logger::debug('Importing post', ['uid' => $uid, 'indexedAt' => $post->indexedAt, 'uri' => $post->uri, 'cid' => $post->cid, 'root' => $post->record->reply->root ?? '']);
@ -1100,7 +1092,7 @@ function bluesky_get_content(array $item, stdClass $record, string $uri, int $ui
function bluesky_get_text(stdClass $record): string
{
$text = $record->text ?? '';
$text = $record->text;
if (empty($record->facets)) {
return $text;
@ -1193,10 +1185,11 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level);
}
}
Item::insert($shared);
$id = Item::insert($shared);
$shared = Post::selectFirst(['uri-id'], ['id' => $id]);
}
}
if (!empty($shared['uri-id'])) {
if (!empty($shared)) {
$item['quote-uri-id'] = $shared['uri-id'];
}
break;
@ -1213,10 +1206,12 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le
$shared = bluesky_add_media($single, $shared, $fetch_uid, $level);
}
}
Item::insert($shared);
$id = Item::insert($shared);
$shared = Post::selectFirst(['uri-id'], ['id' => $id]);
}
}
if (!empty($shared['uri-id'])) {
if (!empty($shared)) {
$item['quote-uri-id'] = $shared['uri-id'];
}
@ -1336,12 +1331,7 @@ function bluesky_fetch_post(string $uri, int $uid): string
function bluesky_process_thread(stdClass $thread, int $uid, array $cdata, int $level): string
{
if (empty($thread->post)) {
Logger::info('Invalid post', ['post' => $thread, 'callstack' => System::callstack(10, 0, true)]);
return '';
}
$uri = bluesky_get_uri($thread->post);
$fetched_uri = bluesky_fetch_post($uri, $uid);
if (empty($fetched_uri)) {
Logger::debug('Process missing post', ['uri' => $uri]);