Add blocking author from an item context feature

This commit is contained in:
Hypolite Petovan 2021-01-20 18:44:02 -05:00
parent d5e87011c9
commit 6b0df74ed7
3 changed files with 81 additions and 42 deletions

View file

@ -248,6 +248,7 @@ class Page implements ArrayAccess
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
'$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon,

View file

@ -230,6 +230,7 @@ class Post
}
$drop = false;
$block = false;
if (local_user()) {
$drop = [
'dropping' => $dropping,
@ -237,6 +238,11 @@ class Post
'select' => DI::l10n()->t('Select'),
'delete' => $delete,
];
$block = [
'blocking' => true,
'block' => DI::l10n()->t('Block %s', $item['author-name']),
'author_id' => $item['author-id'],
];
}
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? DI::l10n()->t("save to folder") : false);
@ -485,6 +491,7 @@ class Post
'filer' => $filer,
'language' => $languages,
'drop' => $drop,
'block' => $block,
'vote' => $buttons,
'like_html' => $responses['like']['output'],
'dislike_html' => $responses['dislike']['output'],