mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 13:43:42 +00:00
Merge pull request 'Bluesky: "block" now works / label names are now displayed' (#1558) from heluecht/friendica-addons:bluesky-block into 2024.09-rc
Reviewed-on: https://git.friendi.ca/friendica/friendica-addons/pulls/1558
This commit is contained in:
commit
5a9dafec70
1 changed files with 3 additions and 4 deletions
|
@ -278,14 +278,12 @@ function bluesky_block(array &$hook_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::debug('Check if contact is bluesky', ['data' => $hook_data]);
|
if ($hook_data['contact']['network'] != Protocol::BLUESKY) {
|
||||||
$contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'url' => $hook_data['url'], 'uid' => [0, $hook_data['uid']]]);
|
|
||||||
if (empty($contact)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$record = [
|
$record = [
|
||||||
'subject' => $contact['url'],
|
'subject' => $hook_data['contact']['url'],
|
||||||
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||||
'$type' => 'app.bsky.graph.block'
|
'$type' => 'app.bsky.graph.block'
|
||||||
];
|
];
|
||||||
|
@ -1297,6 +1295,7 @@ function bluesky_get_header(stdClass $post, string $uri, int $uid, int $fetch_ui
|
||||||
// When "ver" is set to "1" it was flagged by some automated process.
|
// When "ver" is set to "1" it was flagged by some automated process.
|
||||||
if (empty($label->ver)) {
|
if (empty($label->ver)) {
|
||||||
$item['sensitive'] = true;
|
$item['sensitive'] = true;
|
||||||
|
$item['content-warning'] = $label->val ?? '';
|
||||||
Logger::debug('Sensitive content', ['uri-id' => $item['uri-id'], 'label' => $label]);
|
Logger::debug('Sensitive content', ['uri-id' => $item['uri-id'], 'label' => $label]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue