Channel visibility rules can now be set for each contact

This commit is contained in:
Michael 2023-09-12 10:55:33 +00:00
parent c6c4d93b3b
commit 229e7dcee5
10 changed files with 308 additions and 112 deletions

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 2023.09-dev (Giant Rhubarb) -- Friendica 2023.09-dev (Giant Rhubarb)
-- DB_UPDATE_VERSION 1532 -- DB_UPDATE_VERSION 1533
-- ------------------------------------------ -- ------------------------------------------
@ -1866,6 +1866,7 @@ CREATE TABLE IF NOT EXISTS `user-contact` (
`collapsed` boolean COMMENT 'Posts from this contact are collapsed', `collapsed` boolean COMMENT 'Posts from this contact are collapsed',
`hidden` boolean COMMENT 'This contact is hidden from the others', `hidden` boolean COMMENT 'This contact is hidden from the others',
`is-blocked` boolean COMMENT 'User is blocked by this contact', `is-blocked` boolean COMMENT 'User is blocked by this contact',
`channel-visibility` tinyint unsigned COMMENT 'Controls the visibility in channels',
`pending` boolean COMMENT '', `pending` boolean COMMENT '',
`rel` tinyint unsigned COMMENT 'The kind of the relation between the user and the contact', `rel` tinyint unsigned COMMENT 'The kind of the relation between the user and the contact',
`info` mediumtext COMMENT '', `info` mediumtext COMMENT '',

View file

@ -16,6 +16,7 @@ Fields
| collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | | | collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | |
| hidden | This contact is hidden from the others | boolean | YES | | NULL | | | hidden | This contact is hidden from the others | boolean | YES | | NULL | |
| is-blocked | User is blocked by this contact | boolean | YES | | NULL | | | is-blocked | User is blocked by this contact | boolean | YES | | NULL | |
| channel-visibility | Controls the visibility in channels | tinyint unsigned | YES | | NULL | |
| pending | | boolean | YES | | NULL | | | pending | | boolean | YES | | NULL | |
| rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | NULL | | | rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | NULL | |
| info | | mediumtext | YES | | NULL | | | info | | mediumtext | YES | | NULL | |

View file

@ -37,6 +37,10 @@ use PDOException;
*/ */
class User class User
{ {
const VISIBILITY_DEFAULT = 0;
const VISIBILITY_NEVER = 1;
const VISIBILITY_ALWAYS = 2;
const VISIBILITY_REDUCED = 3;
/** /**
* Insert a user-contact for a given contact array * Insert a user-contact for a given contact array
* *
@ -314,6 +318,53 @@ class User
return $collapsed; return $collapsed;
} }
/**
* Set the channel visibility for contact id and user id
*
* @param int $cid Either public contact id or user's contact id
* @param int $uid User ID
* @param int $visibility Set type of visibility
* @return void
* @throws \Exception
*/
public static function setChannelVisibility(int $cid, int $uid, int $visibility)
{
$cdata = Contact::getPublicAndUserContactID($cid, $uid);
if (empty($cdata)) {
return;
}
DBA::update('user-contact', ['channel-visibility' => $visibility], ['cid' => $cdata['public'], 'uid' => $uid], true);
}
/**
* Returns the channel visibility state for contact id and user id
*
* @param int $cid Either public contact id or user's contact id
* @param int $uid User ID
* @return int the type of visibility in channels
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function getChannelVisibility(int $cid, int $uid): int
{
$cdata = Contact::getPublicAndUserContactID($cid, $uid);
if (empty($cdata)) {
return false;
}
$visibility = self::VISIBILITY_DEFAULT;
if (!empty($cdata['public'])) {
$public_contact = DBA::selectFirst('user-contact', ['channel-visibility'], ['cid' => $cdata['public'], 'uid' => $uid]);
if (DBA::isResult($public_contact)) {
$visibility = $public_contact['channel-visibility'] ?? self::VISIBILITY_DEFAULT;
}
}
return $visibility;
}
/** /**
* Set/Release that the user is blocked by the contact * Set/Release that the user is blocked by the contact
* *

View file

@ -132,6 +132,10 @@ class Profile extends BaseModule
$fields['info'] = $_POST['info']; $fields['info'] = $_POST['info'];
} }
if (isset($_POST['channel_visibility'])) {
Contact\User::setChannelVisibility($cdata['user'], $this->session->getLocalUserId(), $_POST['channel_visibility']);
}
if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => $this->session->getLocalUserId()])) { if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => $this->session->getLocalUserId()])) {
$this->systemMessages->addNotice($this->t('Failed to update contact record.')); $this->systemMessages->addNotice($this->t('Failed to update contact record.'));
} }
@ -336,6 +340,21 @@ class Profile extends BaseModule
]; ];
} }
if (in_array($contact['network'], Protocol::FEDERATED)) {
$channel_settings_label = $this->t('Channel Settings');
$channel_visibility = Contact\User::getChannelVisibility($contact['id'], $this->session->getLocalUserId());
$channel_visibilities = [
Contact\User::VISIBILITY_DEFAULT => $this->t('Default visibility'),
Contact\User::VISIBILITY_ALWAYS => $this->t('Display all posts of this contact'),
Contact\User::VISIBILITY_REDUCED => $this->t('Display only few posts'),
Contact\User::VISIBILITY_NEVER => $this->t('Never display posts from this contact'),
];
} else {
$channel_settings_label = null;
$channel_visibility = null;
$channel_visibilities = null;
}
$poll_interval = null; $poll_interval = null;
if ((($contact['network'] == Protocol::FEED) && !$this->config->get('system', 'adjust_poll_frequency')) || ($contact['network'] == Protocol::MAIL)) { if ((($contact['network'] == Protocol::FEED) && !$this->config->get('system', 'adjust_poll_frequency')) || ($contact['network'] == Protocol::MAIL)) {
$poll_interval = ContactSelector::pollInterval($localRelationship->priority, !$poll_enabled); $poll_interval = ContactSelector::pollInterval($localRelationship->priority, !$poll_enabled);
@ -419,6 +438,14 @@ class Profile extends BaseModule
$this->t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), $this->t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
$remote_self_options $remote_self_options
], ],
'$channel_settings_label' => $channel_settings_label,
'$channel_visibility' => [
'channel_visibility',
$this->t('Visibility of this contact in appropriate channels'),
$channel_visibility,
$this->t('Depending on the type of the channel not all posts from contacts are displayed by default. They for example need to have a certain amount of comments to be displayed. On the other hand there can be contacts who flood the channel, so you might want to see only some of their posts. Or you don\'t want to see their content at all, but you don\'t want to block or hide the contact completely.'),
$channel_visibilities
],
]); ]);
$arr = ['contact' => $contact, 'output' => $o]; $arr = ['contact' => $contact, 'output' => $o];

View file

@ -188,14 +188,64 @@ class Timeline extends BaseModule
* @throws \Exception * @throws \Exception
*/ */
protected function getChannelItems() protected function getChannelItems()
{
$items = $this->getRawChannelItems();
$contacts = $this->database->selectToArray('user-contact', ['cid'], ['channel-visibility' => Contact\User::VISIBILITY_REDUCED, 'cid' => array_column($items, 'owner-id')]);
$reduced = array_column($contacts, 'cid');
$maxpostperauthor = $this->config->get('channel', 'max_posts_per_author');
if ($maxpostperauthor != 0) {
$count = 1;
$numposts = [];
$selected_items = [];
while (count($selected_items) < $this->itemsPerPage && ++$count < 50 && count($items) > 0) {
foreach ($items as $item) {
if (!in_array($item['owner-id'], $reduced) || (($numposts[$item['owner-id']]++ < $maxpostperauthor)) && (count($selected_items) < $this->itemsPerPage)) {
$selected_items[] = $item;
}
}
// If we're looking at a "previous page", the lookup continues forward in time because the list is
// sorted in chronologically decreasing order
if (isset($this->minId)) {
$this->minId = $items[0]['created'];
} else {
// In any other case, the lookup continues backwards in time
$this->maxId = $items[count($items) - 1]['created'];
}
if (count($selected_items) < $this->itemsPerPage) {
$items = $this->getRawChannelItems();
}
}
} else {
$selected_items = $items;
}
$condition = ['unseen' => true, 'uid' => $this->session->getLocalUserId(), 'parent-uri-id' => array_column($selected_items, 'uri-id')];
$this->setItemsSeenByCondition($condition);
return $selected_items;
}
/**
* Database query for the channel page
*
* @return array
* @throws \Exception
*/
private function getRawChannelItems()
{ {
$uid = $this->session->getLocalUserId(); $uid = $this->session->getLocalUserId();
if ($this->selectedTab == TimelineEntity::WHATSHOT) { if ($this->selectedTab == TimelineEntity::WHATSHOT) {
if (!is_null($this->accountType)) { if (!is_null($this->accountType)) {
$condition = ["(`comments` >= ? OR `activities` >= ?) AND `contact-type` = ?", $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), $this->accountType]; $condition = ["(`comments` > ? OR `activities` > ?) AND `contact-type` = ?", $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), $this->accountType];
} else { } else {
$condition = ["(`comments` >= ? OR `activities` >= ?) AND `contact-type` != ?", $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), Contact::TYPE_COMMUNITY]; $condition = ["(`comments` > ? OR `activities` > ?) AND `contact-type` != ?", $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), Contact::TYPE_COMMUNITY];
} }
} elseif ($this->selectedTab == TimelineEntity::FORYOU) { } elseif ($this->selectedTab == TimelineEntity::FORYOU) {
$cid = Contact::getPublicIdByUserId($uid); $cid = Contact::getPublicIdByUserId($uid);
@ -203,9 +253,9 @@ class Timeline extends BaseModule
$condition = [ $condition = [
"(`owner-id` IN (SELECT `cid` FROM `contact-relation` WHERE `relation-cid` = ? AND `relation-thread-score` > ?) OR "(`owner-id` IN (SELECT `cid` FROM `contact-relation` WHERE `relation-cid` = ? AND `relation-thread-score` > ?) OR
((`comments` >= ? OR `activities` >= ?) AND `owner-id` IN (SELECT `cid` FROM `contact-relation` WHERE `follows` AND `relation-cid` = ?)) OR ((`comments` >= ? OR `activities` >= ?) AND `owner-id` IN (SELECT `cid` FROM `contact-relation` WHERE `follows` AND `relation-cid` = ?)) OR
(`owner-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` IN (?, ?) AND `notify_new_posts`)))", (`owner-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND (`notify_new_posts` OR `channel-visibility` = ?))))",
$cid, $this->getMedianRelationThreadScore($cid, 4), $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), $cid, $cid, $this->getMedianRelationThreadScore($cid, 4), $this->getMedianComments($uid, 4), $this->getMedianActivities($uid, 4), $cid,
$uid, Contact::FRIEND, Contact::SHARING $uid, Contact\User::VISIBILITY_ALWAYS
]; ];
} elseif ($this->selectedTab == TimelineEntity::FOLLOWERS) { } elseif ($this->selectedTab == TimelineEntity::FOLLOWERS) {
$condition = ["`owner-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` = ?)", $uid, Contact::FOLLOWER]; $condition = ["`owner-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` = ?)", $uid, Contact::FOLLOWER];
@ -233,7 +283,7 @@ class Timeline extends BaseModule
$condition = $this->addLanguageCondition($uid, $condition); $condition = $this->addLanguageCondition($uid, $condition);
} }
$condition = DBA::mergeConditions($condition, ["NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `cid` = `post-engagement`.`owner-id` AND (`ignored` OR `blocked` OR `collapsed`))", $uid]); $condition = DBA::mergeConditions($condition, ["NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `cid` = `post-engagement`.`owner-id` AND (`ignored` OR `blocked` OR `collapsed` OR `is-blocked` OR `channel-visibility` = ?))", $uid, Contact\User::VISIBILITY_NEVER]);
if (($this->selectedTab != TimelineEntity::WHATSHOT) && !is_null($this->accountType)) { if (($this->selectedTab != TimelineEntity::WHATSHOT) && !is_null($this->accountType)) {
$condition = DBA::mergeConditions($condition, ['contact-type' => $this->accountType]); $condition = DBA::mergeConditions($condition, ['contact-type' => $this->accountType]);
@ -262,7 +312,7 @@ class Timeline extends BaseModule
} }
} }
$items = $this->database->selectToArray('post-engagement', ['uri-id', 'created'], $condition, $params); $items = $this->database->selectToArray('post-engagement', ['uri-id', 'created', 'owner-id'], $condition, $params);
if (empty($items)) { if (empty($items)) {
return []; return [];
} }

