From ed2fd1237b88cc41becb873fc4c6d581d634c43b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 Jan 2024 18:36:47 +0000 Subject: [PATCH] New field "publish" for channels --- database.sql | 3 +- doc/database/db_channel.md | 1 + src/Content/Conversation/Entity/Timeline.php | 6 +- .../Factory/UserDefinedChannel.php | 1 + .../Repository/UserDefinedChannel.php | 29 ++- src/Model/Item.php | 3 +- src/Module/Settings/Channels.php | 10 +- static/dbstructure.config.php | 3 +- view/lang/C/messages.po | 204 +++++++++--------- view/templates/settings/channels.tpl | 3 + .../frio/templates/settings/channels.tpl | 3 + 11 files changed, 153 insertions(+), 113 deletions(-) diff --git a/database.sql b/database.sql index 62d5f5ffd7..ecc295841f 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2024.03-dev (Yellow Archangel) --- DB_UPDATE_VERSION 1545 +-- DB_UPDATE_VERSION 1546 -- ------------------------------------------ @@ -505,6 +505,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( `full-text-search` varchar(1023) COMMENT 'Full text search pattern, see https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode', `media-type` smallint unsigned COMMENT 'Filtered media types', `languages` mediumtext COMMENT 'Desired languages', + `publish` boolean COMMENT 'publish channel content', PRIMARY KEY(`id`), INDEX `uid` (`uid`), FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE diff --git a/doc/database/db_channel.md b/doc/database/db_channel.md index 8d307eee89..afd65b867c 100644 --- a/doc/database/db_channel.md +++ b/doc/database/db_channel.md @@ -19,6 +19,7 @@ Fields | full-text-search | Full text search pattern, see https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode | varchar(1023) | YES | | NULL | | | media-type | Filtered media types | smallint unsigned | YES | | NULL | | | languages | Desired languages | mediumtext | YES | | NULL | | +| publish | publish channel content | boolean | YES | | NULL | | Indexes ------------ diff --git a/src/Content/Conversation/Entity/Timeline.php b/src/Content/Conversation/Entity/Timeline.php index 34d2a3534a..175971a583 100644 --- a/src/Content/Conversation/Entity/Timeline.php +++ b/src/Content/Conversation/Entity/Timeline.php @@ -34,6 +34,7 @@ namespace Friendica\Content\Conversation\Entity; * @property-read int $mediaType Media types that are included in the channel * @property-read array $languages Channel languages * @property-read int $circle Circle or timeline this channel is based on + * @property-read bool $publish Publish the channel */ class Timeline extends \Friendica\BaseEntity { @@ -61,8 +62,10 @@ class Timeline extends \Friendica\BaseEntity protected $mediaType; /** @var array */ protected $languages; + /** @var bool */ + protected $publish; - public function __construct(string $code = null, string $label = null, string $description = null, string $accessKey = null, string $path = null, int $uid = null, string $includeTags = null, string $excludeTags = null, string $fullTextSearch = null, int $mediaType = null, int $circle = null, array $languages = null) + public function __construct(string $code = null, string $label = null, string $description = null, string $accessKey = null, string $path = null, int $uid = null, string $includeTags = null, string $excludeTags = null, string $fullTextSearch = null, int $mediaType = null, int $circle = null, array $languages = null, bool $publish = null) { $this->code = $code; $this->label = $label; @@ -76,5 +79,6 @@ class Timeline extends \Friendica\BaseEntity $this->mediaType = $mediaType; $this->circle = $circle; $this->languages = $languages; + $this->publish = $publish; } } diff --git a/src/Content/Conversation/Factory/UserDefinedChannel.php b/src/Content/Conversation/Factory/UserDefinedChannel.php index 98e10b4fbf..d4798cd6c7 100644 --- a/src/Content/Conversation/Factory/UserDefinedChannel.php +++ b/src/Content/Conversation/Factory/UserDefinedChannel.php @@ -50,6 +50,7 @@ final class UserDefinedChannel extends Timeline implements ICanCreateFromTableRo $row['media-type'] ?? null, $row['circle'] ?? null, $row['languages'] ?? null, + $row['publish'] ?? null, ); } } diff --git a/src/Content/Conversation/Repository/UserDefinedChannel.php b/src/Content/Conversation/Repository/UserDefinedChannel.php index 60784c1f08..eb39abefb6 100644 --- a/src/Content/Conversation/Repository/UserDefinedChannel.php +++ b/src/Content/Conversation/Repository/UserDefinedChannel.php @@ -66,7 +66,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository return $Entities; } - public function select(array $condition, array $params = []): BaseCollection + public function select(array $condition, array $params = []): UserDefinedChannels { return $this->_select($condition, $params); } @@ -133,6 +133,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository 'full-text-search' => $Channel->fullTextSearch, 'media-type' => $Channel->mediaType, 'languages' => serialize($Channel->languages), + 'publish' => $Channel->publish, ]; if ($Channel->code) { @@ -160,14 +161,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository */ public function match(string $searchtext, string $language, array $tags, int $media_type): bool { - $condition = ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `user`.`uid` > ?", 0]; - - $abandon_days = intval($this->config->get('system', 'account_abandon_days')); - if (!empty($abandon_days)) { - $condition = DBA::mergeConditions($condition, ["`last-activity` > ?", DateTimeFormat::utc('now - ' . $abandon_days . ' days')]); - } - - $users = $this->db->selectToArray('user', ['uid'], $condition); + $users = $this->db->selectToArray('user', ['uid'], $this->getUserCondition()); if (empty($users)) { return []; } @@ -187,7 +181,9 @@ class UserDefinedChannel extends \Friendica\BaseRepository */ public function getMatchingChannelUsers(string $searchtext, string $language, array $tags, int $media_type, int $owner_id): array { - $users = $this->db->selectToArray('user', ['uid'], ["`account-type` = ? AND `uid` != ?", User::ACCOUNT_TYPE_RELAY, 0]); + $condition = $this->getUserCondition(); + $condition = DBA::mergeConditions($condition, ["`account-type` IN (?, ?) AND `uid` != ?", User::ACCOUNT_TYPE_RELAY, User::ACCOUNT_TYPE_COMMUNITY, 0]); + $users = $this->db->selectToArray('user', ['uid'], $condition); if (empty($users)) { return []; } @@ -208,6 +204,8 @@ class UserDefinedChannel extends \Friendica\BaseRepository $condition = ['uid' => $channelUids]; if (!$relayMode) { $condition = DBA::mergeConditions($condition, ["`full-text-search` != ?", '']); + } else { + $condition = DBA::mergeConditions($condition, ['publish' => true]); } foreach ($this->select($condition) as $channel) { @@ -278,4 +276,15 @@ class UserDefinedChannel extends \Friendica\BaseRepository $this->db->delete('check-full-text-search', ['pid' => getmypid()]); return $uids; } + + private function getUserCondition() + { + $condition = ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `user`.`uid` > ?", 0]; + + $abandon_days = intval($this->config->get('system', 'account_abandon_days')); + if (!empty($abandon_days)) { + $condition = DBA::mergeConditions($condition, ["`last-activity` > ?", DateTimeFormat::utc('now - ' . $abandon_days . ' days')]); + } + return $condition; + } } diff --git a/src/Model/Item.php b/src/Model/Item.php index 4c7f0d24fa..1b749a8910 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2128,12 +2128,11 @@ class Item } } + $result = self::compactLanguages($result); if (empty($result)) { return $default; } - $result = self::compactLanguages($result); - arsort($result); return array_slice($result, 0, $count); } diff --git a/src/Module/Settings/Channels.php b/src/Module/Settings/Channels.php index f09e054981..c15081d759 100644 --- a/src/Module/Settings/Channels.php +++ b/src/Module/Settings/Channels.php @@ -110,6 +110,7 @@ class Channels extends BaseSettings 'full-text-search' => $request['text_search'][$id], 'media-type' => ($request['image'][$id] ? 1 : 0) | ($request['video'][$id] ? 2 : 0) | ($request['audio'][$id] ? 4 : 0), 'languages' => $request['languages'][$id], + 'publish' => $request['publish'][$id], ]); $saved = $this->channel->save($channel); $this->logger->debug('Save channel', ['id' => $id, 'saved' => $saved]); @@ -128,7 +129,7 @@ class Channels extends BaseSettings $user = User::getById($uid, ['account-type']); $account_type = $user['account-type']; - if ($account_type == User::ACCOUNT_TYPE_RELAY) { + if (in_array($account_type, [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) { $intro = $this->t('This page can be used to define the channels that will automatically be reshared by your account.'); $circles = [ 0 => $this->l10n->t('Global Community') @@ -160,6 +161,12 @@ class Channels extends BaseSettings $open = false; } + if (in_array($account_type, [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) { + $publish = ["publish[$channel->code]", $this->t("Publish"), $channel->publish, $this->t("When selected, the channel results are reshared. This only works for public ActivityPub posts from the public timeline or the user defined circles.")]; + } else { + $publish = null; + } + $channels[] = [ 'id' => $channel->code, 'open' => $open, @@ -174,6 +181,7 @@ class Channels extends BaseSettings 'video' => ["video[$channel->code]", $this->t("Videos"), $channel->mediaType & 2], 'audio' => ["audio[$channel->code]", $this->t("Audio"), $channel->mediaType & 4], 'languages' => ["languages[$channel->code][]", $this->t('Languages'), $channel->languages ?? $channel_languages, $this->t('Select all languages that you want to see in this channel.'), $languages, 'multiple'], + 'publish' => $publish, 'delete' => ["delete[$channel->code]", $this->t("Delete channel") . ' (' . $channel->label . ')', false, $this->t("Check to delete this entry from the channel list")] ]; } diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 53eab46aed..80e7e6a6ea 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -56,7 +56,7 @@ use Friendica\Database\DBA; // This file is required several times during the test in DbaDefinition which justifies this condition if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1545); + define('DB_UPDATE_VERSION', 1546); } return [ @@ -563,6 +563,7 @@ return [ "full-text-search" => ["type" => "varchar(1023)", "comment" => "Full text search pattern, see https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode"], "media-type" => ["type" => "smallint unsigned", "comment" => "Filtered media types"], "languages" => ["type" => "mediumtext", "comment" => "Desired languages"], + "publish" => ["type" => "boolean", "comment" => "publish channel content"], ], "indexes" => [ "PRIMARY" => ["id"], diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 8b172b8ce3..a0ae79bdff 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -67,7 +67,7 @@ msgstr "" #: src/Module/Register.php:206 src/Module/Register.php:245 #: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50 #: src/Module/Settings/Account.php:386 src/Module/Settings/Channels.php:57 -#: src/Module/Settings/Channels.php:125 src/Module/Settings/Delegation.php:90 +#: src/Module/Settings/Channels.php:126 src/Module/Settings/Delegation.php:90 #: src/Module/Settings/Display.php:90 src/Module/Settings/Display.php:197 #: src/Module/Settings/Profile/Photo/Crop.php:165 #: src/Module/Settings/Profile/Photo/Index.php:112 @@ -382,7 +382,7 @@ msgstr "" #: mod/notes.php:57 src/Content/Text/HTML.php:859 #: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:74 -#: src/Module/Post/Edit.php:129 src/Module/Settings/Channels.php:200 +#: src/Module/Post/Edit.php:129 src/Module/Settings/Channels.php:208 msgid "Save" msgstr "" @@ -794,12 +794,12 @@ msgstr "" #: src/BaseModule.php:439 src/Content/Conversation/Factory/Channel.php:45 #: src/Content/Widget.php:239 src/Core/ACL.php:195 src/Module/Contact.php:414 #: src/Module/PermissionTooltip.php:141 src/Module/PermissionTooltip.php:163 -#: src/Module/Settings/Channels.php:142 +#: src/Module/Settings/Channels.php:143 msgid "Followers" msgstr "" #: src/BaseModule.php:444 src/Content/Widget.php:240 src/Module/Contact.php:417 -#: src/Module/Settings/Channels.php:141 +#: src/Module/Settings/Channels.php:142 msgid "Following" msgstr "" @@ -957,7 +957,7 @@ msgstr "" msgid "Enter user nickname: " msgstr "" -#: src/Console/User.php:182 src/Model/User.php:812 +#: src/Console/User.php:182 src/Model/User.php:816 #: src/Module/Api/Twitter/ContactEndpoint.php:74 #: src/Module/Moderation/Users/Active.php:71 #: src/Module/Moderation/Users/Blocked.php:71 @@ -1551,7 +1551,7 @@ msgid "Posts from accounts that are followed by accounts that you follow" msgstr "" #: src/Content/Conversation/Factory/Channel.php:47 -#: src/Module/Settings/Channels.php:173 src/Module/Settings/Channels.php:191 +#: src/Module/Settings/Channels.php:180 src/Module/Settings/Channels.php:199 msgid "Images" msgstr "" @@ -1560,7 +1560,7 @@ msgid "Posts with images" msgstr "" #: src/Content/Conversation/Factory/Channel.php:48 -#: src/Module/Settings/Channels.php:175 src/Module/Settings/Channels.php:193 +#: src/Module/Settings/Channels.php:182 src/Module/Settings/Channels.php:201 msgid "Audio" msgstr "" @@ -1569,7 +1569,7 @@ msgid "Posts with audio" msgstr "" #: src/Content/Conversation/Factory/Channel.php:49 -#: src/Module/Settings/Channels.php:174 src/Module/Settings/Channels.php:192 +#: src/Module/Settings/Channels.php:181 src/Module/Settings/Channels.php:200 msgid "Videos" msgstr "" @@ -1586,7 +1586,7 @@ msgid "Posts from local users on this server" msgstr "" #: src/Content/Conversation/Factory/Community.php:47 -#: src/Module/Settings/Channels.php:134 src/Module/Settings/Channels.php:139 +#: src/Module/Settings/Channels.php:135 src/Module/Settings/Channels.php:140 msgid "Global Community" msgstr "" @@ -1749,7 +1749,7 @@ msgstr "" #: src/Content/GroupManager.php:147 src/Content/Nav.php:278 #: src/Content/Text/HTML.php:880 src/Content/Widget.php:537 -#: src/Model/User.php:1374 +#: src/Model/User.php:1378 msgid "Groups" msgstr "" @@ -1770,7 +1770,7 @@ msgstr "" msgid "Create new group" msgstr "" -#: src/Content/Item.php:332 src/Model/Item.php:3204 +#: src/Content/Item.php:332 src/Model/Item.php:3201 msgid "event" msgstr "" @@ -1778,7 +1778,7 @@ msgstr "" msgid "status" msgstr "" -#: src/Content/Item.php:341 src/Model/Item.php:3206 +#: src/Content/Item.php:341 src/Model/Item.php:3203 #: src/Module/Post/Tag/Add.php:123 msgid "photo" msgstr "" @@ -1846,8 +1846,8 @@ msgstr "" msgid "Ignore %s server" msgstr "" -#: src/Content/Item.php:443 src/Module/Settings/Channels.php:176 -#: src/Module/Settings/Channels.php:194 src/Object/Post.php:509 +#: src/Content/Item.php:443 src/Module/Settings/Channels.php:183 +#: src/Module/Settings/Channels.php:202 src/Object/Post.php:509 msgid "Languages" msgstr "" @@ -2050,7 +2050,7 @@ msgstr "" msgid "Terms of Service of this Friendica instance" msgstr "" -#: src/Content/Nav.php:306 src/Module/Settings/Channels.php:140 +#: src/Content/Nav.php:306 src/Module/Settings/Channels.php:141 #: view/theme/frio/theme.php:239 msgid "Network" msgstr "" @@ -2191,8 +2191,8 @@ msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:994 src/Model/Item.php:3937 -#: src/Model/Item.php:3943 src/Model/Item.php:3944 +#: src/Content/Text/BBCode.php:994 src/Model/Item.php:3934 +#: src/Model/Item.php:3940 src/Model/Item.php:3941 msgid "Link to source" msgstr "" @@ -2373,7 +2373,7 @@ msgid "All" msgstr "" #: src/Content/Widget.php:591 src/Module/Admin/Site.php:466 -#: src/Module/BaseSettings.php:125 src/Module/Settings/Channels.php:196 +#: src/Module/BaseSettings.php:125 src/Module/Settings/Channels.php:204 #: src/Module/Settings/Display.php:315 msgid "Channels" msgstr "" @@ -2855,7 +2855,7 @@ msgstr "" msgid "Could not connect to database." msgstr "" -#: src/Core/L10n.php:441 src/Model/Item.php:2248 +#: src/Core/L10n.php:441 src/Model/Item.php:2245 msgid "Undetermined" msgstr "" @@ -3413,91 +3413,91 @@ msgstr "" msgid "Happy Birthday %s" msgstr "" -#: src/Model/Item.php:2255 +#: src/Model/Item.php:2252 #, php-format msgid "%s (%s - %s): %s" msgstr "" -#: src/Model/Item.php:2257 +#: src/Model/Item.php:2254 #, php-format msgid "%s (%s): %s" msgstr "" -#: src/Model/Item.php:2260 +#: src/Model/Item.php:2257 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "" -#: src/Model/Item.php:3208 +#: src/Model/Item.php:3205 msgid "activity" msgstr "" -#: src/Model/Item.php:3210 +#: src/Model/Item.php:3207 msgid "comment" msgstr "" -#: src/Model/Item.php:3213 src/Module/Post/Tag/Add.php:123 +#: src/Model/Item.php:3210 src/Module/Post/Tag/Add.php:123 msgid "post" msgstr "" -#: src/Model/Item.php:3383 +#: src/Model/Item.php:3380 #, php-format msgid "%s is blocked" msgstr "" -#: src/Model/Item.php:3385 +#: src/Model/Item.php:3382 #, php-format msgid "%s is ignored" msgstr "" -#: src/Model/Item.php:3387 +#: src/Model/Item.php:3384 #, php-format msgid "Content from %s is collapsed" msgstr "" -#: src/Model/Item.php:3391 +#: src/Model/Item.php:3388 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3844 +#: src/Model/Item.php:3841 msgid "bytes" msgstr "" -#: src/Model/Item.php:3875 +#: src/Model/Item.php:3872 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3877 +#: src/Model/Item.php:3874 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3882 +#: src/Model/Item.php:3879 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3884 +#: src/Model/Item.php:3881 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3886 +#: src/Model/Item.php:3883 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3920 src/Model/Item.php:3921 +#: src/Model/Item.php:3917 src/Model/Item.php:3918 msgid "View on separate page" msgstr "" @@ -3655,141 +3655,141 @@ msgstr "" msgid "Contact information and Social Networks" msgstr "" -#: src/Model/User.php:225 src/Model/User.php:1287 +#: src/Model/User.php:225 src/Model/User.php:1291 msgid "SERIOUS ERROR: Generation of security keys failed." msgstr "" -#: src/Model/User.php:721 src/Model/User.php:754 +#: src/Model/User.php:725 src/Model/User.php:758 msgid "Login failed" msgstr "" -#: src/Model/User.php:786 +#: src/Model/User.php:790 msgid "Not enough information to authenticate" msgstr "" -#: src/Model/User.php:907 +#: src/Model/User.php:911 msgid "Password can't be empty" msgstr "" -#: src/Model/User.php:949 +#: src/Model/User.php:953 msgid "Empty passwords are not allowed." msgstr "" -#: src/Model/User.php:953 +#: src/Model/User.php:957 msgid "" "The new password has been exposed in a public data dump, please choose " "another." msgstr "" -#: src/Model/User.php:957 +#: src/Model/User.php:961 msgid "The password length is limited to 72 characters." msgstr "" -#: src/Model/User.php:961 +#: src/Model/User.php:965 msgid "The password can't contain white spaces nor accentuated letters" msgstr "" -#: src/Model/User.php:1170 +#: src/Model/User.php:1174 msgid "Passwords do not match. Password unchanged." msgstr "" -#: src/Model/User.php:1177 +#: src/Model/User.php:1181 msgid "An invitation is required." msgstr "" -#: src/Model/User.php:1181 +#: src/Model/User.php:1185 msgid "Invitation could not be verified." msgstr "" -#: src/Model/User.php:1189 +#: src/Model/User.php:1193 msgid "Invalid OpenID url" msgstr "" -#: src/Model/User.php:1202 src/Security/Authentication.php:241 +#: src/Model/User.php:1206 src/Security/Authentication.php:241 msgid "" "We encountered a problem while logging in with the OpenID you provided. " "Please check the correct spelling of the ID." msgstr "" -#: src/Model/User.php:1202 src/Security/Authentication.php:241 +#: src/Model/User.php:1206 src/Security/Authentication.php:241 msgid "The error message was:" msgstr "" -#: src/Model/User.php:1208 +#: src/Model/User.php:1212 msgid "Please enter the required information." msgstr "" -#: src/Model/User.php:1222 +#: src/Model/User.php:1226 #, php-format msgid "" "system.username_min_length (%s) and system.username_max_length (%s) are " "excluding each other, swapping values." msgstr "" -#: src/Model/User.php:1229 +#: src/Model/User.php:1233 #, php-format msgid "Username should be at least %s character." msgid_plural "Username should be at least %s characters." msgstr[0] "" msgstr[1] "" -#: src/Model/User.php:1233 +#: src/Model/User.php:1237 #, php-format msgid "Username should be at most %s character." msgid_plural "Username should be at most %s characters." msgstr[0] "" msgstr[1] "" -#: src/Model/User.php:1241 +#: src/Model/User.php:1245 msgid "That doesn't appear to be your full (First Last) name." msgstr "" -#: src/Model/User.php:1246 +#: src/Model/User.php:1250 msgid "Your email domain is not among those allowed on this site." msgstr "" -#: src/Model/User.php:1250 +#: src/Model/User.php:1254 msgid "Not a valid email address." msgstr "" -#: src/Model/User.php:1253 +#: src/Model/User.php:1257 msgid "The nickname was blocked from registration by the nodes admin." msgstr "" -#: src/Model/User.php:1257 src/Model/User.php:1263 +#: src/Model/User.php:1261 src/Model/User.php:1267 msgid "Cannot use that email." msgstr "" -#: src/Model/User.php:1269 +#: src/Model/User.php:1273 msgid "Your nickname can only contain a-z, 0-9 and _." msgstr "" -#: src/Model/User.php:1277 src/Model/User.php:1334 +#: src/Model/User.php:1281 src/Model/User.php:1338 msgid "Nickname is already registered. Please choose another." msgstr "" -#: src/Model/User.php:1321 src/Model/User.php:1325 +#: src/Model/User.php:1325 src/Model/User.php:1329 msgid "An error occurred during registration. Please try again." msgstr "" -#: src/Model/User.php:1348 +#: src/Model/User.php:1352 msgid "An error occurred creating your default profile. Please try again." msgstr "" -#: src/Model/User.php:1355 +#: src/Model/User.php:1359 msgid "An error occurred creating your self contact. Please try again." msgstr "" -#: src/Model/User.php:1360 +#: src/Model/User.php:1364 msgid "Friends" msgstr "" -#: src/Model/User.php:1364 +#: src/Model/User.php:1368 msgid "" "An error occurred creating your default contact circle. Please try again." msgstr "" -#: src/Model/User.php:1408 +#: src/Model/User.php:1412 msgid "Profile Photos" msgstr "" @@ -6124,7 +6124,7 @@ msgstr "" #: src/Module/Moderation/Blocklist/Server/Index.php:116 #: src/Module/Moderation/Item/Delete.php:67 src/Module/Register.php:148 #: src/Module/Security/TwoFactor/Verify.php:101 -#: src/Module/Settings/Channels.php:166 src/Module/Settings/Channels.php:184 +#: src/Module/Settings/Channels.php:173 src/Module/Settings/Channels.php:192 #: src/Module/Settings/TwoFactor/Index.php:161 #: src/Module/Settings/TwoFactor/Verify.php:158 msgid "Required" @@ -7377,7 +7377,7 @@ msgstr "" #: src/Module/Friendica.php:102 #: src/Module/Moderation/Blocklist/Server/Index.php:87 #: src/Module/Moderation/Blocklist/Server/Index.php:111 -#: src/Module/Settings/Channels.php:203 +#: src/Module/Settings/Channels.php:211 msgid "Reason for the block" msgstr "" @@ -8125,7 +8125,7 @@ msgstr "" #: src/Module/Moderation/Blocklist/Server/Index.php:86 #: src/Module/Moderation/Blocklist/Server/Index.php:110 -#: src/Module/Settings/Channels.php:202 +#: src/Module/Settings/Channels.php:210 msgid "Blocked server domain pattern" msgstr "" @@ -10123,90 +10123,100 @@ msgstr "" msgid "No Addon settings configured" msgstr "" -#: src/Module/Settings/Channels.php:132 +#: src/Module/Settings/Channels.php:133 msgid "" "This page can be used to define the channels that will automatically be " "reshared by your account." msgstr "" -#: src/Module/Settings/Channels.php:137 +#: src/Module/Settings/Channels.php:138 msgid "This page can be used to define your own channels." msgstr "" -#: src/Module/Settings/Channels.php:166 src/Module/Settings/Channels.php:184 +#: src/Module/Settings/Channels.php:165 +msgid "Publish" +msgstr "" + +#: src/Module/Settings/Channels.php:165 +msgid "" +"When selected, the channel results are reshared. This only works for public " +"ActivityPub posts from the public timeline or the user defined circles." +msgstr "" + +#: src/Module/Settings/Channels.php:173 src/Module/Settings/Channels.php:192 #: src/Module/Settings/Display.php:338 msgid "Label" msgstr "" -#: src/Module/Settings/Channels.php:167 src/Module/Settings/Channels.php:185 +#: src/Module/Settings/Channels.php:174 src/Module/Settings/Channels.php:193 #: src/Module/Settings/Display.php:339 #: src/Module/Settings/TwoFactor/AppSpecific.php:137 msgid "Description" msgstr "" -#: src/Module/Settings/Channels.php:168 src/Module/Settings/Channels.php:186 +#: src/Module/Settings/Channels.php:175 src/Module/Settings/Channels.php:194 msgid "Access Key" msgstr "" -#: src/Module/Settings/Channels.php:169 src/Module/Settings/Channels.php:187 +#: src/Module/Settings/Channels.php:176 src/Module/Settings/Channels.php:195 msgid "Circle/Channel" msgstr "" -#: src/Module/Settings/Channels.php:170 src/Module/Settings/Channels.php:188 +#: src/Module/Settings/Channels.php:177 src/Module/Settings/Channels.php:196 msgid "Include Tags" msgstr "" -#: src/Module/Settings/Channels.php:171 src/Module/Settings/Channels.php:189 +#: src/Module/Settings/Channels.php:178 src/Module/Settings/Channels.php:197 msgid "Exclude Tags" msgstr "" -#: src/Module/Settings/Channels.php:172 src/Module/Settings/Channels.php:190 +#: src/Module/Settings/Channels.php:179 src/Module/Settings/Channels.php:198 msgid "Full Text Search" msgstr "" -#: src/Module/Settings/Channels.php:176 src/Module/Settings/Channels.php:194 +#: src/Module/Settings/Channels.php:183 src/Module/Settings/Channels.php:202 msgid "Select all languages that you want to see in this channel." msgstr "" -#: src/Module/Settings/Channels.php:177 +#: src/Module/Settings/Channels.php:185 msgid "Delete channel" msgstr "" -#: src/Module/Settings/Channels.php:177 +#: src/Module/Settings/Channels.php:185 msgid "Check to delete this entry from the channel list" msgstr "" -#: src/Module/Settings/Channels.php:184 +#: src/Module/Settings/Channels.php:192 msgid "Short name for the channel. It is displayed on the channels widget." msgstr "" -#: src/Module/Settings/Channels.php:185 +#: src/Module/Settings/Channels.php:193 msgid "This should describe the content of the channel in a few word." msgstr "" -#: src/Module/Settings/Channels.php:186 +#: src/Module/Settings/Channels.php:194 msgid "" "When you want to access this channel via an access key, you can define it " "here. Pay attention to not use an already used one." msgstr "" -#: src/Module/Settings/Channels.php:187 +#: src/Module/Settings/Channels.php:195 msgid "Select a circle or channel, that your channel should be based on." msgstr "" -#: src/Module/Settings/Channels.php:188 +#: src/Module/Settings/Channels.php:196 msgid "" "Comma separated list of tags. A post will be used when it contains any of " "the listed tags." msgstr "" -#: src/Module/Settings/Channels.php:189 +#: src/Module/Settings/Channels.php:197 msgid "" "Comma separated list of tags. If a post contain any of these tags, then it " "will not be part of nthis channel." msgstr "" -#: src/Module/Settings/Channels.php:190 +#: src/Module/Settings/Channels.php:198 #, php-format msgid "" "Search terms for the body, supports the \"boolean mode\" operators from " @@ -10214,35 +10224,35 @@ msgid "" "keywords: %s" msgstr "" -#: src/Module/Settings/Channels.php:191 +#: src/Module/Settings/Channels.php:199 msgid "Check to display images in the channel." msgstr "" -#: src/Module/Settings/Channels.php:192 +#: src/Module/Settings/Channels.php:200 msgid "Check to display videos in the channel." msgstr "" -#: src/Module/Settings/Channels.php:193 +#: src/Module/Settings/Channels.php:201 msgid "Check to display audio in the channel." msgstr "" -#: src/Module/Settings/Channels.php:198 +#: src/Module/Settings/Channels.php:206 msgid "Add new entry to the channel list" msgstr "" -#: src/Module/Settings/Channels.php:199 +#: src/Module/Settings/Channels.php:207 msgid "Add" msgstr "" -#: src/Module/Settings/Channels.php:201 +#: src/Module/Settings/Channels.php:209 msgid "Current Entries in the channel list" msgstr "" -#: src/Module/Settings/Channels.php:204 +#: src/Module/Settings/Channels.php:212 msgid "Delete entry from the channel list" msgstr "" -#: src/Module/Settings/Channels.php:205 +#: src/Module/Settings/Channels.php:213 msgid "Delete entry from the channel list?" msgstr "" diff --git a/view/templates/settings/channels.tpl b/view/templates/settings/channels.tpl index 3b84741425..44260a2336 100644 --- a/view/templates/settings/channels.tpl +++ b/view/templates/settings/channels.tpl @@ -36,6 +36,9 @@ {{include file="field_checkbox.tpl" field=$e.video}} {{include file="field_checkbox.tpl" field=$e.audio}} {{include file="field_select.tpl" field=$e.languages}} + {{if $e.publish}} + {{include file="field_checkbox.tpl" field=$e.publish}} + {{/if}} {{include file="field_checkbox.tpl" field=$e.delete}}
{{/foreach}} diff --git a/view/theme/frio/templates/settings/channels.tpl b/view/theme/frio/templates/settings/channels.tpl index 6761127957..932783e1dc 100644 --- a/view/theme/frio/templates/settings/channels.tpl +++ b/view/theme/frio/templates/settings/channels.tpl @@ -53,6 +53,9 @@ {{include file="field_checkbox.tpl" field=$e.video}} {{include file="field_checkbox.tpl" field=$e.audio}} {{include file="field_select.tpl" field=$e.languages}} + {{if $e.publish}} + {{include file="field_checkbox.tpl" field=$e.publish}} + {{/if}} {{include file="field_checkbox.tpl" field=$e.delete}}
-- 2.39.5