View file

@ -56,7 +56,7 @@ use Friendica\Database\DBA;
// This file is required several times during the test in DbaDefinition which justifies this condition // This file is required several times during the test in DbaDefinition which justifies this condition
if (!defined('DB_UPDATE_VERSION')) { if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1532); define('DB_UPDATE_VERSION', 1533);
} }
return [ return [
@ -1857,6 +1857,7 @@ return [
"collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"], "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
"hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"], "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
"is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"], "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
"channel-visibility" => ["type" => "tinyint unsigned", "comment" => "Controls the visibility in channels"],
"pending" => ["type" => "boolean", "comment" => ""], "pending" => ["type" => "boolean", "comment" => ""],
"rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"], "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
"info" => ["type" => "mediumtext", "comment" => ""], "info" => ["type" => "mediumtext", "comment" => ""],

View file

@ -805,6 +805,10 @@ return [
// Number of days that are used to calculate the interaction score. // Number of days that are used to calculate the interaction score.
'interaction_score_days' => 30, 'interaction_score_days' => 30,
// max_posts_per_author (Integer)
// Maixmum number of posts per page by author
'max_posts_per_author' => 2,
// sharer_interaction_days (Integer) // sharer_interaction_days (Integer)
// Number of days of the last interaction that are used to define which sharers are used for the "sharers of sharers" channel. // Number of days of the last interaction that are used to define which sharers are used for the "sharers of sharers" channel.
'sharer_interaction_days' => 90, 'sharer_interaction_days' => 90,

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2023.09-dev\n" "Project-Id-Version: 2023.09-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-10 07:51+0000\n" "POT-Creation-Date: 2023-09-12 10:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -302,7 +302,7 @@ msgstr ""
#: mod/photos.php:824 mod/photos.php:1101 mod/photos.php:1142 #: mod/photos.php:824 mod/photos.php:1101 mod/photos.php:1142
#: mod/photos.php:1198 mod/photos.php:1278 #: mod/photos.php:1198 mod/photos.php:1278
#: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132
#: src/Module/Contact/Profile.php:358 #: src/Module/Contact/Profile.php:377
#: src/Module/Debug/ActivityPubConversion.php:140 #: src/Module/Debug/ActivityPubConversion.php:140
#: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64 #: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64
#: src/Module/Debug/Probe.php:54 src/Module/Debug/WebFinger.php:51 #: src/Module/Debug/Probe.php:54 src/Module/Debug/WebFinger.php:51
@ -606,7 +606,7 @@ msgid "This is you"
msgstr "" msgstr ""
#: mod/photos.php:1141 mod/photos.php:1197 mod/photos.php:1277 #: mod/photos.php:1141 mod/photos.php:1197 mod/photos.php:1277
#: src/Module/Moderation/Reports.php:96 src/Object/Post.php:572 #: src/Module/Moderation/Reports.php:95 src/Object/Post.php:572
#: src/Object/Post.php:1094 #: src/Object/Post.php:1094
msgid "Comment" msgid "Comment"
msgstr "" msgstr ""
@ -661,7 +661,7 @@ msgstr ""
msgid "No system theme config value set." msgid "No system theme config value set."
msgstr "" msgstr ""
#: src/App.php:577 #: src/App.php:580
msgid "Apologies but the website is unavailable at the moment." msgid "Apologies but the website is unavailable at the moment."
msgstr "" msgstr ""
@ -1813,7 +1813,7 @@ msgid "Send PM"
msgstr "" msgstr ""
#: src/Content/Item.php:435 src/Module/Contact.php:468 #: src/Content/Item.php:435 src/Module/Contact.php:468
#: src/Module/Contact/Profile.php:498 #: src/Module/Contact/Profile.php:525
#: src/Module/Moderation/Blocklist/Contact.php:116 #: src/Module/Moderation/Blocklist/Contact.php:116
#: src/Module/Moderation/Users/Active.php:137 #: src/Module/Moderation/Users/Active.php:137
#: src/Module/Moderation/Users/Index.php:152 #: src/Module/Moderation/Users/Index.php:152
@ -1821,7 +1821,7 @@ msgid "Block"
msgstr "" msgstr ""
#: src/Content/Item.php:436 src/Module/Contact.php:469 #: src/Content/Item.php:436 src/Module/Contact.php:469
#: src/Module/Contact/Profile.php:506 #: src/Module/Contact/Profile.php:533
#: src/Module/Notifications/Introductions.php:134 #: src/Module/Notifications/Introductions.php:134
#: src/Module/Notifications/Introductions.php:206 #: src/Module/Notifications/Introductions.php:206
#: src/Module/Notifications/Notification.php:89 #: src/Module/Notifications/Notification.php:89
@ -1829,7 +1829,7 @@ msgid "Ignore"
msgstr "" msgstr ""
#: src/Content/Item.php:437 src/Module/Contact.php:470 #: src/Content/Item.php:437 src/Module/Contact.php:470
#: src/Module/Contact/Profile.php:514 #: src/Module/Contact/Profile.php:541
msgid "Collapse" msgid "Collapse"
msgstr "" msgstr ""
@ -1896,7 +1896,7 @@ msgstr ""
#: src/Content/Nav.php:230 src/Module/BaseProfile.php:49 #: src/Content/Nav.php:230 src/Module/BaseProfile.php:49
#: src/Module/BaseSettings.php:98 src/Module/Contact.php:504 #: src/Module/BaseSettings.php:98 src/Module/Contact.php:504
#: src/Module/Contact/Profile.php:413 src/Module/Profile/Profile.php:268 #: src/Module/Contact/Profile.php:432 src/Module/Profile/Profile.php:268
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:230 #: src/Module/Welcome.php:57 view/theme/frio/theme.php:230
msgid "Profile" msgid "Profile"
msgstr "" msgstr ""
@ -2126,7 +2126,7 @@ msgstr ""
#: src/Module/Moderation/Blocklist/Server/Import.php:118 #: src/Module/Moderation/Blocklist/Server/Import.php:118
#: src/Module/Moderation/Blocklist/Server/Index.php:95 #: src/Module/Moderation/Blocklist/Server/Index.php:95
#: src/Module/Moderation/Item/Delete.php:61 #: src/Module/Moderation/Item/Delete.php:61
#: src/Module/Moderation/Reports.php:90 src/Module/Moderation/Summary.php:76 #: src/Module/Moderation/Reports.php:89 src/Module/Moderation/Summary.php:76
#: src/Module/Moderation/Users/Active.php:133 #: src/Module/Moderation/Users/Active.php:133
#: src/Module/Moderation/Users/Blocked.php:133 #: src/Module/Moderation/Users/Blocked.php:133
#: src/Module/Moderation/Users/Deleted.php:80 #: src/Module/Moderation/Users/Deleted.php:80
@ -2215,7 +2215,7 @@ msgid "The end"
msgstr "" msgstr ""
#: src/Content/Text/HTML.php:859 src/Content/Widget/VCard.php:116 #: src/Content/Text/HTML.php:859 src/Content/Widget/VCard.php:116
#: src/Model/Profile.php:461 src/Module/Contact/Profile.php:458 #: src/Model/Profile.php:461 src/Module/Contact/Profile.php:485
msgid "Follow" msgid "Follow"
msgstr "" msgstr ""
@ -2413,18 +2413,18 @@ msgid "More Trending Tags"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:109 src/Model/Profile.php:376 #: src/Content/Widget/VCard.php:109 src/Model/Profile.php:376
#: src/Module/Contact/Profile.php:402 src/Module/Profile/Profile.php:199 #: src/Module/Contact/Profile.php:421 src/Module/Profile/Profile.php:199
msgid "XMPP:" msgid "XMPP:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:110 src/Model/Profile.php:377 #: src/Content/Widget/VCard.php:110 src/Model/Profile.php:377
#: src/Module/Contact/Profile.php:404 src/Module/Profile/Profile.php:203 #: src/Module/Contact/Profile.php:423 src/Module/Profile/Profile.php:203
msgid "Matrix:" msgid "Matrix:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:111 src/Model/Event.php:82 #: src/Content/Widget/VCard.php:111 src/Model/Event.php:82
#: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:963 #: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:963
#: src/Model/Profile.php:371 src/Module/Contact/Profile.php:400 #: src/Model/Profile.php:371 src/Module/Contact/Profile.php:419
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187 #: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187
#: src/Module/Profile/Profile.php:221 #: src/Module/Profile/Profile.php:221
msgid "Location:" msgid "Location:"
@ -2437,7 +2437,7 @@ msgstr ""
#: src/Content/Widget/VCard.php:118 src/Model/Contact.php:1223 #: src/Content/Widget/VCard.php:118 src/Model/Contact.php:1223
#: src/Model/Contact.php:1234 src/Model/Profile.php:463 #: src/Model/Contact.php:1234 src/Model/Profile.php:463
#: src/Module/Contact/Profile.php:450 #: src/Module/Contact/Profile.php:477
msgid "Unfollow" msgid "Unfollow"
msgstr "" msgstr ""
@ -3469,7 +3469,7 @@ msgstr ""
msgid "Homepage:" msgid "Homepage:"
msgstr "" msgstr ""
#: src/Model/Profile.php:375 src/Module/Contact/Profile.php:406 #: src/Model/Profile.php:375 src/Module/Contact/Profile.php:425
#: src/Module/Notifications/Introductions.php:189 #: src/Module/Notifications/Introductions.php:189
msgid "About:" msgid "About:"
msgstr "" msgstr ""
@ -4276,7 +4276,7 @@ msgstr ""
msgid "Job Parameters" msgid "Job Parameters"
msgstr "" msgstr ""
#: src/Module/Admin/Queue.php:78 src/Module/Moderation/Reports.php:96 #: src/Module/Admin/Queue.php:78 src/Module/Moderation/Reports.php:95
#: src/Module/Settings/OAuth.php:74 #: src/Module/Settings/OAuth.php:74
msgid "Created" msgid "Created"
msgstr "" msgstr ""
@ -5182,7 +5182,7 @@ msgid ""
"received." "received."
msgstr "" msgstr ""
#: src/Module/Admin/Site.php:513 src/Module/Contact/Profile.php:305 #: src/Module/Admin/Site.php:513 src/Module/Contact/Profile.php:309
#: src/Module/Settings/TwoFactor/Index.php:125 #: src/Module/Settings/TwoFactor/Index.php:125
msgid "Disabled" msgid "Disabled"
msgstr "" msgstr ""
@ -5670,7 +5670,7 @@ msgid ""
"the main account." "the main account."
msgstr "" msgstr ""
#: src/Module/BaseModeration.php:110 src/Module/Moderation/Reports.php:95 #: src/Module/BaseModeration.php:110 src/Module/Moderation/Reports.php:94
msgid "Reports" msgid "Reports"
msgstr "" msgstr ""
@ -5929,8 +5929,8 @@ msgstr ""
#: src/Module/Contact/Conversations.php:89 #: src/Module/Contact/Conversations.php:89
#: src/Module/Contact/Conversations.php:94 src/Module/Contact/Media.php:43 #: src/Module/Contact/Conversations.php:94 src/Module/Contact/Media.php:43
#: src/Module/Contact/Posts.php:78 src/Module/Contact/Posts.php:83 #: src/Module/Contact/Posts.php:78 src/Module/Contact/Posts.php:83
#: src/Module/Contact/Posts.php:88 src/Module/Contact/Profile.php:150 #: src/Module/Contact/Posts.php:88 src/Module/Contact/Profile.php:154
#: src/Module/Contact/Profile.php:155 src/Module/Contact/Profile.php:160 #: src/Module/Contact/Profile.php:159 src/Module/Contact/Profile.php:164
#: src/Module/Contact/Redir.php:94 src/Module/Contact/Redir.php:140 #: src/Module/Contact/Redir.php:94 src/Module/Contact/Redir.php:140
#: src/Module/FriendSuggest.php:71 src/Module/FriendSuggest.php:109 #: src/Module/FriendSuggest.php:71 src/Module/FriendSuggest.php:109
msgid "Contact not found." msgid "Contact not found."
@ -6088,18 +6088,18 @@ msgstr ""
msgid "Update" msgid "Update"
msgstr "" msgstr ""
#: src/Module/Contact.php:468 src/Module/Contact/Profile.php:498 #: src/Module/Contact.php:468 src/Module/Contact/Profile.php:525
#: src/Module/Moderation/Blocklist/Contact.php:117 #: src/Module/Moderation/Blocklist/Contact.php:117
#: src/Module/Moderation/Users/Blocked.php:138 #: src/Module/Moderation/Users/Blocked.php:138
#: src/Module/Moderation/Users/Index.php:154 #: src/Module/Moderation/Users/Index.php:154
msgid "Unblock" msgid "Unblock"
msgstr "" msgstr ""
#: src/Module/Contact.php:469 src/Module/Contact/Profile.php:506 #: src/Module/Contact.php:469 src/Module/Contact/Profile.php:533
msgid "Unignore" msgid "Unignore"
msgstr "" msgstr ""
#: src/Module/Contact.php:470 src/Module/Contact/Profile.php:514 #: src/Module/Contact.php:470 src/Module/Contact/Profile.php:541
msgid "Uncollapse" msgid "Uncollapse"
msgstr "" msgstr ""
@ -6151,7 +6151,7 @@ msgstr ""
msgid "Pending incoming contact request" msgid "Pending incoming contact request"
msgstr "" msgstr ""
#: src/Module/Contact.php:627 src/Module/Contact/Profile.php:365 #: src/Module/Contact.php:627 src/Module/Contact/Profile.php:384
#, php-format #, php-format
msgid "Visit %s's profile [%s]" msgid "Visit %s's profile [%s]"
msgstr "" msgstr ""
@ -6166,7 +6166,7 @@ msgstr ""
#: src/Module/Contact/Advanced.php:134 #: src/Module/Contact/Advanced.php:134
#: src/Module/Moderation/Blocklist/Contact.php:122 #: src/Module/Moderation/Blocklist/Contact.php:122
#: src/Module/Moderation/Reports.php:96 #: src/Module/Moderation/Reports.php:95
#: src/Module/Moderation/Users/Active.php:126 #: src/Module/Moderation/Users/Active.php:126
#: src/Module/Moderation/Users/Blocked.php:126 #: src/Module/Moderation/Users/Blocked.php:126
#: src/Module/Moderation/Users/Create.php:70 #: src/Module/Moderation/Users/Create.php:70
@ -6287,16 +6287,16 @@ msgstr ""
msgid "Your Identity Address:" msgid "Your Identity Address:"
msgstr "" msgstr ""
#: src/Module/Contact/Follow.php:170 src/Module/Contact/Profile.php:396 #: src/Module/Contact/Follow.php:170 src/Module/Contact/Profile.php:415
#: src/Module/Contact/Unfollow.php:129 #: src/Module/Contact/Unfollow.php:129
#: src/Module/Moderation/Blocklist/Contact.php:133 #: src/Module/Moderation/Blocklist/Contact.php:133
#: src/Module/Moderation/Reports.php:105 #: src/Module/Moderation/Reports.php:104
#: src/Module/Notifications/Introductions.php:129 #: src/Module/Notifications/Introductions.php:129
#: src/Module/Notifications/Introductions.php:198 #: src/Module/Notifications/Introductions.php:198
msgid "Profile URL" msgid "Profile URL"
msgstr "" msgstr ""
#: src/Module/Contact/Follow.php:171 src/Module/Contact/Profile.php:408 #: src/Module/Contact/Follow.php:171 src/Module/Contact/Profile.php:427
#: src/Module/Notifications/Introductions.php:191 #: src/Module/Notifications/Introductions.php:191
#: src/Module/Profile/Profile.php:234 #: src/Module/Profile/Profile.php:234
msgid "Tags:" msgid "Tags:"
@ -6335,257 +6335,291 @@ msgstr ""
msgid "Profile Match" msgid "Profile Match"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:136 #: src/Module/Contact/Profile.php:140
msgid "Failed to update contact record." msgid "Failed to update contact record."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:186 #: src/Module/Contact/Profile.php:190
msgid "Contact has been unblocked" msgid "Contact has been unblocked"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:190 #: src/Module/Contact/Profile.php:194
msgid "Contact has been blocked" msgid "Contact has been blocked"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:202 #: src/Module/Contact/Profile.php:206
msgid "Contact has been unignored" msgid "Contact has been unignored"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:206 #: src/Module/Contact/Profile.php:210
msgid "Contact has been ignored" msgid "Contact has been ignored"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:218 #: src/Module/Contact/Profile.php:222
msgid "Contact has been uncollapsed" msgid "Contact has been uncollapsed"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:222 #: src/Module/Contact/Profile.php:226
msgid "Contact has been collapsed" msgid "Contact has been collapsed"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:250 #: src/Module/Contact/Profile.php:254
#, php-format #, php-format
msgid "You are mutual friends with %s" msgid "You are mutual friends with %s"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:251 #: src/Module/Contact/Profile.php:255
#, php-format #, php-format
msgid "You are sharing with %s" msgid "You are sharing with %s"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:252 #: src/Module/Contact/Profile.php:256
#, php-format #, php-format
msgid "%s is sharing with you" msgid "%s is sharing with you"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:268 #: src/Module/Contact/Profile.php:272
msgid "Private communications are not available for this contact." msgid "Private communications are not available for this contact."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:278 #: src/Module/Contact/Profile.php:282
msgid "This contact is on a server you ignored." msgid "This contact is on a server you ignored."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:281 #: src/Module/Contact/Profile.php:285
msgid "Never" msgid "Never"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:284 #: src/Module/Contact/Profile.php:288
msgid "(Update was not successful)" msgid "(Update was not successful)"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:284 #: src/Module/Contact/Profile.php:288
msgid "(Update was successful)" msgid "(Update was successful)"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:286 src/Module/Contact/Profile.php:469 #: src/Module/Contact/Profile.php:290 src/Module/Contact/Profile.php:496
msgid "Suggest friends" msgid "Suggest friends"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:290 #: src/Module/Contact/Profile.php:294
#, php-format #, php-format
msgid "Network type: %s" msgid "Network type: %s"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:295 #: src/Module/Contact/Profile.php:299
msgid "Communications lost with this contact!" msgid "Communications lost with this contact!"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:301 #: src/Module/Contact/Profile.php:305
msgid "Fetch further information for feeds" msgid "Fetch further information for feeds"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:303 #: src/Module/Contact/Profile.php:307
msgid "" msgid ""
"Fetch information like preview pictures, title and teaser from the feed " "Fetch information like preview pictures, title and teaser from the feed "
"item. You can activate this if the feed doesn't contain much text. Keywords " "item. You can activate this if the feed doesn't contain much text. Keywords "
"are taken from the meta header in the feed item and are posted as hash tags." "are taken from the meta header in the feed item and are posted as hash tags."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:306 #: src/Module/Contact/Profile.php:310
msgid "Fetch information" msgid "Fetch information"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:307 #: src/Module/Contact/Profile.php:311
msgid "Fetch keywords" msgid "Fetch keywords"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:308 #: src/Module/Contact/Profile.php:312
msgid "Fetch information and keywords" msgid "Fetch information and keywords"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:318 src/Module/Contact/Profile.php:323 #: src/Module/Contact/Profile.php:322 src/Module/Contact/Profile.php:327
#: src/Module/Contact/Profile.php:328 src/Module/Contact/Profile.php:334 #: src/Module/Contact/Profile.php:332 src/Module/Contact/Profile.php:338
msgid "No mirroring" msgid "No mirroring"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:319 src/Module/Contact/Profile.php:329 #: src/Module/Contact/Profile.php:323 src/Module/Contact/Profile.php:333
#: src/Module/Contact/Profile.php:335 #: src/Module/Contact/Profile.php:339
msgid "Mirror as my own posting" msgid "Mirror as my own posting"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:324 src/Module/Contact/Profile.php:330 #: src/Module/Contact/Profile.php:328 src/Module/Contact/Profile.php:334
msgid "Native reshare" msgid "Native reshare"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:344
msgid "Channel Settings"
msgstr ""
#: src/Module/Contact/Profile.php:347 #: src/Module/Contact/Profile.php:347
msgid "Contact Information / Notes" msgid "Default visibility"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:348
msgid "Contact Settings" msgid "Display all posts of this contact"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:356 #: src/Module/Contact/Profile.php:349
msgid "Contact" msgid "Display only few posts"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:360 #: src/Module/Contact/Profile.php:350
msgid "Their personal note" msgid "Never display posts from this contact"
msgstr ""
#: src/Module/Contact/Profile.php:362
msgid "Edit contact notes"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:366 #: src/Module/Contact/Profile.php:366
msgid "Block/Unblock contact" msgid "Contact Information / Notes"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:367 #: src/Module/Contact/Profile.php:367
msgid "Contact Settings"
msgstr ""
#: src/Module/Contact/Profile.php:375
msgid "Contact"
msgstr ""
#: src/Module/Contact/Profile.php:379
msgid "Their personal note"
msgstr ""
#: src/Module/Contact/Profile.php:381
msgid "Edit contact notes"
msgstr ""
#: src/Module/Contact/Profile.php:385
msgid "Block/Unblock contact"
msgstr ""
#: src/Module/Contact/Profile.php:386
#: src/Module/Moderation/Report/Create.php:293 #: src/Module/Moderation/Report/Create.php:293
msgid "Ignore contact" msgid "Ignore contact"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:368 #: src/Module/Contact/Profile.php:387
msgid "View conversations" msgid "View conversations"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:373 #: src/Module/Contact/Profile.php:392
msgid "Last update:" msgid "Last update:"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:375 #: src/Module/Contact/Profile.php:394
msgid "Update public posts" msgid "Update public posts"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:377 src/Module/Contact/Profile.php:479 #: src/Module/Contact/Profile.php:396 src/Module/Contact/Profile.php:506
msgid "Update now" msgid "Update now"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:379 #: src/Module/Contact/Profile.php:398
msgid "Awaiting connection acknowledge" msgid "Awaiting connection acknowledge"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:380 #: src/Module/Contact/Profile.php:399
msgid "Currently blocked" msgid "Currently blocked"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:381 #: src/Module/Contact/Profile.php:400
msgid "Currently ignored" msgid "Currently ignored"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:382 #: src/Module/Contact/Profile.php:401
msgid "Currently collapsed" msgid "Currently collapsed"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:383 #: src/Module/Contact/Profile.php:402
msgid "Currently archived" msgid "Currently archived"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:386 #: src/Module/Contact/Profile.php:405
msgid "Manage remote servers" msgid "Manage remote servers"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:388 #: src/Module/Contact/Profile.php:407
#: src/Module/Notifications/Introductions.php:192 #: src/Module/Notifications/Introductions.php:192
msgid "Hide this contact from others" msgid "Hide this contact from others"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:388 #: src/Module/Contact/Profile.php:407
msgid "" msgid ""
"Replies/likes to your public posts <strong>may</strong> still be visible" "Replies/likes to your public posts <strong>may</strong> still be visible"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:389 #: src/Module/Contact/Profile.php:408
msgid "Notification for new posts" msgid "Notification for new posts"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:389 #: src/Module/Contact/Profile.php:408
msgid "Send a notification of every new post of this contact" msgid "Send a notification of every new post of this contact"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:391 #: src/Module/Contact/Profile.php:410
msgid "Keyword Deny List" msgid "Keyword Deny List"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:391 #: src/Module/Contact/Profile.php:410
msgid "" msgid ""
"Comma separated list of keywords that should not be converted to hashtags, " "Comma separated list of keywords that should not be converted to hashtags, "
"when \"Fetch information and keywords\" is selected" "when \"Fetch information and keywords\" is selected"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:409 #: src/Module/Contact/Profile.php:428
#: src/Module/Settings/TwoFactor/Index.php:139 #: src/Module/Settings/TwoFactor/Index.php:139
msgid "Actions" msgid "Actions"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:411 #: src/Module/Contact/Profile.php:430
#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:229 #: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:229
msgid "Status" msgid "Status"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:417 #: src/Module/Contact/Profile.php:436
msgid "Mirror postings from this contact" msgid "Mirror postings from this contact"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:419 #: src/Module/Contact/Profile.php:438
msgid "" msgid ""
"Mark this contact as remote_self, this will cause friendica to repost new " "Mark this contact as remote_self, this will cause friendica to repost new "
"entries from this contact." "entries from this contact."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:489 #: src/Module/Contact/Profile.php:444
msgid "Refetch contact data" msgid "Visibility of this contact in appropriate channels"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:500 #: src/Module/Contact/Profile.php:446
msgid "Toggle Blocked status" msgid ""
msgstr "" "Depending on the type of the channel not all posts from contacts are "
"displayed by default. They for example need to have a certain amount of "
#: src/Module/Contact/Profile.php:508 "comments to be displayed. On the other hand there can be contacts who flood "
msgid "Toggle Ignored status" "the channel, so you might want to see only some of their posts. Or you don't "
"want to see their content at all, but you don't want to block or hide the "
"contact completely."
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:516 #: src/Module/Contact/Profile.php:516
msgid "Refetch contact data"
msgstr ""
#: src/Module/Contact/Profile.php:527
msgid "Toggle Blocked status"
msgstr ""
#: src/Module/Contact/Profile.php:535
msgid "Toggle Ignored status"
msgstr ""
#: src/Module/Contact/Profile.php:543
msgid "Toggle Collapsed status" msgid "Toggle Collapsed status"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:523 src/Module/Contact/Revoke.php:106 #: src/Module/Contact/Profile.php:550 src/Module/Contact/Revoke.php:106
msgid "Revoke Follow" msgid "Revoke Follow"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:525 #: src/Module/Contact/Profile.php:552
msgid "Revoke the follow from this contact" msgid "Revoke the follow from this contact"
msgstr "" msgstr ""
@ -7585,7 +7619,7 @@ msgid "Block New Remote Contact"
msgstr "" msgstr ""
#: src/Module/Moderation/Blocklist/Contact.php:122 #: src/Module/Moderation/Blocklist/Contact.php:122
#: src/Module/Moderation/Reports.php:96 #: src/Module/Moderation/Reports.php:95
msgid "Photo" msgid "Photo"
msgstr "" msgstr ""
@ -8147,30 +8181,30 @@ msgstr ""
msgid "3. Pick posts" msgid "3. Pick posts"
msgstr "" msgstr ""
#: src/Module/Moderation/Reports.php:91 #: src/Module/Moderation/Reports.php:90
msgid "List of reports" msgid "List of reports"
msgstr "" msgstr ""
#: src/Module/Moderation/Reports.php:92 #: src/Module/Moderation/Reports.php:91
msgid "This page display reports created by our or remote users." msgid "This page display reports created by our or remote users."
msgstr "" msgstr ""
#: src/Module/Moderation/Reports.php:93 #: src/Module/Moderation/Reports.php:92
msgid "No report exists at this node." msgid "No report exists at this node."
msgstr "" msgstr ""
#: src/Module/Moderation/Reports.php:96 #: src/Module/Moderation/Reports.php:95
msgid "Category" msgid "Category"
msgstr "" msgstr ""
#: src/Module/Moderation/Reports.php:102 #: src/Module/Moderation/Reports.php:101
#, php-format #, php-format
msgid "%s total report" msgid "%s total report"
msgid_plural "%s total reports" msgid_plural "%s total reports"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Module/Moderation/Reports.php:105 #: src/Module/Moderation/Reports.php:104
msgid "URL of the reported contact." msgid "URL of the reported contact."
msgstr "" msgstr ""

View file

@ -91,6 +91,11 @@
</div> </div>
<div id="contact-info-end"></div> <div id="contact-info-end"></div>
{{/if}} {{/if}}
{{if $channel_settings_label}}
<h4>{{$channel_settings_label}}</h4>
{{include file="field_select.tpl" field=$channel_visibility}}
{{/if}}
</div> </div>
<input class="contact-edit-submit" type="submit" name="submit" value="{{$submit}}" /> <input class="contact-edit-submit" type="submit" name="submit" value="{{$submit}}" />
{{/if}} {{/if}}

View file

@ -189,6 +189,28 @@
</div> </div>
</div> </div>
{{/if}} {{/if}}
{{if $channel_settings_label}}
<div class="panel">
<div class="section-subtitle-wrapper panel-heading" role="tab" id="contact-edit-channel">
<h4>
<button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#contact-edit-tools" href="#contact-edit-channel-collapse" aria-expanded="false" aria-controls="contact-edit-channel-collapse">
{{$channel_settings_label}}
</button>
</h4>
</div>
<div id="contact-edit-channel-collapse" class="panel-body panel-collapse collapse" role="tabpanel" aria-labelledby="contact-edit-channel">
<div class="section-content-tools-wrapper">
{{include file="field_select.tpl" field=$channel_visibility}}
<div class="pull-right settings-submit-wrapper">
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
</div>
<div class="clear"></div>
</div>
</div>
</div>
{{/if}}
</div> </div>
</form>{{* End of the form *}} </form>{{* End of the form *}}