From 94cd729ccacd47d854ec4b447b9154edfa10491c Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 21 Sep 2022 09:46:24 +0200 Subject: [PATCH 001/641] Updates for the CHANGELOG for 2022.09 --- CHANGELOG | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 79301e6dd..9b9441c8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,41 @@ Version 2022.09 (unreleased) Friendica Core + Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN + Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan] + Added the possibility to store profile avatars in a separate directory [annando] + Added an option to not fetch parent postings [annando] + Added an option to reject postings by language received by the relay [annando] + Added a notification mail to all users when the server block list is updated [MrPetovan] + Added a download link to the CSV file of the server block list on the about page [MrPetovan] + Updates to the themes (frio, smoothly) [AlessandroLorenzi, HankG, MrPetovan, tobiasd] + General code cleanup [annando, fabrixxm, Quix0r, tobiasd] + Enhanced the performance (cache, database, rendering) [annando, Quix0r] + Enhanced the language detection [annando] + Enhanced the display of the reason why a posting is shown to a user [annando] + Enhanced the fetching of missing postings [annando] + Enhanced the server detection [annando] + Enhanced the UI for 2FA logins [nupplaphil] + Enhanced the Woodpecker integration [nupplaphil] + Enhanced integration with ejabberd [nupplaphil] + Fixed a federation problem with Diaspora* during the author signature check [annando] + Fixed a problem with Forwarded-For headers [nupplaphil] + Fixed a problem with the encoding of mails send [MrPetovan] + Updated dependencies [MrPetovan] + Replace SFTP-publish with docker-publish [nupplaphil] + Removed the poke functionality [MrPetovan] Friendica Addons + Added GD translation, updates to the translation AR, FR + Removed the addons: morechoice, morepokes + Marked the addon whindowsphonepush as unsupported + twitter: + Valid post body can be empty [MrPetovan] Closed Issues - + 11177, 11317, 11458, 11566, 11625, 11635, 11636, 11638, 11651, 11661, + 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, 11723, 11724, + 11726, 11731, 11732, 11751, 11765, 11775, 11779, 11794, 11798, 11799, + 11824, 11826, 11861, 11870 Version 2022.06 (2022-06-11) Friendica Core From b56a9cf4194280830a1654fd6403a294cbabd559 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 9 Oct 2022 16:01:02 +0200 Subject: [PATCH 002/641] some updates for the CHANGELOG --- CHANGELOG | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9b9441c8a..d1ac37e9d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ Version 2022.09 (unreleased) Added an option to reject postings by language received by the relay [annando] Added a notification mail to all users when the server block list is updated [MrPetovan] Added a download link to the CSV file of the server block list on the about page [MrPetovan] + Added support for youtube short URLs [annando] Updates to the themes (frio, smoothly) [AlessandroLorenzi, HankG, MrPetovan, tobiasd] General code cleanup [annando, fabrixxm, Quix0r, tobiasd] Enhanced the performance (cache, database, rendering) [annando, Quix0r] @@ -20,6 +21,8 @@ Version 2022.09 (unreleased) Fixed a federation problem with Diaspora* during the author signature check [annando] Fixed a problem with Forwarded-For headers [nupplaphil] Fixed a problem with the encoding of mails send [MrPetovan] + Fixed a problem with wired formatted date notations [annando, MrPetovan] + Fixed a problem following some RSS feeds [mexon] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] Removed the poke functionality [MrPetovan] @@ -30,12 +33,14 @@ Version 2022.09 (unreleased) Marked the addon whindowsphonepush as unsupported twitter: Valid post body can be empty [MrPetovan] + Support of Twitter threads was added [annando] Closed Issues - 11177, 11317, 11458, 11566, 11625, 11635, 11636, 11638, 11651, 11661, - 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, 11723, 11724, - 11726, 11731, 11732, 11751, 11765, 11775, 11779, 11794, 11798, 11799, - 11824, 11826, 11861, 11870 + 11177, 11317, 11458, 11471, 11566, 11614, 11625, 11635, 11636, 11638, + 11651, 11661, 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716, + 11722, 11723, 11724, 11726, 11731, 11732, 11751, 11765, 11775, 11778, + 11779, 11794, 11798, 11799, 11800, 11824, 11826, 11851, 11861, 11870, + 11909, 11920, 11931, 11938, 11943, 11952, 11953, 11969, 11975 Version 2022.06 (2022-06-11) Friendica Core From 656e74605fe34651245c35bae6414eb316d45a65 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 10 Oct 2022 07:36:43 +0200 Subject: [PATCH 003/641] typo --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d1ac37e9d..d1320ddd8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,7 +21,7 @@ Version 2022.09 (unreleased) Fixed a federation problem with Diaspora* during the author signature check [annando] Fixed a problem with Forwarded-For headers [nupplaphil] Fixed a problem with the encoding of mails send [MrPetovan] - Fixed a problem with wired formatted date notations [annando, MrPetovan] + Fixed a problem with weird formatted date notations [annando, MrPetovan] Fixed a problem following some RSS feeds [mexon] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] From 7e8c48a5394d105ff3851fb54c484c9f0fee41b6 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 10 Oct 2022 07:57:12 +0200 Subject: [PATCH 004/641] added new API endpoint for events to the CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d1320ddd8..ec188fd70 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Version 2022.09 (unreleased) Friendica Core Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan] + Added an API endpoint to create events [MrPetovan, pankraz] Added the possibility to store profile avatars in a separate directory [annando] Added an option to not fetch parent postings [annando] Added an option to reject postings by language received by the relay [annando] From a21c04d55ddc9144bfeac33a3e5540eee1cc70ab Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Oct 2022 06:01:07 +0000 Subject: [PATCH 005/641] Use "maxloadavg" when "worker_load_cooldown" is not defined --- src/Core/Worker.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 69ca6004c..a57792ce7 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -461,6 +461,10 @@ class Worker $load_cooldown = DI::config()->get('system', 'worker_load_cooldown'); $processes_cooldown = DI::config()->get('system', 'worker_processes_cooldown'); + if ($load_cooldown == 0) { + $load_cooldown = DI::config()->get('system', 'maxloadavg'); + } + if (($load_cooldown == 0) && ($processes_cooldown == 0)) { return false; } @@ -501,6 +505,10 @@ class Worker $load_cooldown = DI::config()->get('system', 'worker_load_cooldown'); $processes_cooldown = DI::config()->get('system', 'worker_processes_cooldown'); + if ($load_cooldown == 0) { + $load_cooldown = DI::config()->get('system', 'maxloadavg'); + } + if (($load_cooldown == 0) && ($processes_cooldown == 0)) { return; } From 028de0e2280ead4ec61b3b7eeb9762e9d3bc8eab Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Oct 2022 12:30:07 +0000 Subject: [PATCH 006/641] Quote of quotes are visually improved --- src/Content/Item.php | 5 ++--- src/Protocol/Diaspora.php | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index d5c33a762..53ee1462f 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -22,7 +22,7 @@ namespace Friendica\Content; use Friendica\Content\Text\BBCode; -use Friendica\Content\Text\Markdown; +use Friendica\Content\Text\HTML; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; @@ -669,8 +669,7 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { - $item['body'] = Markdown::toBBCode(BBCode::toMarkdown($item['body'])); - $item['body'] = Diaspora::replacePeopleGuid($item['body'], $item['author-link']); + $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); } $shared_content .= $item['body'] . '[/share]'; diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 88665f949..66ace1d3d 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -2395,6 +2395,7 @@ class Diaspora $datarray = self::setDirection($datarray, $direction); $datarray['body'] = DI::contentItem()->createSharedPostByGuid($root_guid, $importer['uid'], $original_person['url']); + $datarray['body'] = Diaspora::replacePeopleGuid($datarray['body'], $datarray['author-link']); /// @todo Copy tag data from original post Tag::storeFromBody($datarray['uri-id'], $datarray['body']); From aeb4645ba64b13241d5fd4b6de9f1f446d8e7da7 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Oct 2022 22:39:30 +0000 Subject: [PATCH 007/641] New field "quote-uri-id" for quoted posts --- database.sql | 19 +++++++++++++++-- doc/database/db_post-content.md | 3 +++ src/Content/Text/BBCode.php | 16 +++++++++++++++ src/Model/Item.php | 26 +++++++++++++++++++++--- src/Protocol/ActivityPub/Transmitter.php | 25 ++++------------------- static/dbstructure.config.php | 4 +++- static/dbview.config.php | 12 +++++++++++ 7 files changed, 78 insertions(+), 27 deletions(-) diff --git a/database.sql b/database.sql index 48de2fcae..119228656 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2022.09-rc (Giant Rhubarb) --- DB_UPDATE_VERSION 1484 +-- DB_UPDATE_VERSION 1485 -- ------------------------------------------ @@ -1186,6 +1186,7 @@ CREATE TABLE IF NOT EXISTS `post-content` ( `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '', `body` mediumtext COMMENT 'item body content', `raw-body` mediumtext COMMENT 'Body without embedded media links', + `quote-uri-id` int unsigned COMMENT 'Id of the item-uri table that contains the quoted uri', `location` varchar(255) NOT NULL DEFAULT '' COMMENT 'text location where this item originated', `coord` varchar(255) NOT NULL DEFAULT '' COMMENT 'longitude/latitude pair representing location where this item originated', `language` text COMMENT 'Language information about this post', @@ -1202,7 +1203,9 @@ CREATE TABLE IF NOT EXISTS `post-content` ( INDEX `plink` (`plink`(191)), INDEX `resource-id` (`resource-id`), FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`), - FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE + INDEX `quote-uri-id` (`quote-uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`quote-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts'; -- @@ -1807,6 +1810,8 @@ CREATE VIEW `post-user-view` AS SELECT `post-user`.`thr-parent-id` AS `thr-parent-id`, `conversation-item-uri`.`uri` AS `conversation`, `post-thread-user`.`conversation-id` AS `conversation-id`, + `quote-item-uri`.`uri` AS `quote-uri`, + `post-content`.`quote-uri-id` AS `quote-uri-id`, `item-uri`.`guid` AS `guid`, `post-user`.`wall` AS `wall`, `post-user`.`gravity` AS `gravity`, @@ -1962,6 +1967,7 @@ CREATE VIEW `post-user-view` AS SELECT LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id` LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid` @@ -1985,6 +1991,8 @@ CREATE VIEW `post-thread-user-view` AS SELECT `post-user`.`thr-parent-id` AS `thr-parent-id`, `conversation-item-uri`.`uri` AS `conversation`, `post-thread-user`.`conversation-id` AS `conversation-id`, + `quote-item-uri`.`uri` AS `quote-uri`, + `post-content`.`quote-uri-id` AS `quote-uri-id`, `item-uri`.`guid` AS `guid`, `post-thread-user`.`wall` AS `wall`, `post-user`.`gravity` AS `gravity`, @@ -2138,6 +2146,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id` LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid` @@ -2157,6 +2166,8 @@ CREATE VIEW `post-view` AS SELECT `post`.`thr-parent-id` AS `thr-parent-id`, `conversation-item-uri`.`uri` AS `conversation`, `post-thread`.`conversation-id` AS `conversation-id`, + `quote-item-uri`.`uri` AS `quote-uri`, + `post-content`.`quote-uri-id` AS `quote-uri-id`, `item-uri`.`guid` AS `guid`, `post`.`gravity` AS `gravity`, `external-item-uri`.`uri` AS `extid`, @@ -2279,6 +2290,7 @@ CREATE VIEW `post-view` AS SELECT LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id` LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id` LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`; @@ -2296,6 +2308,8 @@ CREATE VIEW `post-thread-view` AS SELECT `post`.`thr-parent-id` AS `thr-parent-id`, `conversation-item-uri`.`uri` AS `conversation`, `post-thread`.`conversation-id` AS `conversation-id`, + `quote-item-uri`.`uri` AS `quote-uri`, + `post-content`.`quote-uri-id` AS `quote-uri-id`, `item-uri`.`guid` AS `guid`, `post`.`gravity` AS `gravity`, `external-item-uri`.`uri` AS `extid`, @@ -2418,6 +2432,7 @@ CREATE VIEW `post-thread-view` AS SELECT LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id` LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id` LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`; diff --git a/doc/database/db_post-content.md b/doc/database/db_post-content.md index 86714c5ec..27b372093 100644 --- a/doc/database/db_post-content.md +++ b/doc/database/db_post-content.md @@ -13,6 +13,7 @@ Fields | content-warning | | varchar(255) | NO | | | | | body | item body content | mediumtext | YES | | NULL | | | raw-body | Body without embedded media links | mediumtext | YES | | NULL | | +| quote-uri-id | Id of the item-uri table that contains the quoted uri | int unsigned | YES | | NULL | | | location | text location where this item originated | varchar(255) | NO | | | | | coord | longitude/latitude pair representing location where this item originated | varchar(255) | NO | | | | | language | Language information about this post | text | YES | | NULL | | @@ -35,6 +36,7 @@ Indexes | plink | plink(191) | | resource-id | resource-id | | title-content-warning-body | FULLTEXT, title, content-warning, body | +| quote-uri-id | quote-uri-id | Foreign Keys ------------ @@ -42,5 +44,6 @@ Foreign Keys | Field | Target Table | Target Field | |-------|--------------|--------------| | uri-id | [item-uri](help/database/db_item-uri) | id | +| quote-uri-id | [item-uri](help/database/db_item-uri) | id | Return to [database documentation](help/database) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 43d4127ea..59b2e77a4 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1069,6 +1069,22 @@ class BBCode return $attributes; } + /** + * Replace the share block with a link + * + * @param string $body + * @return string + */ + public static function replaceSharedData(string $body): string + { + return BBCode::convertShare( + $body, + function (array $attributes) { + return '♲ ' . $attributes['link']; + } + ); + } + /** * This function converts a [share] block to text according to a provided callback function whose signature is: * diff --git a/src/Model/Item.php b/src/Model/Item.php index 381918535..797def3bd 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -93,7 +93,7 @@ class Item 'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink', 'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language', 'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object', - 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global', + 'quote-uri', 'quote-uri-id', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global', 'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network', 'author-updated', 'author-gsid', 'author-addr', 'author-uri-id', 'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', 'owner-updated', 'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network', @@ -115,7 +115,7 @@ class Item 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'author-id', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid', 'signed_text', 'network', 'wall', 'contact-id', 'plink', 'origin', - 'thr-parent-id', 'parent-uri-id', 'postopts', 'pubmail', + 'thr-parent-id', 'parent-uri-id', 'quote-uri', 'quote-uri-id', 'postopts', 'pubmail', 'event-created', 'event-edited', 'event-start', 'event-finish', 'event-summary', 'event-desc', 'event-location', 'event-type', 'event-nofinish', 'event-ignore', 'event-id']; @@ -123,7 +123,7 @@ class Item // All fields in the item table const ITEM_FIELDLIST = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent', 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id', 'conversation', 'vid', - 'contact-id', 'wall', 'gravity', 'extid', 'psid', + 'quote-uri', 'quote-uri-id', 'contact-id', 'wall', 'gravity', 'extid', 'psid', 'created', 'edited', 'commented', 'received', 'changed', 'verb', 'postopts', 'plink', 'resource-id', 'event-id', 'inform', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'post-type', 'post-reason', @@ -1119,6 +1119,11 @@ class Item $item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']); $item['raw-body'] = self::setHashtags($item['raw-body']); + if ($quote_id = self::getQuoteUriId($item['body'])) { + $item['quote-uri-id'] = $quote_id; + $item['raw-body'] = BBCode::replaceSharedData($item['raw-body']); + } + if (!DBA::exists('contact', ['id' => $item['author-id'], 'network' => Protocol::DFRN])) { Post\Media::insertFromRelevantUrl($item['uri-id'], $item['raw-body']); } @@ -3629,4 +3634,19 @@ class Item Logger::debug('New shared data', ['uri-id' => $item['uri-id'], 'link' => $link, 'guid' => $item['guid']]); return $item['body']; } + + /** + * Fetch the uri-id of a quote + * + * @param string $body + * @return integer + */ + private static function getQuoteUriId(string $body): int + { + $shared = BBCode::fetchShareAttributes($body); + if (empty($shared['message_id'])) { + return 0; + } + return ItemURI::getIdByURI($shared['message_id']); + } } diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 38482d3ec..de9a3535f 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -1662,10 +1662,9 @@ class Transmitter $body = BBCode::setMentionsToNicknames($body); - $shared = BBCode::fetchShareAttributes($body); - if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) { - $body = self::replaceSharedData($body); - $data['quoteUrl'] = $shared['link']; + if (!empty($item['quote-uri'])) { + $body = BBCode::replaceSharedData($body); + $data['quoteUrl'] = $item['quote-uri']; } $data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB); @@ -1680,7 +1679,7 @@ class Transmitter $shared = BBCode::fetchShareAttributes($richbody); if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) { - $richbody = self::replaceSharedData($richbody); + $richbody = BBCode::replaceSharedData($richbody); } $richbody = BBCode::removeAttachment($richbody); @@ -1710,22 +1709,6 @@ class Transmitter return $data; } - /** - * Replace the share block with a link - * - * @param string $body - * @return string - */ - private static function replaceSharedData(string $body): string - { - return BBCode::convertShare( - $body, - function (array $attributes) { - return '♲ ' . $attributes['link']; - } - ); - } - /** * Fetches the language from the post, the user or the system. * diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 90fea5bcf..5da1c1771 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1484); + define('DB_UPDATE_VERSION', 1485); } return [ @@ -1218,6 +1218,7 @@ return [ "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "body" => ["type" => "mediumtext", "comment" => "item body content"], "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"], + "quote-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the quoted uri"], "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"], "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"], "language" => ["type" => "text", "comment" => "Language information about this post"], @@ -1236,6 +1237,7 @@ return [ "plink" => ["plink(191)"], "resource-id" => ["resource-id"], "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"], + "quote-uri-id" => ["quote-uri-id"], ] ], "post-delivery" => [ diff --git a/static/dbview.config.php b/static/dbview.config.php index 2a7cb54fe..c12cccb4c 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -72,6 +72,8 @@ "thr-parent-id" => ["post-user", "thr-parent-id"], "conversation" => ["conversation-item-uri", "uri"], "conversation-id" => ["post-thread-user", "conversation-id"], + "quote-uri" => ["quote-item-uri", "uri"], + "quote-uri-id" => ["post-content", "quote-uri-id"], "guid" => ["item-uri", "guid"], "wall" => ["post-user", "wall"], "gravity" => ["post-user", "gravity"], @@ -229,6 +231,7 @@ LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id` LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid` @@ -249,6 +252,8 @@ "thr-parent-id" => ["post-user", "thr-parent-id"], "conversation" => ["conversation-item-uri", "uri"], "conversation-id" => ["post-thread-user", "conversation-id"], + "quote-uri" => ["quote-item-uri", "uri"], + "quote-uri-id" => ["post-content", "quote-uri-id"], "guid" => ["item-uri", "guid"], "wall" => ["post-thread-user", "wall"], "gravity" => ["post-user", "gravity"], @@ -404,6 +409,7 @@ LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id` LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid` @@ -420,6 +426,8 @@ "thr-parent-id" => ["post", "thr-parent-id"], "conversation" => ["conversation-item-uri", "uri"], "conversation-id" => ["post-thread", "conversation-id"], + "quote-uri" => ["quote-item-uri", "uri"], + "quote-uri-id" => ["post-content", "quote-uri-id"], "guid" => ["item-uri", "guid"], "gravity" => ["post", "gravity"], "extid" => ["external-item-uri", "uri"], @@ -544,6 +552,7 @@ LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id` LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id` LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`" @@ -558,6 +567,8 @@ "thr-parent-id" => ["post", "thr-parent-id"], "conversation" => ["conversation-item-uri", "uri"], "conversation-id" => ["post-thread", "conversation-id"], + "quote-uri" => ["quote-item-uri", "uri"], + "quote-uri-id" => ["post-content", "quote-uri-id"], "guid" => ["item-uri", "guid"], "gravity" => ["post", "gravity"], "extid" => ["external-item-uri", "uri"], @@ -682,6 +693,7 @@ LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid` LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id` LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id` + LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id` LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id` LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id` LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`" From 747139d186b163ab26685406993e57a42bb437b9 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Oct 2022 23:18:58 +0000 Subject: [PATCH 008/641] Quoted posts from Twitter now contain media again --- src/Content/Item.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 53ee1462f..539814655 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -657,7 +657,6 @@ class Item public function createSharedBlockByArray(array $item): string { if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { - $item['guid'] = ''; $item['uri'] = ''; } From 9e74a1bd0670e05322118e881a5915f778d7835c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Oct 2022 08:26:00 -0400 Subject: [PATCH 009/641] Contact array can be empty in Model\Contact::getAvatarPath - Address https://github.com/friendica/friendica/issues/11630#issuecomment-1274195844 --- src/Model/Contact.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2b6cb05bb..ceaf635df 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1680,11 +1680,9 @@ class Contact /** * Return the photo path for a given contact array in the given size * - * @param array $contact contact array - * @param string $field Fieldname of the photo in the contact array + * @param array $contact contact array * @param string $size Size of the avatar picture - * @param string $avatar Avatar path that is displayed when no photo had been found - * @param bool $no_update Don't perfom an update if no cached avatar was found + * @param bool $no_update Don't perfom an update if no cached avatar was found * @return string photo path */ private static function getAvatarPath(array $contact, string $size, bool $no_update = false): string @@ -1711,7 +1709,7 @@ class Contact } } - return self::getAvatarUrlForId($contact['id'], $size, $contact['updated'] ?? ''); + return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated'] ?? ''); } /** From 68d6e11d831cc3092e7011b90be36fa28fd0cbab Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 20:10:39 +0000 Subject: [PATCH 010/641] Fix attached media in quoted posts --- src/Content/Item.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Content/Item.php b/src/Content/Item.php index 539814655..7a86135f9 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -666,8 +666,19 @@ class Item $shared_content .= '[h3]' . $item['title'] . "[/h3]\n"; } + $shared = BBCode::fetchShareAttributes($item['body']); + + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { + if (!empty($shared['guid'])) { + $encaspulated_share = self::createSharedPostByGuid($shared['guid']); + if (!empty($encaspulated_share)) { + $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); + } + } + $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); } From f1f13db24fbeb9caa8d16bf4cdc858d7a3455456 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 20:48:47 +0000 Subject: [PATCH 011/641] Simplified code --- src/Content/Item.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 7a86135f9..1b07c5585 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -672,11 +672,8 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { - if (!empty($shared['guid'])) { - $encaspulated_share = self::createSharedPostByGuid($shared['guid']); - if (!empty($encaspulated_share)) { - $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); - } + if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { + $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); From 0e82f64d71b598a1349ac22973148715f7182fdd Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Oct 2022 21:39:28 +0000 Subject: [PATCH 012/641] Only attach images --- src/Content/Item.php | 2 +- src/Model/Post/Media.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 1b07c5585..d1cdbc679 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -668,7 +668,7 @@ class Item $shared = BBCode::fetchShareAttributes($item['body']); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'], [Post\Media::IMAGE]); // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 8fb10ddd8..ce00b205c 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -648,11 +648,13 @@ class Media /** * Add media attachments to the body * - * @param int $uriid + * @param int $uriid * @param string $body + * @param array $types + * * @return string body */ - public static function addAttachmentsToBody(int $uriid, string $body = ''): string + public static function addAttachmentsToBody(int $uriid, string $body = '', array $types = [self::IMAGE, self::AUDIO, self::VIDEO]): string { if (empty($body)) { $item = Post::selectFirst(['body'], ['uri-id' => $uriid]); @@ -665,7 +667,7 @@ class Media $body = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", '', $body); - foreach (self::getByURIId($uriid, [self::IMAGE, self::AUDIO, self::VIDEO]) as $media) { + foreach (self::getByURIId($uriid, $types) as $media) { if (Item::containsLink($body, $media['preview'] ?? $media['url'], $media['type'])) { continue; } From 0480d9aebdeb13ab5517714406342d58e4d4298c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Oct 2022 22:08:54 -0400 Subject: [PATCH 013/641] Add missing post keys to retrieve pLink in Model\Event::prepareListForTemplate() - Address https://github.com/friendica/friendica/issues/11632#issuecomment-1275117722 --- src/Model/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index 712e5861a..db66a330f 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -580,7 +580,7 @@ class Event $last_date = ''; $fmt = DI::l10n()->t('l, F j'); foreach ($event_result as $event) { - $item = Post::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link', 'private', 'uri-id'], ['id' => $event['itemid']]); + $item = Post::selectFirst(['plink', 'author-name', 'author-network', 'author-id', 'author-avatar', 'author-link', 'private', 'uri-id'], ['id' => $event['itemid']]); if (!DBA::isResult($item)) { // Using default values when no item had been found $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '', 'private' => Item::PUBLIC, 'uri-id' => ($event['uri-id'] ?? 0)]; From e69b04d2df9726cd43a7c801febe8e4f7668f790 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Oct 2022 05:34:55 +0000 Subject: [PATCH 014/641] Only add the media for non federated posts --- src/Content/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index d1cdbc679..1bf8410cd 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -657,7 +657,9 @@ class Item public function createSharedBlockByArray(array $item): string { if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + $item['guid'] = ''; $item['uri'] = ''; + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); } $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']); @@ -668,8 +670,6 @@ class Item $shared = BBCode::fetchShareAttributes($item['body']); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'], [Post\Media::IMAGE]); - // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { From 8936ae26fd50d0ef007e6efafec589e324fe65aa Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 13 Oct 2022 09:53:58 +0200 Subject: [PATCH 015/641] added fix for quoted shares from Twitter to the CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index ec188fd70..e3db699d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ Version 2022.09 (unreleased) Fixed a problem with the encoding of mails send [MrPetovan] Fixed a problem with weird formatted date notations [annando, MrPetovan] Fixed a problem following some RSS feeds [mexon] + Fixed a problem with quoted reshares from Twitter [annando] Updated dependencies [MrPetovan] Replace SFTP-publish with docker-publish [nupplaphil] Removed the poke functionality [MrPetovan] From c2e57c5c0ee9f2f289b5d228afe876b4bcf6db1f Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 14 Oct 2022 04:43:46 +0000 Subject: [PATCH 016/641] Return the pageinfo when feed is shared --- src/Content/Item.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 1bf8410cd..6cbcb6369 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -656,7 +656,9 @@ class Item */ public function createSharedBlockByArray(array $item): string { - if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + if ($item['network'] == Protocol::FEED) { + return PageInfo::getFooterFromUrl($item['plink']); + } elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { $item['guid'] = ''; $item['uri'] = ''; $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); @@ -675,7 +677,7 @@ class Item if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } - + $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB)); } From 99b09858d20347784760520817d040bc6095765d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 14 Oct 2022 20:48:08 +0200 Subject: [PATCH 017/641] set the release date for the 2022.10 release in the CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e3db699d8..5c044b0a2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Version 2022.09 (unreleased) +Version 2022.10 (2022-10-14) Friendica Core Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan] From 7109d2a6a8924e8cec7735017fdc00bb1af38b8c Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 14 Oct 2022 20:49:17 +0200 Subject: [PATCH 018/641] Friendica version 2022.10 --- VERSION | 2 +- boot.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 900c5e3c1..8874859a2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2022.09-rc +2022.10 diff --git a/boot.php b/boot.php index 2ceafea78..db7840b11 100644 --- a/boot.php +++ b/boot.php @@ -31,7 +31,7 @@ use Friendica\Model\Contact; define('FRIENDICA_PLATFORM', 'Friendica'); define('FRIENDICA_CODENAME', 'Giant Rhubarb'); -define('FRIENDICA_VERSION', '2022.09-rc'); +define('FRIENDICA_VERSION', '2022.10'); define('DFRN_PROTOCOL_VERSION', '2.23'); define('NEW_TABLE_STRUCTURE_VERSION', 1288); From b5d3651f3feb5cc040a7bf3f0fe59621f16bcbb3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 14 Oct 2022 20:52:38 +0200 Subject: [PATCH 019/641] bump version to 2022.12-dev --- VERSION | 2 +- boot.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 8874859a2..151845e80 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2022.10 +2022.12-dev diff --git a/boot.php b/boot.php index db7840b11..8e7958de3 100644 --- a/boot.php +++ b/boot.php @@ -31,7 +31,7 @@ use Friendica\Model\Contact; define('FRIENDICA_PLATFORM', 'Friendica'); define('FRIENDICA_CODENAME', 'Giant Rhubarb'); -define('FRIENDICA_VERSION', '2022.10'); +define('FRIENDICA_VERSION', '2022.12-dev'); define('DFRN_PROTOCOL_VERSION', '2.23'); define('NEW_TABLE_STRUCTURE_VERSION', 1288); From 5a800e2d09d99ae2168d7eb7c812ccbd8a8cb75a Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 14 Oct 2022 20:52:58 +0200 Subject: [PATCH 020/641] prepare the CHANGELOG for 2022.12 --- CHANGELOG | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5c044b0a2..88d28f313 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +Version 2022.12 (unreleased) + Friendica Core + + Friendica Addons + + Closed Issues + Version 2022.10 (2022-10-14) Friendica Core Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN From e5ae5c7e67c00a03398ccbac9964b9c381ec68a3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 14 Oct 2022 20:54:05 +0200 Subject: [PATCH 021/641] renewed the expiration date for the security.txt file --- security.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security.txt b/security.txt index 9aa39248d..5c47099dd 100644 --- a/security.txt +++ b/security.txt @@ -1,6 +1,6 @@ Contact: mailto:info@friendi.ca -Expires: Sun, 31 Dec 2022 23:59 +0000 +Expires: Sun, 30 Jun 2023 23:59 +0000 Preferred-Languages: en From 3e868416c72e9a827b8f4614ee70e05664313cfa Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 14 Oct 2022 22:02:25 +0000 Subject: [PATCH 022/641] Check for post existence --- src/Model/Item.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 797def3bd..ceb8fcc88 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1119,7 +1119,9 @@ class Item $item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']); $item['raw-body'] = self::setHashtags($item['raw-body']); - if ($quote_id = self::getQuoteUriId($item['body'])) { + $quote_id = self::getQuoteUriId($item['body']); + + if (!empty($quote_id) && Post::exists(['uri-id' => $quote_id, 'network' => Protocol::FEDERATED])) { $item['quote-uri-id'] = $quote_id; $item['raw-body'] = BBCode::replaceSharedData($item['raw-body']); } From da66730e4f142c3557cdf7343bc420f7b80c883e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2022 23:12:11 +0200 Subject: [PATCH 023/641] Rewrite: - moved constants GRAVITY_* from boot.php to Friendica\Model\Item - also rewrote some array initialization: From: ```` [0, $item_user], 'uri-id' => $item['parent-uri-id']], ['order' => ['uid' => true]]); $item = $parent ?: $item; } diff --git a/mod/item.php b/mod/item.php index f3f0fd40d..9bb082884 100644 --- a/mod/item.php +++ b/mod/item.php @@ -122,7 +122,7 @@ function item_post(App $a) { $thr_parent_uri = $parent_item['uri']; $toplevel_item = $parent_item; - if ($parent_item['gravity'] != GRAVITY_PARENT) { + if ($parent_item['gravity'] != Item::GRAVITY_PARENT) { $toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $toplevel_item['parent']]); } } @@ -385,7 +385,7 @@ function item_post(App $a) { // Look for any tags and linkify them $item = [ 'uid' => local_user() ? local_user() : $profile_uid, - 'gravity' => $toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT, + 'gravity' => $toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT, 'network' => $network, 'body' => $body, 'postopts' => $postopts, @@ -513,7 +513,7 @@ function item_post(App $a) { $network = Protocol::DFRN; } - $gravity = ($toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT); + $gravity = ($toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT); // even if the post arrived via API we are considering that it // originated on this site by default for determining relayability. @@ -705,7 +705,7 @@ function item_post(App $a) { Tag::storeFromBody($datarray['uri-id'], $datarray['body']); - if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == GRAVITY_COMMENT)) { + if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == Item::GRAVITY_COMMENT)) { Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']); } @@ -833,15 +833,15 @@ function item_content(App $a) * @return string * @throws HTTPException\InternalServerErrorException */ -function drop_item(int $id, string $return = '') +function drop_item(int $id, string $return = ''): string { - // locate item to be deleted - $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent']; - $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]); + // Locate item to be deleted + $item = Post::selectFirstForUser(local_user(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]); if (!DBA::isResult($item)) { notice(DI::l10n()->t('Item not found.')); DI::baseUrl()->redirect('network'); + //NOTREACHED } if ($item['deleted']) { @@ -860,6 +860,7 @@ function drop_item(int $id, string $return = '') Item::deleteForUser(['id' => $item['id']], local_user()); item_redirect_after_action($item, $return); + //NOTREACHED } else { Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]); notice(DI::l10n()->t('Permission denied.')); @@ -870,15 +871,15 @@ function drop_item(int $id, string $return = '') return ''; } -function item_redirect_after_action($item, $returnUrlHex) +function item_redirect_after_action(array $item, string $returnUrlHex) { $return_url = hex2bin($returnUrlHex); // removes update_* from return_url to ignore Ajax refresh - $return_url = str_replace("update_", "", $return_url); + $return_url = str_replace('update_', '', $return_url); // Check if delete a comment - if ($item['gravity'] == GRAVITY_COMMENT) { + if ($item['gravity'] == Item::GRAVITY_COMMENT) { if (!empty($item['parent'])) { $parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]); } diff --git a/mod/message.php b/mod/message.php index a07c8b449..e8fe60fd3 100644 --- a/mod/message.php +++ b/mod/message.php @@ -43,23 +43,23 @@ function message_init(App $a) } $new = [ - 'label' => DI::l10n()->t('New Message'), - 'url' => 'message/new', - 'sel' => DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new', + 'label' => DI::l10n()->t('New Message'), + 'url' => 'message/new', + 'sel' => DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new', 'accesskey' => 'm', ]; $tpl = Renderer::getMarkupTemplate('message_side.tpl'); DI::page()['aside'] = Renderer::replaceMacros($tpl, [ '$tabs' => $tabs, - '$new' => $new, + '$new' => $new, ]); $base = DI::baseUrl(); $head_tpl = Renderer::getMarkupTemplate('message-head.tpl'); DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [ '$baseurl' => DI::baseUrl()->get(true), - '$base' => $base + '$base' => $base ]); } @@ -83,12 +83,15 @@ function message_post(App $a) notice(DI::l10n()->t('No recipient selected.')); $norecip = true; break; + case -2: notice(DI::l10n()->t('Unable to locate contact information.')); break; + case -3: notice(DI::l10n()->t('Message could not be sent.')); break; + case -4: notice(DI::l10n()->t('Message collection failure.')); break; @@ -118,20 +121,20 @@ function message_content(App $a) if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'new') { $button = [ 'label' => DI::l10n()->t('Discard'), - 'url' => '/message', - 'sel' => 'close', + 'url' => '/message', + 'sel' => 'close', ]; } else { $button = [ - 'label' => DI::l10n()->t('New Message'), - 'url' => '/message/new', - 'sel' => 'new', + 'label' => DI::l10n()->t('New Message'), + 'url' => '/message/new', + 'sel' => 'new', 'accesskey' => 'm', ]; } $header = Renderer::replaceMacros($tpl, [ '$messages' => DI::l10n()->t('Messages'), - '$button' => $button, + '$button' => $button, ]); if ((DI::args()->getArgc() == 3) && (DI::args()->getArgv()[1] === 'drop' || DI::args()->getArgv()[1] === 'dropconv')) { @@ -186,19 +189,19 @@ function message_content(App $a) $tpl = Renderer::getMarkupTemplate('prv_message.tpl'); $o .= Renderer::replaceMacros($tpl, [ - '$header' => DI::l10n()->t('Send Private Message'), - '$to' => DI::l10n()->t('To:'), - '$subject' => DI::l10n()->t('Subject:'), - '$subjtxt' => $_REQUEST['subject'] ?? '', - '$text' => $_REQUEST['body'] ?? '', - '$readonly' => '', - '$yourmessage'=> DI::l10n()->t('Your message:'), - '$select' => $select, - '$parent' => '', - '$upload' => DI::l10n()->t('Upload photo'), - '$insert' => DI::l10n()->t('Insert web link'), - '$wait' => DI::l10n()->t('Please wait'), - '$submit' => DI::l10n()->t('Submit') + '$header' => DI::l10n()->t('Send Private Message'), + '$to' => DI::l10n()->t('To:'), + '$subject' => DI::l10n()->t('Subject:'), + '$subjtxt' => $_REQUEST['subject'] ?? '', + '$text' => $_REQUEST['body'] ?? '', + '$readonly' => '', + '$yourmessage' => DI::l10n()->t('Your message:'), + '$select' => $select, + '$parent' => '', + '$upload' => DI::l10n()->t('Upload photo'), + '$insert' => DI::l10n()->t('Insert web link'), + '$wait' => DI::l10n()->t('Please wait'), + '$submit' => DI::l10n()->t('Submit') ]); return $o; } @@ -312,18 +315,18 @@ function message_content(App $a) $from_photo = Contact::getThumb($contact); $mails[] = [ - 'id' => $message['id'], - 'from_name' => $from_name_e, - 'from_url' => $from_url, - 'from_addr' => $contact['addr'] ?? $from_url, - 'sparkle' => $sparkle, + 'id' => $message['id'], + 'from_name' => $from_name_e, + 'from_url' => $from_url, + 'from_addr' => $contact['addr'] ?? $from_url, + 'sparkle' => $sparkle, 'from_photo' => $from_photo, - 'subject' => $subject_e, - 'body' => $body_e, - 'delete' => DI::l10n()->t('Delete message'), - 'to_name' => $to_name_e, - 'date' => DateTimeFormat::local($message['created'], DI::l10n()->t('D, d M Y - g:i A')), - 'ago' => Temporal::getRelativeDate($message['created']), + 'subject' => $subject_e, + 'body' => $body_e, + 'delete' => DI::l10n()->t('Delete message'), + 'to_name' => $to_name_e, + 'date' => DateTimeFormat::local($message['created'], DI::l10n()->t('D, d M Y - g:i A')), + 'ago' => Temporal::getRelativeDate($message['created']), ]; $seen = $message['seen']; @@ -334,28 +337,27 @@ function message_content(App $a) $tpl = Renderer::getMarkupTemplate('mail_display.tpl'); $o = Renderer::replaceMacros($tpl, [ - '$thread_id' => DI::args()->getArgv()[1], + '$thread_id' => DI::args()->getArgv()[1], '$thread_subject' => $message['title'], - '$thread_seen' => $seen, - '$delete' => DI::l10n()->t('Delete conversation'), - '$canreply' => (($unknown) ? false : '1'), - '$unknown_text' => DI::l10n()->t("No secure communications available. You may be able to respond from the sender's profile page."), - '$mails' => $mails, - + '$thread_seen' => $seen, + '$delete' => DI::l10n()->t('Delete conversation'), + '$canreply' => (($unknown) ? false : '1'), + '$unknown_text' => DI::l10n()->t("No secure communications available. You may be able to respond from the sender's profile page."), + '$mails' => $mails, // reply - '$header' => DI::l10n()->t('Send Reply'), - '$to' => DI::l10n()->t('To:'), - '$subject' => DI::l10n()->t('Subject:'), - '$subjtxt' => $message['title'], - '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', - '$yourmessage' => DI::l10n()->t('Your message:'), - '$text' => '', - '$select' => $select, - '$parent' => $parent, - '$upload' => DI::l10n()->t('Upload photo'), - '$insert' => DI::l10n()->t('Insert web link'), - '$submit' => DI::l10n()->t('Submit'), - '$wait' => DI::l10n()->t('Please wait') + '$header' => DI::l10n()->t('Send Reply'), + '$to' => DI::l10n()->t('To:'), + '$subject' => DI::l10n()->t('Subject:'), + '$subjtxt' => $message['title'], + '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', + '$yourmessage' => DI::l10n()->t('Your message:'), + '$text' => '', + '$select' => $select, + '$parent' => $parent, + '$upload' => DI::l10n()->t('Upload photo'), + '$insert' => DI::l10n()->t('Insert web link'), + '$submit' => DI::l10n()->t('Submit'), + '$wait' => DI::l10n()->t('Please wait') ]); return $o; @@ -368,7 +370,7 @@ function message_content(App $a) * @param int $limit * @return array */ -function get_messages(int $uid, int $start, int $limit) +function get_messages(int $uid, int $start, int $limit): array { return DBA::toArray(DBA::p('SELECT m.`id`, @@ -392,21 +394,21 @@ function get_messages(int $uid, int $start, int $limit) c.`url`, c.`thumb`, c.`network`, - m2.`count`, - m2.`mailcreated`, - m2.`mailseen` - FROM `mail` m - JOIN ( - SELECT - `parent-uri`, - MIN(`id`) AS `id`, - COUNT(*) AS `count`, - MAX(`created`) AS `mailcreated`, - MIN(`seen`) AS `mailseen` - FROM `mail` - WHERE `uid` = ? - GROUP BY `parent-uri` - ) m2 ON m.`parent-uri` = m2.`parent-uri` AND m.`id` = m2.`id` + m2.`count`, + m2.`mailcreated`, + m2.`mailseen` + FROM `mail` m + JOIN ( + SELECT + `parent-uri`, + MIN(`id`) AS `id`, + COUNT(*) AS `count`, + MAX(`created`) AS `mailcreated`, + MIN(`seen`) AS `mailseen` + FROM `mail` + WHERE `uid` = ? + GROUP BY `parent-uri` + ) m2 ON m.`parent-uri` = m2.`parent-uri` AND m.`id` = m2.`id` LEFT JOIN `contact` c ON m.`contact-id` = c.`id` WHERE m.`uid` = ? ORDER BY m2.`mailcreated` DESC @@ -414,7 +416,7 @@ function get_messages(int $uid, int $start, int $limit) , $uid, $uid, $start, $limit)); } -function render_messages(array $msg, $t) +function render_messages(array $msg, string $t): string { $a = DI::app(); @@ -444,20 +446,20 @@ function render_messages(array $msg, $t) $from_photo = Contact::getThumb($contact); $rslt .= Renderer::replaceMacros($tpl, [ - '$id' => $rr['id'], - '$from_name' => $participants, - '$from_url' => Contact::magicLink($rr['url']), - '$from_addr' => $contact['addr'] ?? '', - '$sparkle' => ' sparkle', + '$id' => $rr['id'], + '$from_name' => $participants, + '$from_url' => Contact::magicLink($rr['url']), + '$from_addr' => $contact['addr'] ?? '', + '$sparkle' => ' sparkle', '$from_photo' => $from_photo, - '$subject' => $rr['title'], - '$delete' => DI::l10n()->t('Delete conversation'), - '$body' => $body_e, - '$to_name' => $to_name_e, - '$date' => DateTimeFormat::local($rr['mailcreated'], DI::l10n()->t('D, d M Y - g:i A')), - '$ago' => Temporal::getRelativeDate($rr['mailcreated']), - '$seen' => $rr['mailseen'], - '$count' => DI::l10n()->tt('%d message', '%d messages', $rr['count']), + '$subject' => $rr['title'], + '$delete' => DI::l10n()->t('Delete conversation'), + '$body' => $body_e, + '$to_name' => $to_name_e, + '$date' => DateTimeFormat::local($rr['mailcreated'], DI::l10n()->t('D, d M Y - g:i A')), + '$ago' => Temporal::getRelativeDate($rr['mailcreated']), + '$seen' => $rr['mailseen'], + '$count' => DI::l10n()->tt('%d message', '%d messages', $rr['count']), ]); } diff --git a/mod/notes.php b/mod/notes.php index b5bdbf870..e81cedf0b 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -38,7 +38,7 @@ function notes_init(App $a) } -function notes_content(App $a, $update = false) +function notes_content(App $a, bool $update = false) { if (!local_user()) { notice(DI::l10n()->t('Permission denied.')); @@ -60,7 +60,7 @@ function notes_content(App $a, $update = false) $o .= DI::conversation()->statusEditor($x, $a->getContactId()); } - $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT, + $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT, 'contact-id'=> $a->getContactId()]; if (DI::mode()->isMobile()) { diff --git a/mod/oexchange.php b/mod/oexchange.php index 173de0a6b..4eb25a2ab 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -93,8 +93,8 @@ function oexchange_init(App $a) System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/xrd+xml'); } -function oexchange_content(App $a) { - +function oexchange_content(App $a) +{ if (!local_user()) { $o = Login::form(); return $o; @@ -109,7 +109,7 @@ function oexchange_content(App $a) { $description = !empty($_REQUEST['description']) ? trim($_REQUEST['description']) : ''; $tags = !empty($_REQUEST['tags']) ? trim($_REQUEST['tags']) : ''; - $s = \Friendica\Content\Text\BBCode::embedURL($url, true, $title, $description, $tags); + $s = BBCode::embedURL($url, true, $title, $description, $tags); if (!strlen($s)) { return; @@ -119,9 +119,9 @@ function oexchange_content(App $a) { $post['profile_uid'] = local_user(); $post['return'] = '/oexchange/done'; - $post['body'] = Friendica\Content\Text\HTML::toBBCode($s); + $post['body'] = HTML::toBBCode($s); $_REQUEST = $post; - require_once('mod/item.php'); + require_once 'mod/item.php'; item_post($a); } diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 781de3493..345e64924 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -27,7 +27,7 @@ use Friendica\Model\Contact; use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Protocol\ActivityPub; -function ostatus_subscribe_content(App $a) +function ostatus_subscribe_content(App $a): string { if (!local_user()) { notice(DI::l10n()->t('Permission denied.')); @@ -42,7 +42,6 @@ function ostatus_subscribe_content(App $a) $counter = intval($_REQUEST['counter'] ?? 0); if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') { - if ($_REQUEST['url'] == '') { DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact'); return $o . DI::l10n()->t('No contact provided.'); diff --git a/mod/photos.php b/mod/photos.php index 6a4596bf2..d953569ed 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -55,8 +55,8 @@ use Friendica\Util\Temporal; use Friendica\Util\XML; use Friendica\Network\HTTPException; -function photos_init(App $a) { - +function photos_init(App $a) +{ if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { return; } @@ -526,44 +526,40 @@ function photos_post(App $a) foreach ($taginfo as $tagged) { $uri = Item::newURI(); - $arr = []; - $arr['guid'] = System::createUUID(); - $arr['uid'] = $page_owner_uid; - $arr['uri'] = $uri; - $arr['wall'] = 1; - $arr['contact-id'] = $owner_record['id']; - $arr['owner-name'] = $owner_record['name']; - $arr['owner-link'] = $owner_record['url']; - $arr['owner-avatar'] = $owner_record['thumb']; - $arr['author-name'] = $owner_record['name']; - $arr['author-link'] = $owner_record['url']; - $arr['author-avatar'] = $owner_record['thumb']; - $arr['title'] = ''; - $arr['allow_cid'] = $photo['allow_cid']; - $arr['allow_gid'] = $photo['allow_gid']; - $arr['deny_cid'] = $photo['deny_cid']; - $arr['deny_gid'] = $photo['deny_gid']; - $arr['visible'] = 0; - $arr['verb'] = Activity::TAG; - $arr['gravity'] = GRAVITY_PARENT; - $arr['object-type'] = Activity\ObjectType::PERSON; - $arr['target-type'] = Activity\ObjectType::IMAGE; - $arr['inform'] = $tagged[2]; - $arr['origin'] = 1; - $arr['body'] = DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ; - $arr['body'] .= "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ; + $arr = [ + 'guid' => System::createUUID(), + 'uid' => $page_owner_uid, + 'uri' => $uri, + 'wall' => 1, + 'contact-id' => $owner_record['id'], + 'owner-name' => $owner_record['name'], + 'owner-link' => $owner_record['url'], + 'owner-avatar' => $owner_record['thumb'], + 'author-name' => $owner_record['name'], + 'author-link' => $owner_record['url'], + 'author-avatar' => $owner_record['thumb'], + 'title' => '', + 'allow_cid' => $photo['allow_cid'], + 'allow_gid' => $photo['allow_gid'], + 'deny_cid' => $photo['deny_cid'], + 'deny_gid' => $photo['deny_gid'], + 'visible' => 0, + 'verb' => Activity::TAG, + 'gravity' => Item::GRAVITY_PARENT, + 'object-type' => Activity\ObjectType::PERSON, + 'target-type' => Activity\ObjectType::IMAGE, + 'inform' => $tagged[2], + 'origin' => 1, + 'body' => DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') . "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . '/photo/' . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n", + 'object' => '' . Activity\ObjectType::PERSON . '' . $tagged[0] . '' . $tagged[1] . '/' . $tagged[0] . '' . XML::escape('' . "\n"), + 'target' => '' . Activity\ObjectType::IMAGE . '' . $photo['desc'] . '' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '' . XML::escape('' . "\n" . '') . '', + ]; - $arr['object'] = '' . Activity\ObjectType::PERSON . '' . $tagged[0] . '' . $tagged[1] . '/' . $tagged[0] . ''; - $arr['object'] .= '' . XML::escape('' . "\n"); if ($tagged[3]) { $arr['object'] .= XML::escape('' . "\n"); } $arr['object'] .= '' . "\n"; - $arr['target'] = '' . Activity\ObjectType::IMAGE . '' . $photo['desc'] . '' - . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ''; - $arr['target'] .= '' . XML::escape('' . "\n" . '') . ''; - Item::insert($arr); } } @@ -1233,7 +1229,7 @@ function photos_content(App $a) $link_item = Post::selectFirst([], ["`resource-id` = ?" . $sql_extra, $datum]); if (!empty($link_item['parent']) && !empty($link_item['uid'])) { - $condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], GRAVITY_COMMENT]; + $condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], Item::GRAVITY_COMMENT]; $total = Post::count($condition); $pager = new Pager(DI::l10n(), DI::args()->getQueryString()); @@ -1404,7 +1400,7 @@ function photos_content(App $a) if (($activity->match($item['verb'], Activity::LIKE) || $activity->match($item['verb'], Activity::DISLIKE)) && - ($item['gravity'] != GRAVITY_PARENT)) { + ($item['gravity'] != Item::GRAVITY_PARENT)) { continue; } @@ -1421,25 +1417,25 @@ function photos_content(App $a) $drop = [ 'dropping' => $dropping, 'pagedrop' => false, - 'select' => DI::l10n()->t('Select'), - 'delete' => DI::l10n()->t('Delete'), + 'select' => DI::l10n()->t('Select'), + 'delete' => DI::l10n()->t('Delete'), ]; $title_e = $item['title']; $body_e = BBCode::convertForUriId($item['uri-id'], $item['body']); $comments .= Renderer::replaceMacros($template,[ - '$id' => $item['id'], + '$id' => $item['id'], '$profile_url' => $profile_url, - '$name' => $item['author-name'], - '$thumb' => $item['author-avatar'], - '$sparkle' => $sparkle, - '$title' => $title_e, - '$body' => $body_e, - '$ago' => Temporal::getRelativeDate($item['created']), - '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''), - '$drop' => $drop, - '$comment' => $comment + '$name' => $item['author-name'], + '$thumb' => $item['author-avatar'], + '$sparkle' => $sparkle, + '$title' => $title_e, + '$body' => $body_e, + '$ago' => Temporal::getRelativeDate($item['created']), + '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''), + '$drop' => $drop, + '$comment' => $comment ]); if (($can_post || Security::canWriteToUserWall($owner_uid))) { diff --git a/mod/tagger.php b/mod/tagger.php index e0d95ce66..4dba34f70 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -123,7 +123,7 @@ EOT; $arr['uid'] = $owner_uid; $arr['contact-id'] = $contact['id']; $arr['wall'] = $item['wall']; - $arr['gravity'] = GRAVITY_COMMENT; + $arr['gravity'] = Item::GRAVITY_COMMENT; $arr['parent'] = $item['id']; $arr['thr-parent'] = $item['uri']; $arr['owner-name'] = $item['author-name']; diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 744e9ed18..03f2502d2 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -36,7 +36,7 @@ use Friendica\Core\Session; use Friendica\Core\Theme; use Friendica\Database\DBA; use Friendica\Model\Contact; -use Friendica\Model\Item as ItemModel; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; @@ -135,7 +135,7 @@ class Conversation return; } - if (!empty($activity['verb']) && $this->activity->match($activity['verb'], $verb) && ($activity['gravity'] != GRAVITY_PARENT)) { + if (!empty($activity['verb']) && $this->activity->match($activity['verb'], $verb) && ($activity['gravity'] != Item::GRAVITY_PARENT)) { $author = [ 'uid' => 0, 'id' => $activity['author-id'], @@ -369,7 +369,7 @@ class Conversation '$permset' => $this->l10n->t('Permission settings'), '$shortpermset' => $this->l10n->t('Permissions'), '$wall' => $notes_cid ? 0 : 1, - '$posttype' => $notes_cid ? ItemModel::PT_PERSONAL_NOTE : ItemModel::PT_ARTICLE, + '$posttype' => $notes_cid ? Item::PT_PERSONAL_NOTE : Item::PT_ARTICLE, '$content' => $x['content'] ?? '', '$post_id' => $x['post_id'] ?? '', '$baseurl' => $this->baseURL->get(true), @@ -641,7 +641,7 @@ class Conversation unset($likebuttons['dislike']); } - $body_html = ItemModel::prepareBody($item, true, $preview); + $body_html = Item::prepareBody($item, true, $preview); [$categories, $folders] = $this->item->determineCategoriesTerms($item, local_user()); @@ -698,7 +698,7 @@ class Conversation 'owner_name' => '', 'owner_url' => '', 'owner_photo' => $this->baseURL->remove($this->item->getOwnerAvatar($item)), - 'plink' => ItemModel::getPlink($item), + 'plink' => Item::getPlink($item), 'edpost' => false, 'pinned' => $pinned, 'isstarred' => 'unstarred', @@ -755,7 +755,7 @@ class Conversation $item['pagedrop'] = $page_dropping; - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $item_object = new PostObject($item); $conv->addParent($item_object); } @@ -825,8 +825,8 @@ class Conversation } if (!empty($activity)) { - if (($row['gravity'] == GRAVITY_PARENT)) { - $row['post-reason'] = ItemModel::PR_ANNOUNCEMENT; + if (($row['gravity'] == Item::GRAVITY_PARENT)) { + $row['post-reason'] = Item::PR_ANNOUNCEMENT; $row = array_merge($row, $activity); $contact = Contact::getById($activity['causer-id'], ['url', 'name', 'thumb']); @@ -834,32 +834,32 @@ class Conversation $row['causer-link'] = $contact['url']; $row['causer-avatar'] = $contact['thumb']; $row['causer-name'] = $contact['name']; - } elseif (($row['gravity'] == GRAVITY_ACTIVITY) && ($row['verb'] == Activity::ANNOUNCE) && + } elseif (($row['gravity'] == Item::GRAVITY_ACTIVITY) && ($row['verb'] == Activity::ANNOUNCE) && ($row['author-id'] == $activity['causer-id'])) { return $row; } } switch ($row['post-reason']) { - case ItemModel::PR_TO: + case Item::PR_TO: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'to')]; break; - case ItemModel::PR_CC: + case Item::PR_CC: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'cc')]; break; - case ItemModel::PR_BTO: + case Item::PR_BTO: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'bto')]; break; - case ItemModel::PR_BCC: + case Item::PR_BCC: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'bcc')]; break; - case ItemModel::PR_FOLLOWER: + case Item::PR_FOLLOWER: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('You are following %s.', $row['causer-name'] ?: $row['author-name'])]; break; - case ItemModel::PR_TAG: + case Item::PR_TAG: $row['direction'] = ['direction' => 4, 'title' => $this->l10n->t('You subscribed to one or more tags in this post.')]; break; - case ItemModel::PR_ANNOUNCEMENT: + case Item::PR_ANNOUNCEMENT: if (!empty($row['causer-id']) && $this->pConfig->get(local_user(), 'system', 'display_resharer')) { $row['owner-id'] = $row['causer-id']; $row['owner-link'] = $row['causer-link']; @@ -867,41 +867,41 @@ class Conversation $row['owner-name'] = $row['causer-name']; } - if (in_array($row['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) && !empty($row['causer-id'])) { + if (in_array($row['gravity'], [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]) && !empty($row['causer-id'])) { $causer = ['uid' => 0, 'id' => $row['causer-id'], 'network' => $row['causer-network'], 'url' => $row['causer-link']]; $row['reshared'] = $this->l10n->t('%s reshared this.', '' . htmlentities($row['causer-name']) . ''); } $row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Reshared') : $this->l10n->t('Reshared by %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case ItemModel::PR_COMMENT: + case Item::PR_COMMENT: $row['direction'] = ['direction' => 5, 'title' => $this->l10n->t('%s is participating in this thread.', $row['author-name'])]; break; - case ItemModel::PR_STORED: + case Item::PR_STORED: $row['direction'] = ['direction' => 8, 'title' => $this->l10n->t('Stored for general reasons')]; break; - case ItemModel::PR_GLOBAL: + case Item::PR_GLOBAL: $row['direction'] = ['direction' => 9, 'title' => $this->l10n->t('Global post')]; break; - case ItemModel::PR_RELAY: + case Item::PR_RELAY: $row['direction'] = ['direction' => 10, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Sent via an relay server') : $this->l10n->t('Sent via the relay server %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case ItemModel::PR_FETCHED: + case Item::PR_FETCHED: $row['direction'] = ['direction' => 2, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Fetched') : $this->l10n->t('Fetched because of %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case ItemModel::PR_COMPLETION: + case Item::PR_COMPLETION: $row['direction'] = ['direction' => 2, 'title' => $this->l10n->t('Stored because of a child post to complete this thread.')]; break; - case ItemModel::PR_DIRECT: + case Item::PR_DIRECT: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('Local delivery')]; break; - case ItemModel::PR_ACTIVITY: + case Item::PR_ACTIVITY: $row['direction'] = ['direction' => 2, 'title' => $this->l10n->t('Stored because of your activity (like, comment, star, ...)')]; break; - case ItemModel::PR_DISTRIBUTE: + case Item::PR_DISTRIBUTE: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('Distributed')]; break; - case ItemModel::PR_PUSHED: + case Item::PR_PUSHED: $row['direction'] = ['direction' => 1, 'title' => $this->l10n->t('Pushed to us')]; break; } @@ -941,7 +941,7 @@ class Conversation $activitycounter = []; foreach ($parents as $parent) { - if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == GRAVITY_ACTIVITY)) { + if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == Item::GRAVITY_ACTIVITY)) { $uriid = $parent['thr-parent-id']; if (!empty($parent['author-id'])) { $activities[$uriid] = ['causer-id' => $parent['author-id']]; @@ -979,7 +979,7 @@ class Conversation $params = ['order' => ['uri-id' => true, 'uid' => true]]; - $thread_items = Post::selectForUser($uid, array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); + $thread_items = Post::selectForUser($uid, array_merge(Item::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); $items = []; @@ -993,10 +993,10 @@ class Conversation } if ($max_comments > 0) { - if (($row['gravity'] == GRAVITY_COMMENT) && (++$commentcounter[$row['parent-uri-id']] > $max_comments)) { + if (($row['gravity'] == Item::GRAVITY_COMMENT) && (++$commentcounter[$row['parent-uri-id']] > $max_comments)) { continue; } - if (($row['gravity'] == GRAVITY_ACTIVITY) && (++$activitycounter[$row['parent-uri-id']] > $max_comments)) { + if (($row['gravity'] == Item::GRAVITY_ACTIVITY) && (++$activitycounter[$row['parent-uri-id']] > $max_comments)) { continue; } } @@ -1025,7 +1025,7 @@ class Conversation $this->profiler->startRecording('rendering'); $children = []; foreach ($item_list as $i => $item) { - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { if ($recursive) { // Fallback to parent-uri if thr-parent is not set $thr_parent = $item['thr-parent-id']; @@ -1182,7 +1182,7 @@ class Conversation // Extract the top level items foreach ($item_array as $item) { - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $parents[] = $item; } } diff --git a/src/Content/Item.php b/src/Content/Item.php index 6cbcb6369..01699aaac 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -331,7 +331,7 @@ class Item $sub_link = $contact_url = $pm_url = $status_link = ''; $photos_link = $posts_link = $block_link = $ignore_link = ''; - if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self'] && !$item['mention']) { + if (local_user() && local_user() == $item['uid'] && $item['gravity'] == ModelItem::GRAVITY_PARENT && !$item['self'] && !$item['mention']) { $sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;'; } @@ -470,7 +470,7 @@ class Item } $item['inform'] .= 'cid:' . $contact['id']; - if (($item['gravity'] == GRAVITY_COMMENT) || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { + if (($item['gravity'] == ModelItem::GRAVITY_COMMENT) || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { continue; } @@ -492,7 +492,7 @@ class Item } Logger::info('Got inform', ['inform' => $item['inform']]); - if (($item['gravity'] == GRAVITY_PARENT) && !empty($forum_contact) && ($private_forum || $only_to_forum)) { + if (($item['gravity'] == ModelItem::GRAVITY_PARENT) && !empty($forum_contact) && ($private_forum || $only_to_forum)) { // we tagged a forum in a top level post. Now we change the post $item['private'] = $private_forum ? ModelItem::PRIVATE : ModelItem::UNLISTED; @@ -510,7 +510,7 @@ class Item $item['allow_cid'] = ''; $item['allow_gid'] = ''; } - } elseif ($setPermissions && ($item['gravity'] == GRAVITY_PARENT)) { + } elseif ($setPermissions && ($item['gravity'] == ModelItem::GRAVITY_PARENT)) { if (empty($receivers)) { // For security reasons direct posts without any receiver will be posts to yourself $self = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]); diff --git a/src/Core/Protocol.php b/src/Core/Protocol.php index c141bbc54..015612ade 100644 --- a/src/Core/Protocol.php +++ b/src/Core/Protocol.php @@ -22,6 +22,7 @@ namespace Friendica\Core; use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Model\User; use Friendica\Network\HTTPException; use Friendica\Protocol\Activity; @@ -139,7 +140,7 @@ class Protocol // create a follow slap $item = [ 'verb' => Activity::FOLLOW, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'follow' => $contact['url'], 'body' => '', 'title' => '', @@ -191,14 +192,16 @@ class Protocol if (in_array($protocol, [Protocol::OSTATUS, Protocol::DFRN])) { // create an unfollow slap - $item = []; - $item['verb'] = Activity::O_UNFOLLOW; - $item['gravity'] = GRAVITY_ACTIVITY; - $item['follow'] = $contact['url']; - $item['body'] = ''; - $item['title'] = ''; - $item['guid'] = ''; - $item['uri-id'] = 0; + $item = [ + 'verb' => Activity::O_UNFOLLOW, + 'gravity' => Item::GRAVITY_ACTIVITY, + 'follow' => $contact['url'], + 'body' => '', + 'title' => '', + 'guid' => '', + 'uri-id' => 0, + ]; + $slap = OStatus::salmon($item, $user); if (empty($contact['notify'])) { diff --git a/src/Core/Renderer.php b/src/Core/Renderer.php index 879fdfe19..0a86cc6f8 100644 --- a/src/Core/Renderer.php +++ b/src/Core/Renderer.php @@ -48,19 +48,19 @@ class Renderer * beyond are used. */ public static $theme = [ - 'videowidth' => 425, - 'videoheight' => 350, - 'stylesheet' => '', + 'videowidth' => 425, + 'videoheight' => 350, + 'stylesheet' => '', 'template_engine' => 'smarty3', ]; private static $ldelim = [ 'internal' => '', - 'smarty3' => '{{' + 'smarty3' => '{{' ]; private static $rdelim = [ 'internal' => '', - 'smarty3' => '}}' + 'smarty3' => '}}' ]; /** @@ -101,10 +101,10 @@ class Renderer * @param string $file Template to load. * @param string $subDir Subdirectory (Optional) * - * @return string template. + * @return string Template * @throws ServiceUnavailableException */ - public static function getMarkupTemplate($file, $subDir = '') + public static function getMarkupTemplate(string $file, string $subDir = ''): string { DI::profiler()->startRecording('file'); $t = self::getTemplateEngine(); @@ -128,9 +128,11 @@ class Renderer * Register template engine class * * @param string $class + * + * @return void * @throws ServiceUnavailableException */ - public static function registerTemplateEngine($class) + public static function registerTemplateEngine(string $class) { $v = get_class_vars($class); @@ -156,7 +158,7 @@ class Renderer * @return TemplateEngine Template Engine instance * @throws ServiceUnavailableException */ - public static function getTemplateEngine() + public static function getTemplateEngine(): TemplateEngine { $template_engine = (self::$theme['template_engine'] ?? '') ?: 'smarty3'; @@ -185,7 +187,7 @@ class Renderer * * @return string the active template engine */ - public static function getActiveTemplateEngine() + public static function getActiveTemplateEngine(): string { return self::$theme['template_engine']; } @@ -194,8 +196,10 @@ class Renderer * sets the active template engine * * @param string $engine the template engine (default is Smarty3) + * + * @return void */ - public static function setActiveTemplateEngine($engine = 'smarty3') + public static function setActiveTemplateEngine(string $engine = 'smarty3') { self::$theme['template_engine'] = $engine; } @@ -211,7 +215,7 @@ class Renderer * * @return string the right delimiter */ - public static function getTemplateLeftDelimiter($engine = 'smarty3') + public static function getTemplateLeftDelimiter(string $engine = 'smarty3'): string { return self::$ldelim[$engine]; } @@ -227,7 +231,7 @@ class Renderer * * @return string the left delimiter */ - public static function getTemplateRightDelimiter($engine = 'smarty3') + public static function getTemplateRightDelimiter(string $engine = 'smarty3'): string { return self::$rdelim[$engine]; } diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index c0eac95c8..04c218ca0 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -563,7 +563,7 @@ class PostUpdate $items = DBA::p("SELECT `item`.`id`, `item`.`verb` AS `item-verb`, `item-content`.`verb`, `item-activity`.`activity` FROM `item` LEFT JOIN `item-content` ON `item-content`.`uri-id` = `item`.`uri-id` LEFT JOIN `item-activity` ON `item-activity`.`uri-id` = `item`.`uri-id` AND `item`.`gravity` = ? - WHERE `item`.`id` >= ? AND `item`.`vid` IS NULL ORDER BY `item`.`id` LIMIT 10000", GRAVITY_ACTIVITY, $id); + WHERE `item`.`id` >= ? AND `item`.`vid` IS NULL ORDER BY `item`.`id` LIMIT 10000", Item::GRAVITY_ACTIVITY, $id); if (DBA::errorNo() != 0) { Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]); diff --git a/src/Factory/Api/Friendica/Activities.php b/src/Factory/Api/Friendica/Activities.php index 102ae382d..0793203ad 100644 --- a/src/Factory/Api/Friendica/Activities.php +++ b/src/Factory/Api/Friendica/Activities.php @@ -23,6 +23,7 @@ namespace Friendica\Factory\Api\Friendica; use Friendica\BaseFactory; use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Network\HTTPException; use Friendica\Protocol\Activity; @@ -62,7 +63,7 @@ class Activities extends BaseFactory 'announce' => [], ]; - $condition = ['uid' => $uid, 'thr-parent-id' => $uriId, 'gravity' => GRAVITY_ACTIVITY]; + $condition = ['uid' => $uid, 'thr-parent-id' => $uriId, 'gravity' => Item::GRAVITY_ACTIVITY]; $ret = Post::selectForUser($uid, ['author-id', 'verb'], $condition); diff --git a/src/Factory/Api/Friendica/Photo.php b/src/Factory/Api/Friendica/Photo.php index dad90d13f..2621a7830 100644 --- a/src/Factory/Api/Friendica/Photo.php +++ b/src/Factory/Api/Friendica/Photo.php @@ -25,6 +25,7 @@ use Friendica\App\BaseURL; use Friendica\BaseFactory; use Friendica\Database\DBA; use Friendica\Factory\Api\Twitter\Status; +use Friendica\Model\Item; use Friendica\Model\Photo as ModelPhoto; use Friendica\Model\Post; use Friendica\Network\HTTPException; @@ -116,7 +117,7 @@ class Photo extends BaseFactory // retrieve comments on photo $condition = ["`parent` = ? AND `uid` = ? AND `gravity` IN (?, ?)", - $item['parent'], $uid, GRAVITY_PARENT, GRAVITY_COMMENT]; + $item['parent'], $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]; $statuses = Post::selectForUser($uid, [], $condition); diff --git a/src/Factory/Api/Mastodon/ScheduledStatus.php b/src/Factory/Api/Mastodon/ScheduledStatus.php index 83c1156b2..019549854 100644 --- a/src/Factory/Api/Mastodon/ScheduledStatus.php +++ b/src/Factory/Api/Mastodon/ScheduledStatus.php @@ -24,6 +24,7 @@ namespace Friendica\Factory\Api\Mastodon; use Friendica\BaseFactory; use Friendica\Database\Database; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\ItemURI; use Friendica\Model\Photo; use Friendica\Model\Post; @@ -69,7 +70,7 @@ class ScheduledStatus extends BaseFactory $media_attachments[] = DI::mstdnAttachment()->createFromPhoto($id); } - if (isset($parameters['item']['thr-parent']) && ($parameters['item']['gravity'] ?? GRAVITY_PARENT != GRAVITY_PARENT)) { + if (isset($parameters['item']['thr-parent']) && ($parameters['item']['gravity'] ?? Item::GRAVITY_PARENT != Item::GRAVITY_PARENT)) { $in_reply_to_id = ItemURI::getIdByURI($parameters['item']['thr-parent']); } else { $in_reply_to_id = null; diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 0cce6cb03..21ecee0f9 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -26,6 +26,7 @@ use Friendica\Content\ContactSelector; use Friendica\Content\Text\BBCode; use Friendica\Database\Database; use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag as TagModel; use Friendica\Model\Verb; @@ -94,19 +95,19 @@ class Status extends BaseFactory $count_announce = Post::countPosts([ 'thr-parent-id' => $uriId, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'vid' => Verb::getID(Activity::ANNOUNCE), 'deleted' => false ], []); $count_like = Post::countPosts([ 'thr-parent-id' => $uriId, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'vid' => Verb::getID(Activity::LIKE), 'deleted' => false ], []); $counts = new \Friendica\Object\Api\Mastodon\Status\Counts( - Post::countPosts(['thr-parent-id' => $uriId, 'gravity' => GRAVITY_COMMENT, 'deleted' => false], []), + Post::countPosts(['thr-parent-id' => $uriId, 'gravity' => Item::GRAVITY_COMMENT, 'deleted' => false], []), $count_announce, $count_like ); @@ -115,7 +116,7 @@ class Status extends BaseFactory 'thr-parent-id' => $uriId, 'uid' => $uid, 'origin' => true, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'vid' => Verb::getID(Activity::LIKE), 'deleted' => false ]); @@ -123,7 +124,7 @@ class Status extends BaseFactory 'thr-parent-id' => $uriId, 'uid' => $uid, 'origin' => true, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'vid' => Verb::getID(Activity::ANNOUNCE), 'deleted' => false ]); @@ -131,7 +132,7 @@ class Status extends BaseFactory $origin_like, $origin_announce, Post\ThreadUser::getIgnored($uriId, $uid), - (bool)($item['starred'] && ($item['gravity'] == GRAVITY_PARENT)), + (bool)($item['starred'] && ($item['gravity'] == Item::GRAVITY_PARENT)), $item['featured'] ); diff --git a/src/Factory/Api/Twitter/Status.php b/src/Factory/Api/Twitter/Status.php index 123fd3dcf..a3ced8e58 100644 --- a/src/Factory/Api/Twitter/Status.php +++ b/src/Factory/Api/Twitter/Status.php @@ -128,7 +128,7 @@ class Status extends BaseFactory $owner = $this->twitterUser->createFromContactId($item['owner-id'], $uid, true); } - $friendica_comments = Post::countPosts(['thr-parent-id' => $item['uri-id'], 'deleted' => false, 'gravity' => GRAVITY_COMMENT]); + $friendica_comments = Post::countPosts(['thr-parent-id' => $item['uri-id'], 'deleted' => false, 'gravity' => Item::GRAVITY_COMMENT]); $text = ''; $title = ''; @@ -162,7 +162,7 @@ class Status extends BaseFactory 'thr-parent-id' => $item['uri-id'], 'uid' => $uid, 'origin' => true, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => Item::GRAVITY_ACTIVITY, 'vid' => Verb::getID(Activity::LIKE), 'deleted' => false ]); diff --git a/src/Factory/Api/Twitter/User.php b/src/Factory/Api/Twitter/User.php index 6d4b8784e..d8bd21c29 100644 --- a/src/Factory/Api/Twitter/User.php +++ b/src/Factory/Api/Twitter/User.php @@ -69,7 +69,7 @@ class User extends BaseFactory if (!$skip_status) { $post = Post::selectFirstPost(['uri-id'], - ['author-id' => $publicContact['id'], 'gravity' => [GRAVITY_COMMENT, GRAVITY_PARENT], 'private' => [Item::PUBLIC, Item::UNLISTED]], + ['author-id' => $publicContact['id'], 'gravity' => [Item::GRAVITY_COMMENT, Item::GRAVITY_PARENT], 'private' => [Item::PUBLIC, Item::UNLISTED]], ['order' => ['uri-id' => true]]); if (!empty($post['uri-id'])) { $status = $this->status->createFromUriId($post['uri-id'], $uid)->toArray(); diff --git a/src/Model/APContact.php b/src/Model/APContact.php index 043f33c31..7b49bab8a 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -28,6 +28,7 @@ use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPException; use Friendica\Network\Probe; @@ -495,13 +496,13 @@ class APContact private static function getStatusesCount(array $owner): int { $condition = [ - 'private' => [Item::PUBLIC, Item::UNLISTED], + 'private' => [Item::PUBLIC, Item::UNLISTED], 'author-id' => Contact::getIdForURL($owner['url'], 0, false), - 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], + 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'network' => Protocol::DFRN, 'parent-network' => Protocol::FEDERATED, 'deleted' => false, - 'visible' => true + 'visible' => true, ]; $count = Post::countPosts($condition); diff --git a/src/Model/Contact.php b/src/Model/Contact.php index ceaf635df..af8151e85 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1506,10 +1506,10 @@ class Contact if ($thread_mode) { $condition = ["((`$contact_field` = ? AND `gravity` = ?) OR (`author-id` = ? AND `gravity` = ? AND `vid` = ? AND `thr-parent-id` = `parent-uri-id`)) AND " . $sql, - $cid, GRAVITY_PARENT, $cid, GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), local_user()]; + $cid, Item::GRAVITY_PARENT, $cid, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), local_user()]; } else { $condition = ["`$contact_field` = ? AND `gravity` IN (?, ?) AND " . $sql, - $cid, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()]; + $cid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, local_user()]; } if (!empty($parent)) { diff --git a/src/Model/FContact.php b/src/Model/FContact.php index ae6c9cb31..c72ee5e5e 100644 --- a/src/Model/FContact.php +++ b/src/Model/FContact.php @@ -26,6 +26,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; @@ -105,27 +106,27 @@ class FContact $interacted = DBA::count('contact-relation', ["`cid` = ? AND NOT `follows` AND `last-interaction` > ?", $contact['id'], $last_interaction]); $interacting = DBA::count('contact-relation', ["`relation-cid` = ? AND NOT `follows` AND `last-interaction` > ?", $contact['id'], $last_interaction]); - $posts = DBA::count('post', ['author-id' => $contact['id'], 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]); + $posts = DBA::count('post', ['author-id' => $contact['id'], 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]]); } $fields = [ - 'name' => $arr['name'], - 'photo' => $arr['photo'], - 'request' => $arr['request'], - 'nick' => $arr['nick'], - 'addr' => strtolower($arr['addr']), - 'guid' => $arr['guid'], - 'batch' => $arr['batch'], - 'notify' => $arr['notify'], - 'poll' => $arr['poll'], - 'confirm' => $arr['confirm'], - 'alias' => $arr['alias'], - 'pubkey' => $arr['pubkey'], - 'uri-id' => $uriid, + 'name' => $arr['name'], + 'photo' => $arr['photo'], + 'request' => $arr['request'], + 'nick' => $arr['nick'], + 'addr' => strtolower($arr['addr']), + 'guid' => $arr['guid'], + 'batch' => $arr['batch'], + 'notify' => $arr['notify'], + 'poll' => $arr['poll'], + 'confirm' => $arr['confirm'], + 'alias' => $arr['alias'], + 'pubkey' => $arr['pubkey'], + 'uri-id' => $uriid, 'interacting_count' => $interacting ?? 0, - 'interacted_count' => $interacted ?? 0, - 'post_count' => $posts ?? 0, - 'updated' => DateTimeFormat::utcNow(), + 'interacted_count' => $interacted ?? 0, + 'post_count' => $posts ?? 0, + 'updated' => DateTimeFormat::utcNow(), ]; if (empty($fcontact['created'])) { diff --git a/src/Model/Item.php b/src/Model/Item.php index 381918535..67e93362d 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -146,6 +146,12 @@ class Item const PRIVATE = 1; const UNLISTED = 2; + // Item weight for query ordering + const GRAVITY_PARENT = 0; + const GRAVITY_ACTIVITY = 3; + const GRAVITY_COMMENT = 6; + const GRAVITY_UNKNOWN = 9; + /** * Update existing item entries * @@ -356,7 +362,7 @@ class Item Post\DeliveryData::delete($item['uri-id']); // If it's the parent of a comment thread, kill all the kids - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { self::markForDeletion(['parent' => $item['parent'], 'deleted' => false], $priority); } @@ -463,7 +469,7 @@ class Item } } - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { if (Contact::isSharingByURL($item['owner-link'], $item['uid'], true)) { $contact_id = Contact::getIdForURL($item['owner-link'], $item['uid']); } else { @@ -714,7 +720,7 @@ class Item return 0; } - if ($thread_parent['gravity'] == GRAVITY_PARENT) { + if ($thread_parent['gravity'] == Item::GRAVITY_PARENT) { return $uriid; } @@ -791,17 +797,17 @@ class Item if (isset($item['gravity'])) { return intval($item['gravity']); } elseif ($item['parent-uri-id'] === $item['uri-id']) { - return GRAVITY_PARENT; + return self::GRAVITY_PARENT; } elseif ($activity->match($item['verb'], Activity::POST)) { - return GRAVITY_COMMENT; + return self::GRAVITY_COMMENT; } elseif ($activity->match($item['verb'], Activity::FOLLOW)) { - return GRAVITY_ACTIVITY; + return self::GRAVITY_ACTIVITY; } elseif ($activity->match($item['verb'], Activity::ANNOUNCE)) { - return GRAVITY_ACTIVITY; + return self::GRAVITY_ACTIVITY; } Logger::info('Unknown gravity for verb', ['verb' => $item['verb']]); - return GRAVITY_UNKNOWN; // Should not happen + return self::GRAVITY_UNKNOWN; // Should not happen } /** @@ -965,7 +971,7 @@ class Item return 0; } - if ($item['gravity'] !== GRAVITY_PARENT) { + if ($item['gravity'] !== self::GRAVITY_PARENT) { $toplevel_parent = self::getTopLevelParent($item); if (empty($toplevel_parent)) { return 0; @@ -1178,7 +1184,7 @@ class Item Post::insert($item['uri-id'], $item); - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { Post\Thread::insert($item['uri-id'], $item); } @@ -1187,7 +1193,7 @@ class Item } // Create Diaspora signature - if ($item['origin'] && empty($item['diaspora_signed_text']) && ($item['gravity'] != GRAVITY_PARENT)) { + if ($item['origin'] && empty($item['diaspora_signed_text']) && ($item['gravity'] != self::GRAVITY_PARENT)) { $signed = Diaspora::createCommentSignature($item); if (!empty($signed)) { $item['diaspora_signed_text'] = json_encode($signed); @@ -1227,7 +1233,7 @@ class Item return 0; } - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { $item['post-user-id'] = $post_user_id; Post\ThreadUser::insert($item['uri-id'], $item['uid'], $item); } @@ -1245,7 +1251,7 @@ class Item // update the commented timestamp on the parent if (DI::config()->get('system', 'like_no_comment')) { // Update when it is a comment - $update_commented = in_array($posted_item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]); + $update_commented = in_array($posted_item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT]); } else { // Update when it isn't a follow or tag verb $update_commented = !in_array($posted_item['verb'], [Activity::FOLLOW, Activity::TAG]); @@ -1269,7 +1275,7 @@ class Item } if ($notify) { - if (!\Friendica\Content\Feature::isEnabled($posted_item['uid'], 'explicit_mentions') && ($posted_item['gravity'] == GRAVITY_COMMENT)) { + if (!\Friendica\Content\Feature::isEnabled($posted_item['uid'], 'explicit_mentions') && ($posted_item['gravity'] == self::GRAVITY_COMMENT)) { Tag::createImplicitMentions($posted_item['uri-id'], $posted_item['thr-parent-id']); } Hook::callAll('post_local_end', $posted_item); @@ -1277,7 +1283,7 @@ class Item Hook::callAll('post_remote_end', $posted_item); } - if ($posted_item['gravity'] === GRAVITY_PARENT) { + if ($posted_item['gravity'] === self::GRAVITY_PARENT) { self::addShadow($post_user_id); } else { self::addShadowPost($post_user_id); @@ -1312,7 +1318,7 @@ class Item } // Fill the cache with the rendered content. - if (in_array($posted_item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) && ($posted_item['uid'] == 0)) { + if (in_array($posted_item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT]) && ($posted_item['uid'] == 0)) { self::updateDisplayCache($posted_item['uri-id']); } @@ -1328,7 +1334,7 @@ class Item */ public static function getPostReason(array $item): int { - $actor = ($item['gravity'] == GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id']; + $actor = ($item['gravity'] == self::GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id']; if (empty($item['origin']) && ($item['uid'] != 0) && Contact::isSharing($actor, $item['uid'])) { return self::PR_FOLLOWER; } @@ -1409,7 +1415,7 @@ class Item */ private static function distributeByTags(array $item) { - if (($item['uid'] != 0) || ($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], Protocol::FEDERATED)) { + if (($item['uid'] != 0) || ($item['gravity'] != self::GRAVITY_PARENT) || !in_array($item['network'], Protocol::FEDERATED)) { return; } @@ -1535,7 +1541,7 @@ class Item return 0; } - if (($uid != 0) && ($item['gravity'] == GRAVITY_PARENT)) { + if (($uid != 0) && ($item['gravity'] == self::GRAVITY_PARENT)) { $owner = User::getOwnerDataById($uid); if (($owner['contact-type'] == User::ACCOUNT_TYPE_COMMUNITY) && !Tag::isMentioned($uri_id, $owner['url'])) { Logger::info('Target user is a forum but is not mentioned here, thread will not be stored', ['uid' => $uid, 'uri-id' => $uri_id]); @@ -1552,13 +1558,13 @@ class Item $item = array_merge($item, $fields); - if (($uid != 0) && Contact::isSharing(($item['gravity'] == GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id'], $uid)) { + if (($uid != 0) && Contact::isSharing(($item['gravity'] == Item::GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id'], $uid)) { $item['post-reason'] = self::PR_FOLLOWER; } - $is_reshare = ($item['gravity'] == GRAVITY_ACTIVITY) && ($item['verb'] == Activity::ANNOUNCE); + $is_reshare = ($item['gravity'] == self::GRAVITY_ACTIVITY) && ($item['verb'] == Activity::ANNOUNCE); - if (($uid != 0) && (($item['gravity'] == GRAVITY_PARENT) || $is_reshare) && + if (($uid != 0) && (($item['gravity'] == self::GRAVITY_PARENT) || $is_reshare) && DI::pConfig()->get($uid, 'system', 'accept_only_sharer') == self::COMPLETION_NONE && !in_array($item['post-reason'], [self::PR_FOLLOWER, self::PR_TAG, self::PR_TO, self::PR_CC])) { Logger::info('Contact is not a follower, thread will not be stored', ['author' => $item['author-link'], 'uid' => $uid, 'uri-id' => $uri_id, 'post-reason' => $item['post-reason']]); @@ -1567,7 +1573,7 @@ class Item $causer = $item['causer-id'] ?: $item['author-id']; - if (($uri_id != $item['parent-uri-id']) && ($item['gravity'] == GRAVITY_COMMENT) && !Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => $uid])) { + if (($uri_id != $item['parent-uri-id']) && ($item['gravity'] == self::GRAVITY_COMMENT) && !Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => $uid])) { if (!self::fetchParent($item['parent-uri-id'], $uid, $causer)) { Logger::info('Parent post had not been added', ['uri-id' => $item['parent-uri-id'], 'uid' => $uid, 'causer' => $causer]); return 0; @@ -1708,7 +1714,7 @@ class Item $item['contact-id'] = self::contactId($item); $notify = false; - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { $contact = DBA::selectFirst('contact', [], ['id' => $item['contact-id'], 'self' => false]); if (DBA::isResult($contact)) { $notify = self::isRemoteSelf($contact, $item); @@ -1738,7 +1744,7 @@ class Item private static function addShadow(int $itemid) { $fields = ['uid', 'private', 'visible', 'deleted', 'network', 'uri-id']; - $condition = ['id' => $itemid, 'gravity' => GRAVITY_PARENT]; + $condition = ['id' => $itemid, 'gravity' => self::GRAVITY_PARENT]; $item = Post::selectFirst($fields, $condition); if (!DBA::isResult($item)) { @@ -1806,7 +1812,7 @@ class Item } // Is it a toplevel post? - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { self::addShadow($itemid); return; } @@ -1868,7 +1874,7 @@ class Item return $item['language']; } - if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) || empty($item['body'])) { + if (!in_array($item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT]) || empty($item['body'])) { return ''; } @@ -2148,13 +2154,13 @@ class Item return false; } - $item = Post::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'origin' => false]); + $item = Post::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id, 'gravity' => [self::GRAVITY_PARENT, self::GRAVITY_COMMENT], 'origin' => false]); if (!DBA::isResult($item)) { Logger::debug('Post is an activity or origin or not found at all, quitting here.', ['id' => $item_id]); return false; } - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == self::GRAVITY_PARENT) { if (Tag::isMentioned($item['uri-id'], $owner['url'])) { Logger::info('Mention found in tag.', ['uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]); } else { @@ -2199,7 +2205,7 @@ class Item */ private static function autoReshare(array $item) { - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != self::GRAVITY_PARENT) { return; } @@ -2460,7 +2466,7 @@ class Item } $condition = ["`uid` = ? AND NOT `deleted` AND `gravity` = ?", - $uid, GRAVITY_PARENT]; + $uid, self::GRAVITY_PARENT]; /* * $expire_network_only = save your own wall posts @@ -2667,7 +2673,7 @@ class Item $vids = Verb::getID($activity); } - $condition = ['vid' => $vids, 'deleted' => false, 'gravity' => GRAVITY_ACTIVITY, + $condition = ['vid' => $vids, 'deleted' => false, 'gravity' => self::GRAVITY_ACTIVITY, 'author-id' => $author_id, 'uid' => $item['uid'], 'thr-parent-id' => $uri_id]; $like_item = Post::selectFirst(['id', 'guid', 'verb'], $condition); @@ -2721,7 +2727,7 @@ class Item 'network' => Protocol::DFRN, 'protocol' => Conversation::PARCEL_DIRECT, 'direction' => Conversation::PUSH, - 'gravity' => GRAVITY_ACTIVITY, + 'gravity' => self::GRAVITY_ACTIVITY, 'parent' => $item['id'], 'thr-parent' => $item['uri'], 'owner-id' => $author_id, @@ -2846,9 +2852,9 @@ class Item return $l10n->t('event'); } elseif (!empty($item['resource-id'])) { return $l10n->t('photo'); - } elseif ($item['gravity'] == GRAVITY_ACTIVITY) { + } elseif ($item['gravity'] == self::GRAVITY_ACTIVITY) { return $l10n->t('activity'); - } elseif ($item['gravity'] == GRAVITY_COMMENT) { + } elseif ($item['gravity'] == self::GRAVITY_COMMENT) { return $l10n->t('comment'); } @@ -3593,7 +3599,7 @@ class Item return false; } - if (!empty($item['causer-id']) && ($item['gravity'] === GRAVITY_PARENT) && Contact\User::isIgnored($item['causer-id'], $user_id)) { + if (!empty($item['causer-id']) && ($item['gravity'] === self::GRAVITY_PARENT) && Contact\User::isIgnored($item['causer-id'], $user_id)) { Logger::notice('Causer is ignored by user', ['causer-link' => $item['causer-link'] ?? $item['causer-id'], 'uid' => $user_id, 'item-uri' => $item['uri']]); return false; } diff --git a/src/Model/Nodeinfo.php b/src/Model/Nodeinfo.php index 5ce7f8951..9a4d2bd60 100644 --- a/src/Model/Nodeinfo.php +++ b/src/Model/Nodeinfo.php @@ -25,6 +25,7 @@ use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use stdClass; /** @@ -62,8 +63,8 @@ class Nodeinfo $logger->info('user statistics', $userStats); $posts = DBA::count('post-thread', ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE NOT `deleted` AND `origin`)"]); - $comments = DBA::count('post', ["NOT `deleted` AND `gravity` = ? AND `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)", GRAVITY_COMMENT]); - $config->set('nodeinfo', 'local_posts', $posts); + $comments = DBA::count('post', ["NOT `deleted` AND `gravity` = ? AND `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)", Item::GRAVITY_COMMENT]); + $config->set('nodeinfo', 'local_posts', $posts); $config->set('nodeinfo', 'local_comments', $comments); $logger->info('User actitivy', ['posts' => $posts, 'comments' => $comments]); diff --git a/src/Model/Post.php b/src/Model/Post.php index 4b1d70ae9..e78e0f706 100644 --- a/src/Model/Post.php +++ b/src/Model/Post.php @@ -28,6 +28,7 @@ use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Protocol\Activity; class Post @@ -405,7 +406,7 @@ class Post AND NOT `owner-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `blocked`) AND NOT (`gravity` = ? AND `author-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `ignored`)) AND NOT (`gravity` = ? AND `owner-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `ignored`))", - 0, Contact::SHARING, Contact::FRIEND, GRAVITY_PARENT, 0, $uid, $uid, $uid, GRAVITY_PARENT, $uid, GRAVITY_PARENT, $uid]); + 0, Contact::SHARING, Contact::FRIEND, Item::GRAVITY_PARENT, 0, $uid, $uid, $uid, Item::GRAVITY_PARENT, $uid, Item::GRAVITY_PARENT, $uid]); $select_string = implode(', ', array_map([DBA::class, 'quoteIdentifier'], $selected)); @@ -520,7 +521,7 @@ class Post unset($fields['parent-uri']); unset($fields['parent-uri-id']); - $thread_condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $thread_condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); // To ensure the data integrity we do it in an transaction DBA::transaction(); diff --git a/src/Model/Post/UserNotification.php b/src/Model/Post/UserNotification.php index 4a57ff6ff..108f3c44f 100644 --- a/src/Model/Post/UserNotification.php +++ b/src/Model/Post/UserNotification.php @@ -30,6 +30,7 @@ use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Subscription; use Friendica\Model\Tag; @@ -288,7 +289,7 @@ class UserNotification } // Only create notifications for posts and comments, not for activities - if (($item['gravity'] == GRAVITY_ACTIVITY) && ($item['verb'] != Activity::ANNOUNCE)) { + if (($item['gravity'] == Item::GRAVITY_ACTIVITY) && ($item['verb'] != Activity::ANNOUNCE)) { return; } @@ -310,7 +311,7 @@ class UserNotification */ private static function insertNotificationByItem(int $type, int $uid, array $item): void { - if (($item['verb'] != Activity::ANNOUNCE) && ($item['gravity'] == GRAVITY_ACTIVITY) && + if (($item['verb'] != Activity::ANNOUNCE) && ($item['gravity'] == Item::GRAVITY_ACTIVITY) && !in_array($type, [self::TYPE_DIRECT_COMMENT, self::TYPE_DIRECT_THREAD_COMMENT])) { // Activities are only stored when performed on the user's post or comment return; @@ -321,7 +322,7 @@ class UserNotification $item['vid'], $type, $item['author-id'], - $item['gravity'] == GRAVITY_ACTIVITY ? $item['thr-parent-id'] : $item['uri-id'], + $item['gravity'] == Item::GRAVITY_ACTIVITY ? $item['thr-parent-id'] : $item['uri-id'], $item['parent-uri-id'] ); @@ -423,14 +424,14 @@ class UserNotification private static function checkShared(array $item, int $uid): bool { // Only check on original posts and reshare ("announce") activities, otherwise return - if (($item['gravity'] != GRAVITY_PARENT) && ($item['verb'] != Activity::ANNOUNCE)) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && ($item['verb'] != Activity::ANNOUNCE)) { return false; } // Don't notify about reshares by communities of our own posts or each time someone comments if (($item['verb'] == Activity::ANNOUNCE) && DBA::exists('contact', ['id' => $item['contact-id'], 'contact-type' => Contact::TYPE_COMMUNITY])) { $post = Post::selectFirst(['origin', 'gravity'], ['uri-id' => $item['thr-parent-id'], 'uid' => $uid]); - if ($post['origin'] || ($post['gravity'] != GRAVITY_PARENT)) { + if ($post['origin'] || ($post['gravity'] != Item::GRAVITY_PARENT)) { return false; } } @@ -497,7 +498,7 @@ class UserNotification */ private static function checkCommentedThread(array $item, array $contacts): bool { - $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_PARENT]; + $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_PARENT]; return Post::exists($condition); } @@ -511,7 +512,7 @@ class UserNotification */ private static function checkDirectComment(array $item, array $contacts): bool { - $condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_COMMENT]; + $condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_COMMENT]; return Post::exists($condition); } @@ -525,7 +526,7 @@ class UserNotification */ private static function checkDirectCommentedThread(array $item, array $contacts): bool { - $condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_PARENT]; + $condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_PARENT]; return Post::exists($condition); } @@ -539,7 +540,7 @@ class UserNotification */ private static function checkCommentedParticipation(array $item, array $contacts): bool { - $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_COMMENT]; + $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_COMMENT]; return Post::exists($condition); } @@ -553,7 +554,7 @@ class UserNotification */ private static function checkFollowParticipation(array $item, array $contacts): bool { - $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_ACTIVITY, 'verb' => Activity::FOLLOW]; + $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => Activity::FOLLOW]; return Post::exists($condition); } @@ -567,7 +568,7 @@ class UserNotification */ private static function checkActivityParticipation(array $item, array $contacts): bool { - $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_ACTIVITY]; + $condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => Item::GRAVITY_ACTIVITY]; return Post::exists($condition); } } diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index 96b3f638e..e2328b5e5 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -97,7 +97,7 @@ class Objects extends BaseModule $last_modified = $item['changed']; Network::checkEtagModified($etag, $last_modified); - if (empty($this->parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) { + if (empty($this->parameters['activity']) && ($item['gravity'] != Item::GRAVITY_ACTIVITY)) { $activity = ActivityPub\Transmitter::createCachedActivityFromItem($item['id'], false, true); if (empty($activity['type'])) { throw new HTTPException\NotFoundException(); diff --git a/src/Module/Api/GNUSocial/Statusnet/Conversation.php b/src/Module/Api/GNUSocial/Statusnet/Conversation.php index 98d1de14d..fc52e9fed 100644 --- a/src/Module/Api/GNUSocial/Statusnet/Conversation.php +++ b/src/Module/Api/GNUSocial/Statusnet/Conversation.php @@ -26,6 +26,7 @@ use Friendica\Database\DBA; use Friendica\Module\BaseApi; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Network\HTTPException\BadRequestException; @@ -69,7 +70,7 @@ class Conversation extends BaseApi $id = $parent['id']; $condition = ["`parent` = ? AND `uid` IN (0, ?) AND `gravity` IN (?, ?) AND `uri-id` > ?", - $id, $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id]; + $id, $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id]; if ($max_id > 0) { $condition[0] .= " AND `uri-id` <= ?"; diff --git a/src/Module/Api/Mastodon/Accounts/Statuses.php b/src/Module/Api/Mastodon/Accounts/Statuses.php index 7c75ea5cf..948117212 100644 --- a/src/Module/Api/Mastodon/Accounts/Statuses.php +++ b/src/Module/Api/Mastodon/Accounts/Statuses.php @@ -78,7 +78,7 @@ class Statuses extends BaseApi if (!$request['pinned']) { $condition = DBA::mergeConditions($condition, ["(`gravity` IN (?, ?) OR (`gravity` = ? AND `vid` = ?))", - GRAVITY_PARENT, GRAVITY_COMMENT, GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE)]); + Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE)]); } if ($request['only_media']) { @@ -100,7 +100,7 @@ class Statuses extends BaseApi } if ($request['exclude_replies']) { - $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); } if ($request['pinned']) { diff --git a/src/Module/Api/Mastodon/Favourited.php b/src/Module/Api/Mastodon/Favourited.php index cd6e2bee1..ca21cc62b 100644 --- a/src/Module/Api/Mastodon/Favourited.php +++ b/src/Module/Api/Mastodon/Favourited.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Network\HTTPException; @@ -51,7 +52,7 @@ class Favourited extends BaseApi $params = ['order' => ['thr-parent-id' => true], 'limit' => $request['limit']]; - $condition = ['gravity' => GRAVITY_ACTIVITY, 'origin' => true, 'verb' => Activity::LIKE, 'uid' => $uid]; + $condition = ['gravity' => Item::GRAVITY_ACTIVITY, 'origin' => true, 'verb' => Activity::LIKE, 'uid' => $uid]; if (!empty($request['max_id'])) { $condition = DBA::mergeConditions($condition, ["`thr-parent-id` < ?", $request['max_id']]); diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 4a8c98697..0acc4989b 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -151,13 +151,13 @@ class Statuses extends BaseApi $parent = Post::selectFirst(['uri'], ['uri-id' => $request['in_reply_to_id'], 'uid' => [0, $uid]]); $item['thr-parent'] = $parent['uri']; - $item['gravity'] = GRAVITY_COMMENT; + $item['gravity'] = Item::GRAVITY_COMMENT; $item['object-type'] = Activity\ObjectType::COMMENT; $item['body'] = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $request['spoiler_text'] . "[/abstract]\n" . $item['body']; } else { self::checkThrottleLimit(); - $item['gravity'] = GRAVITY_PARENT; + $item['gravity'] = Item::GRAVITY_PARENT; $item['object-type'] = Activity\ObjectType::NOTE; $item['title'] = $request['spoiler_text']; } diff --git a/src/Module/Api/Mastodon/Statuses/Bookmark.php b/src/Module/Api/Mastodon/Statuses/Bookmark.php index cebb06192..8c9a21a78 100644 --- a/src/Module/Api/Mastodon/Statuses/Bookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Bookmark.php @@ -47,7 +47,7 @@ class Bookmark extends BaseApi DI::mstdnError()->RecordNotFound(); } - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be bookmarked')); } diff --git a/src/Module/Api/Mastodon/Statuses/Context.php b/src/Module/Api/Mastodon/Statuses/Context.php index a15b3c464..08ec094e0 100644 --- a/src/Module/Api/Mastodon/Statuses/Context.php +++ b/src/Module/Api/Mastodon/Statuses/Context.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon\Statuses; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; @@ -55,7 +56,7 @@ class Context extends BaseApi $parent = Post::selectFirst(['parent-uri-id'], ['uri-id' => $id]); if (DBA::isResult($parent)) { $posts = Post::selectPosts(['uri-id', 'thr-parent-id'], - ['parent-uri-id' => $parent['parent-uri-id'], 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]); + ['parent-uri-id' => $parent['parent-uri-id'], 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]]); while ($post = Post::fetch($posts)) { if ($post['uri-id'] == $post['thr-parent-id']) { continue; diff --git a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php index ebf8b6336..30e6ad152 100644 --- a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php +++ b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php @@ -23,6 +23,7 @@ namespace Friendica\Module\Api\Mastodon\Statuses; use Friendica\Core\System; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Protocol\Activity; @@ -48,7 +49,7 @@ class FavouritedBy extends BaseApi DI::mstdnError()->RecordNotFound(); } - $activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $id, 'gravity' => GRAVITY_ACTIVITY, 'verb' => Activity::LIKE]); + $activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $id, 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => Activity::LIKE]); $accounts = []; diff --git a/src/Module/Api/Mastodon/Statuses/Mute.php b/src/Module/Api/Mastodon/Statuses/Mute.php index e98af8ad7..152a249f1 100644 --- a/src/Module/Api/Mastodon/Statuses/Mute.php +++ b/src/Module/Api/Mastodon/Statuses/Mute.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon\Statuses; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; @@ -46,7 +47,7 @@ class Mute extends BaseApi DI::mstdnError()->RecordNotFound(); } - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be muted')); } diff --git a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php index 10fd65a02..39a93de0c 100644 --- a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php +++ b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php @@ -23,6 +23,7 @@ namespace Friendica\Module\Api\Mastodon\Statuses; use Friendica\Core\System; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Protocol\Activity; @@ -48,7 +49,7 @@ class RebloggedBy extends BaseApi DI::mstdnError()->RecordNotFound(); } - $activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $id, 'gravity' => GRAVITY_ACTIVITY, 'verb' => Activity::ANNOUNCE]); + $activities = Post::selectPosts(['author-id'], ['thr-parent-id' => $id, 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => Activity::ANNOUNCE]); $accounts = []; diff --git a/src/Module/Api/Mastodon/Statuses/Unbookmark.php b/src/Module/Api/Mastodon/Statuses/Unbookmark.php index f90916176..d7e06c32d 100644 --- a/src/Module/Api/Mastodon/Statuses/Unbookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Unbookmark.php @@ -47,7 +47,7 @@ class Unbookmark extends BaseApi DI::mstdnError()->RecordNotFound(); } - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be unbookmarked')); } diff --git a/src/Module/Api/Mastodon/Statuses/Unmute.php b/src/Module/Api/Mastodon/Statuses/Unmute.php index 722d70f8d..5cf4ceedb 100644 --- a/src/Module/Api/Mastodon/Statuses/Unmute.php +++ b/src/Module/Api/Mastodon/Statuses/Unmute.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon\Statuses; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; @@ -46,7 +47,7 @@ class Unmute extends BaseApi DI::mstdnError()->RecordNotFound(); } - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be unmuted')); } diff --git a/src/Module/Api/Mastodon/Timelines/Home.php b/src/Module/Api/Mastodon/Timelines/Home.php index 494351db2..3a18baecb 100644 --- a/src/Module/Api/Mastodon/Timelines/Home.php +++ b/src/Module/Api/Mastodon/Timelines/Home.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon\Timelines; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Network\HTTPException; @@ -55,7 +56,7 @@ class Home extends BaseApi $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']]; - $condition = ['gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'uid' => $uid]; + $condition = ['gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'uid' => $uid]; if ($request['local']) { $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]); @@ -85,7 +86,7 @@ class Home extends BaseApi } if ($request['exclude_replies']) { - $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); } $items = Post::selectForUser($uid, ['uri-id'], $condition, $params); diff --git a/src/Module/Api/Mastodon/Timelines/ListTimeline.php b/src/Module/Api/Mastodon/Timelines/ListTimeline.php index 011f66ac1..c786e3d9d 100644 --- a/src/Module/Api/Mastodon/Timelines/ListTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/ListTimeline.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Mastodon\Timelines; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Network\HTTPException; @@ -60,7 +61,7 @@ class ListTimeline extends BaseApi $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']]; $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)", - $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $this->parameters['id']]; + $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $this->parameters['id']]; if (!empty($request['max_id'])) { $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]); @@ -82,7 +83,7 @@ class ListTimeline extends BaseApi } if ($request['exclude_replies']) { - $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); } if ($request['local']) { diff --git a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php index d34deac07..cc2392caf 100644 --- a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php @@ -57,7 +57,7 @@ class PublicTimeline extends BaseApi $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']]; - $condition = ['gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => Item::PUBLIC, + $condition = ['gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'private' => Item::PUBLIC, 'network' => Protocol::FEDERATED, 'parent-author-blocked' => false, 'parent-author-hidden' => false]; if ($request['local']) { @@ -87,7 +87,7 @@ class PublicTimeline extends BaseApi } if ($request['exclude_replies']) { - $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); } if (!empty($uid)) { diff --git a/src/Module/Api/Mastodon/Timelines/Tag.php b/src/Module/Api/Mastodon/Timelines/Tag.php index 541afa160..bc4464b56 100644 --- a/src/Module/Api/Mastodon/Timelines/Tag.php +++ b/src/Module/Api/Mastodon/Timelines/Tag.php @@ -25,6 +25,7 @@ use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseApi; use Friendica\Network\HTTPException; @@ -85,7 +86,7 @@ class Tag extends BaseApi } if ($request['exclude_replies']) { - $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]); + $condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]); } if (!empty($request['max_id'])) { diff --git a/src/Module/Api/Twitter/Favorites.php b/src/Module/Api/Twitter/Favorites.php index ea7ca42d5..1e5dbed5b 100644 --- a/src/Module/Api/Twitter/Favorites.php +++ b/src/Module/Api/Twitter/Favorites.php @@ -23,6 +23,7 @@ namespace Friendica\Module\Api\Twitter; use Friendica\Core\Logger; use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Module\BaseApi; use Friendica\DI; use Friendica\Model\Contact; @@ -54,7 +55,7 @@ class Favorites extends BaseApi $start = max(0, ($page - 1) * $count); $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `uri-id` > ? AND `starred`", - $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id]; + $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id]; $params = ['order' => ['uri-id' => true], 'limit' => [$start, $count]]; diff --git a/src/Module/Api/Twitter/Lists/Statuses.php b/src/Module/Api/Twitter/Lists/Statuses.php index 177c5fd0b..42fd11c36 100644 --- a/src/Module/Api/Twitter/Lists/Statuses.php +++ b/src/Module/Api/Twitter/Lists/Statuses.php @@ -26,10 +26,11 @@ use Friendica\Core\L10n; use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\Factory\Api\Twitter\Status as TwitterStatus; -use Friendica\Module\BaseApi; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\Api\ApiResponse; +use Friendica\Module\BaseApi; use Friendica\Network\HTTPException; use Friendica\Util\Profiler; use Psr\Log\LoggerInterface; @@ -77,7 +78,7 @@ class Statuses extends BaseApi $groups = $this->dba->selectToArray('group_member', ['contact-id'], ['gid' => $request['list_id']]); $gids = array_column($groups, 'contact-id'); - $condition = ['uid' => $uid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'contact-id' => $gids]; + $condition = ['uid' => $uid, 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'contact-id' => $gids]; $condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $since_id]); if ($max_id > 0) { @@ -86,7 +87,7 @@ class Statuses extends BaseApi } if ($exclude_replies) { $condition[0] .= ' AND `gravity` = ?'; - $condition[] = GRAVITY_PARENT; + $condition[] = Item::GRAVITY_PARENT; } if ($conversation_id > 0) { $condition[0] .= " AND `parent-uri-id` = ?"; diff --git a/src/Module/Api/Twitter/Search/Tweets.php b/src/Module/Api/Twitter/Search/Tweets.php index db25c4eb9..68876c320 100644 --- a/src/Module/Api/Twitter/Search/Tweets.php +++ b/src/Module/Api/Twitter/Search/Tweets.php @@ -78,13 +78,13 @@ class Tweets extends BaseApi $condition = ['uri-id' => $uriids]; if ($exclude_replies) { - $condition['gravity'] = GRAVITY_PARENT; + $condition['gravity'] = Item::GRAVITY_PARENT; } $params['group_by'] = ['uri-id']; } else { $condition = ["`uri-id` > ? - " . ($exclude_replies ? " AND `gravity` = " . GRAVITY_PARENT : ' ') . " + " . ($exclude_replies ? " AND `gravity` = " . Item::GRAVITY_PARENT : ' ') . " AND (`uid` = 0 OR (`uid` = ? AND NOT `global`)) AND `body` LIKE CONCAT('%',?,'%')", $since_id, $uid, $_REQUEST['q']]; diff --git a/src/Module/Api/Twitter/Statuses/HomeTimeline.php b/src/Module/Api/Twitter/Statuses/HomeTimeline.php index a607d4c95..30fecd4c7 100644 --- a/src/Module/Api/Twitter/Statuses/HomeTimeline.php +++ b/src/Module/Api/Twitter/Statuses/HomeTimeline.php @@ -54,7 +54,7 @@ class HomeTimeline extends BaseApi $start = max(0, ($page - 1) * $count); $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `uri-id` > ?", - $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id]; + $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id]; if ($max_id > 0) { $condition[0] .= " AND `uri-id` <= ?"; @@ -62,7 +62,7 @@ class HomeTimeline extends BaseApi } if ($exclude_replies) { $condition[0] .= ' AND `gravity` = ?'; - $condition[] = GRAVITY_PARENT; + $condition[] = Item::GRAVITY_PARENT; } if ($conversation_id > 0) { $condition[0] .= " AND `parent-uri-id` = ?"; diff --git a/src/Module/Api/Twitter/Statuses/Mentions.php b/src/Module/Api/Twitter/Statuses/Mentions.php index 800a91110..69aeedba6 100644 --- a/src/Module/Api/Twitter/Statuses/Mentions.php +++ b/src/Module/Api/Twitter/Statuses/Mentions.php @@ -24,6 +24,7 @@ namespace Friendica\Module\Api\Twitter\Statuses; use Friendica\Database\DBA; use Friendica\Module\BaseApi; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Contact; use Friendica\Model\Post; @@ -55,7 +56,7 @@ class Mentions extends BaseApi AND (`uid` = 0 OR (`uid` = ? AND NOT `global`)) AND `uri-id` > ?"; $condition = [ - GRAVITY_PARENT, GRAVITY_COMMENT, + Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $uid, Post\UserNotification::TYPE_EXPLICIT_TAGGED | Post\UserNotification::TYPE_IMPLICIT_TAGGED | Post\UserNotification::TYPE_THREAD_COMMENT | Post\UserNotification::TYPE_DIRECT_COMMENT | diff --git a/src/Module/Api/Twitter/Statuses/NetworkPublicTimeline.php b/src/Module/Api/Twitter/Statuses/NetworkPublicTimeline.php index 96469fb43..ab4de33d4 100644 --- a/src/Module/Api/Twitter/Statuses/NetworkPublicTimeline.php +++ b/src/Module/Api/Twitter/Statuses/NetworkPublicTimeline.php @@ -47,7 +47,7 @@ class NetworkPublicTimeline extends BaseApi $start = max(0, ($page - 1) * $count); $condition = ["`uid` = 0 AND `gravity` IN (?, ?) AND `uri-id` > ? AND `private` = ?", - GRAVITY_PARENT, GRAVITY_COMMENT, $since_id, Item::PUBLIC]; + Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id, Item::PUBLIC]; if ($max_id > 0) { $condition[0] .= " AND `uri-id` <= ?"; diff --git a/src/Module/Api/Twitter/Statuses/PublicTimeline.php b/src/Module/Api/Twitter/Statuses/PublicTimeline.php index a247e6688..e38bfa66a 100644 --- a/src/Module/Api/Twitter/Statuses/PublicTimeline.php +++ b/src/Module/Api/Twitter/Statuses/PublicTimeline.php @@ -53,7 +53,7 @@ class PublicTimeline extends BaseApi if ($exclude_replies && !$conversation_id) { $condition = ["`gravity` = ? AND `uri-id` > ? AND `private` = ? AND `wall` AND NOT `author-hidden`", - GRAVITY_PARENT, $since_id, Item::PUBLIC]; + Item::GRAVITY_PARENT, $since_id, Item::PUBLIC]; if ($max_id > 0) { $condition[0] .= " AND `uri-id` <= ?"; @@ -64,7 +64,7 @@ class PublicTimeline extends BaseApi $statuses = Post::selectForUser($uid, [], $condition, $params); } else { $condition = ["`gravity` IN (?, ?) AND `uri-id` > ? AND `private` = ? AND `wall` AND `origin` AND NOT `author-hidden`", - GRAVITY_PARENT, GRAVITY_COMMENT, $since_id, Item::PUBLIC]; + Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id, Item::PUBLIC]; if ($max_id > 0) { $condition[0] .= " AND `uri-id` <= ?"; diff --git a/src/Module/Api/Twitter/Statuses/Show.php b/src/Module/Api/Twitter/Statuses/Show.php index 16bf46267..7f5340c5b 100644 --- a/src/Module/Api/Twitter/Statuses/Show.php +++ b/src/Module/Api/Twitter/Statuses/Show.php @@ -26,6 +26,7 @@ use Friendica\Database\DBA; use Friendica\Module\BaseApi; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Network\HTTPException\BadRequestException; @@ -60,10 +61,10 @@ class Show extends BaseApi $item_id = $item['id']; if ($conversation) { - $condition = ['parent' => $item_id, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]; + $condition = ['parent' => $item_id, 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]]; $params = ['order' => ['uri-id' => true]]; } else { - $condition = ['id' => $item_id, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]; + $condition = ['id' => $item_id, 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]]; $params = []; } diff --git a/src/Module/Api/Twitter/Statuses/Update.php b/src/Module/Api/Twitter/Statuses/Update.php index 0041c03a7..d071675e8 100644 --- a/src/Module/Api/Twitter/Statuses/Update.php +++ b/src/Module/Api/Twitter/Statuses/Update.php @@ -113,12 +113,12 @@ class Update extends BaseApi $parent = Post::selectFirst(['uri'], ['uri-id' => $request['in_reply_to_status_id'], 'uid' => [0, $uid]]); $item['thr-parent'] = $parent['uri']; - $item['gravity'] = GRAVITY_COMMENT; + $item['gravity'] = Item::GRAVITY_COMMENT; $item['object-type'] = Activity\ObjectType::COMMENT; } else { self::checkThrottleLimit(); - $item['gravity'] = GRAVITY_PARENT; + $item['gravity'] = Item::GRAVITY_PARENT; $item['object-type'] = Activity\ObjectType::NOTE; } diff --git a/src/Module/Api/Twitter/Statuses/UserTimeline.php b/src/Module/Api/Twitter/Statuses/UserTimeline.php index a6616636c..088f10600 100644 --- a/src/Module/Api/Twitter/Statuses/UserTimeline.php +++ b/src/Module/Api/Twitter/Statuses/UserTimeline.php @@ -23,10 +23,11 @@ namespace Friendica\Module\Api\Twitter\Statuses; use Friendica\Core\Logger; use Friendica\Database\DBA; -use Friendica\Module\BaseApi; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; +use Friendica\Module\BaseApi; /** * Returns the most recent statuses posted by the user. @@ -54,11 +55,11 @@ class UserTimeline extends BaseApi $start = max(0, ($page - 1) * $count); $condition = ["(`uid` = ? OR (`uid` = ? AND NOT `global`)) AND `gravity` IN (?, ?) AND `uri-id` > ? AND `author-id` = ?", - 0, $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id, $cid]; + 0, $uid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, $since_id, $cid]; if ($exclude_replies) { $condition[0] .= ' AND `gravity` = ?'; - $condition[] = GRAVITY_PARENT; + $condition[] = Item::GRAVITY_PARENT; } if ($conversation_id > 0) { diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index 1ed0b9033..47557928a 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -29,6 +29,7 @@ use Friendica\Core\Logger; use Friendica\Core\System; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\User; use Friendica\Module\Api\ApiResponse; @@ -233,7 +234,7 @@ class BaseApi extends BaseModule if ($throttle_day > 0) { $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60); - $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", GRAVITY_PARENT, $uid, $datefrom]; + $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", Item::GRAVITY_PARENT, $uid, $datefrom]; $posts_day = Post::countThread($condition); if ($posts_day > $throttle_day) { @@ -249,7 +250,7 @@ class BaseApi extends BaseModule if ($throttle_week > 0) { $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*7); - $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", GRAVITY_PARENT, $uid, $datefrom]; + $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", Item::GRAVITY_PARENT, $uid, $datefrom]; $posts_week = Post::countThread($condition); if ($posts_week > $throttle_week) { @@ -265,7 +266,7 @@ class BaseApi extends BaseModule if ($throttle_month > 0) { $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*30); - $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", GRAVITY_PARENT, $uid, $datefrom]; + $condition = ["`gravity` = ? AND `uid` = ? AND `wall` AND `received` > ?", Item::GRAVITY_PARENT, $uid, $datefrom]; $posts_month = Post::countThread($condition); if ($posts_month > $throttle_month) { diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index c36876b34..e32226954 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -414,7 +414,7 @@ class Network extends BaseModule } elseif (self::$forumContactId) { $conditionStrings = DBA::mergeConditions($conditionStrings, ["((`contact-id` = ?) OR `uri-id` IN (SELECT `parent-uri-id` FROM `post-user-view` WHERE (`contact-id` = ? AND `gravity` = ? AND `vid` = ? AND `uid` = ?)))", - self::$forumContactId, self::$forumContactId, GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), local_user()]); + self::$forumContactId, self::$forumContactId, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), local_user()]); } // Currently only the order modes "received" and "commented" are in use diff --git a/src/Module/Diaspora/Fetch.php b/src/Module/Diaspora/Fetch.php index bcb6ba0ca..fb8b7a65e 100644 --- a/src/Module/Diaspora/Fetch.php +++ b/src/Module/Diaspora/Fetch.php @@ -49,7 +49,7 @@ class Fetch extends BaseModule // Fetch the item $condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid, - 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]]; + 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]]; $item = Post::selectFirst([], $condition); if (empty($item)) { $condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]]; @@ -76,7 +76,7 @@ class Fetch extends BaseModule throw new HTTPException\NotFoundException(); } - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $status = Diaspora::buildStatus($item, $user); } else { $status = ['type' => 'comment', 'message' => Diaspora::createCommentSignature($item)]; diff --git a/src/Module/Item/Ignore.php b/src/Module/Item/Ignore.php index 626d6bb50..4ccc559eb 100644 --- a/src/Module/Item/Ignore.php +++ b/src/Module/Item/Ignore.php @@ -25,6 +25,7 @@ use Friendica\BaseModule; use Friendica\Core\Session; use Friendica\Core\System; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Network\HTTPException; @@ -49,7 +50,7 @@ class Ignore extends BaseModule $dba = DI::dba(); - $thread = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId, 'gravity' => GRAVITY_PARENT]); + $thread = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId, 'gravity' => Item::GRAVITY_PARENT]); if (!$dba->isResult($thread)) { throw new HTTPException\NotFoundException(); } diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index d851d5f47..469677fec 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -176,7 +176,7 @@ class Status extends BaseProfile $condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR (`gravity` = ? AND `vid` = ? AND `origin` AND `thr-parent-id` IN (SELECT `uri-id` FROM `post` WHERE `gravity` = ? AND `network` = ?)))", - GRAVITY_PARENT, GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), GRAVITY_PARENT, Protocol::ACTIVITYPUB]); + GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]); $condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED, 'visible' => true, 'deleted' => false]); diff --git a/src/Module/Update/Network.php b/src/Module/Update/Network.php index 6282028e6..6d452b70c 100644 --- a/src/Module/Update/Network.php +++ b/src/Module/Update/Network.php @@ -23,6 +23,7 @@ namespace Friendica\Module\Update; use Friendica\Core\System; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\Conversation\Network as NetworkModule; @@ -55,7 +56,7 @@ class Network extends NetworkModule } elseif (self::$order === 'received') { // Only load new toplevel posts $conditionFields['unseen'] = true; - $conditionFields['gravity'] = GRAVITY_PARENT; + $conditionFields['gravity'] = Item::GRAVITY_PARENT; } else { // Load all unseen items $conditionFields['unseen'] = true; diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index 50d0eddd1..b7dae9ec1 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -72,7 +72,7 @@ class Profile extends BaseModule $condition = ["`uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending` AND `visible` AND (NOT `deleted` OR `gravity` = ?) - AND `wall` " . $sql_extra, $a->getProfileOwner(), GRAVITY_ACTIVITY]; + AND `wall` " . $sql_extra, $a->getProfileOwner(), Item::GRAVITY_ACTIVITY]; if ($_GET['force'] && !empty($_GET['item'])) { // When the parent is provided, we only fetch this diff --git a/src/Navigation/Notifications/Factory/FormattedNotify.php b/src/Navigation/Notifications/Factory/FormattedNotify.php index d4aba639c..8f0fc5bb1 100644 --- a/src/Navigation/Notifications/Factory/FormattedNotify.php +++ b/src/Navigation/Notifications/Factory/FormattedNotify.php @@ -29,6 +29,7 @@ use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Database\Database; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Module\BaseNotifications; use Friendica\Navigation\Notifications\Collection\FormattedNotifies; @@ -363,13 +364,13 @@ class FormattedNotify extends BaseFactory $item['author-avatar'] = $item['contact-avatar']; } - $item['label'] = (($item['gravity'] == GRAVITY_PARENT) ? 'post' : 'comment'); + $item['label'] = (($item['gravity'] == Item::GRAVITY_PARENT) ? 'post' : 'comment'); $item['link'] = $this->baseUrl->get(true) . '/display/' . $item['parent-guid']; $item['image'] = $item['author-avatar']; $item['url'] = $item['author-link']; $item['when'] = DateTimeFormat::local($item['created'], 'r'); $item['ago'] = Temporal::getRelativeDate($item['created']); - $item['text'] = (($item['gravity'] == GRAVITY_PARENT) + $item['text'] = (($item['gravity'] == Item::GRAVITY_PARENT) ? $this->l10n->t("%s created a new post", $item['author-name']) : $this->l10n->t("%s commented on %s's post", $item['author-name'], $item['parent-author-name'])); diff --git a/src/Object/Api/Mastodon/Status.php b/src/Object/Api/Mastodon/Status.php index 33ae98eb2..ced691964 100644 --- a/src/Object/Api/Mastodon/Status.php +++ b/src/Object/Api/Mastodon/Status.php @@ -23,6 +23,7 @@ namespace Friendica\Object\Api\Mastodon; use Friendica\BaseDataTransferObject; use Friendica\Content\Text\BBCode; +use Friendica\Model\Item; use Friendica\Object\Api\Mastodon\Status\Counts; use Friendica\Object\Api\Mastodon\Status\UserAttributes; use Friendica\Util\DateTimeFormat; @@ -102,7 +103,7 @@ class Status extends BaseDataTransferObject $this->id = (string)$item['uri-id']; $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON); - if ($item['gravity'] == GRAVITY_COMMENT) { + if ($item['gravity'] == Item::GRAVITY_COMMENT) { $this->in_reply_to_id = (string)$item['thr-parent-id']; $this->in_reply_to_account_id = (string)$item['parent-author-id']; } diff --git a/src/Object/Api/Twitter/Status.php b/src/Object/Api/Twitter/Status.php index 54b4fa2d3..66f35825a 100644 --- a/src/Object/Api/Twitter/Status.php +++ b/src/Object/Api/Twitter/Status.php @@ -106,7 +106,7 @@ class Status extends BaseDataTransferObject $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::API); - if ($item['gravity'] == GRAVITY_COMMENT) { + if ($item['gravity'] == Item::GRAVITY_COMMENT) { $this->in_reply_to_status_id = (int)$item['thr-parent-id']; $this->in_reply_to_status_id_str = (string)$item['thr-parent-id']; $this->in_reply_to_user_id = (int)$item['parent-author-id']; diff --git a/src/Object/Post.php b/src/Object/Post.php index fe271b5a8..7300fd09b 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -210,7 +210,7 @@ class Post $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]); // On Diaspora only toplevel posts can be reshared - if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != GRAVITY_PARENT)) { + if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != Item::GRAVITY_PARENT)) { $announceable = false; } @@ -915,7 +915,7 @@ class Post return $text; } - if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) { + if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != Item::GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) { $text .= '@' . $item['author-addr'] . ' '; } diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 5183a82c3..e413aac92 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -308,10 +308,10 @@ class Processor $item['thr-parent'] = $activity['reply-to-id']; if ($activity['reply-to-id'] == $activity['id']) { - $item['gravity'] = GRAVITY_PARENT; + $item['gravity'] = Item::GRAVITY_PARENT; $item['object-type'] = Activity\ObjectType::NOTE; } else { - $item['gravity'] = GRAVITY_COMMENT; + $item['gravity'] = Item::GRAVITY_COMMENT; $item['object-type'] = Activity\ObjectType::COMMENT; } @@ -356,7 +356,7 @@ class Processor $item['diaspora_signed_text'] = $activity['diaspora:comment'] ?? ''; - if (empty($conversation) && empty($activity['directmessage']) && ($item['gravity'] != GRAVITY_PARENT) && !Post::exists(['uri' => $item['thr-parent']])) { + if (empty($conversation) && empty($activity['directmessage']) && ($item['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['uri' => $item['thr-parent']])) { Logger::notice('Parent not found, message will be discarded.', ['thr-parent' => $item['thr-parent']]); if (!$fetch_parents) { Queue::remove($activity); @@ -663,7 +663,7 @@ class Processor $item['verb'] = $verb; $item['thr-parent'] = $activity['object_id']; - $item['gravity'] = GRAVITY_ACTIVITY; + $item['gravity'] = Item::GRAVITY_ACTIVITY; unset($item['post-type']); $item['object-type'] = Activity\ObjectType::NOTE; @@ -833,7 +833,7 @@ class Processor $item['body'] = Item::improveSharedDataInBody($item); } else { $parent_uri = $item['parent-uri'] ?? $item['thr-parent']; - if (empty($activity['directmessage']) && ($parent_uri != $item['uri']) && ($item['gravity'] == GRAVITY_COMMENT)) { + if (empty($activity['directmessage']) && ($parent_uri != $item['uri']) && ($item['gravity'] == Item::GRAVITY_COMMENT)) { $parent = Post::selectFirst(['id', 'uri-id', 'private', 'author-link', 'alias'], ['uri' => $parent_uri]); if (!DBA::isResult($parent)) { Logger::warning('Unknown parent item.', ['uri' => $parent_uri]); @@ -937,7 +937,7 @@ class Processor return true; } - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { // We cannot reliably check at this point if a comment or activity belongs to an accepted post or needs to be fetched // This can possibly be improved in the future. Logger::debug('Message is no parent - accepted', ['uri-id' => $item['uri-id'], 'guid' => $item['guid'], 'url' => $item['uri']]); @@ -1035,7 +1035,7 @@ class Processor // When a post arrives via a relay and we follow the author, we have to override the causer. // Otherwise the system assumes that we follow the relay. (See "addRowInformation") Logger::debug('Relay post for follower', ['receiver' => $receiver, 'guid' => $item['guid'], 'relay' => $activity['from-relay']]); - $item['causer-id'] = ($item['gravity'] == GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id']; + $item['causer-id'] = ($item['gravity'] == Item::GRAVITY_PARENT) ? $item['owner-id'] : $item['author-id']; } if ($item['isForum'] ?? false) { @@ -1053,7 +1053,7 @@ class Processor continue; } - if (($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT) && !in_array($item['post-reason'], [Item::PR_FOLLOWER, Item::PR_TAG, item::PR_TO, Item::PR_CC])) { + if (($receiver != 0) && ($item['gravity'] == Item::GRAVITY_PARENT) && !in_array($item['post-reason'], [Item::PR_FOLLOWER, Item::PR_TAG, item::PR_TO, Item::PR_CC])) { if (!($item['isForum'] ?? false)) { if ($item['post-reason'] == Item::PR_BCC) { Logger::info('Top level post via BCC from a non sharer, ignoring', ['uid' => $receiver, 'contact' => $item['contact-id'], 'url' => $item['uri']]); @@ -1088,7 +1088,7 @@ class Processor continue; } - if (($item['gravity'] != GRAVITY_ACTIVITY) && ($activity['object_type'] == 'as:Event')) { + if (($item['gravity'] != Item::GRAVITY_ACTIVITY) && ($activity['object_type'] == 'as:Event')) { $event_id = self::createEvent($activity, $item); $item = Event::getItemArrayForImportedId($event_id, $item); @@ -1118,7 +1118,7 @@ class Processor } // Store send a follow request for every reshare - but only when the item had been stored - if ($stored && ($item['private'] != Item::PRIVATE) && ($item['gravity'] == GRAVITY_PARENT) && !empty($item['author-link']) && ($item['author-link'] != $item['owner-link'])) { + if ($stored && ($item['private'] != Item::PRIVATE) && ($item['gravity'] == Item::GRAVITY_PARENT) && !empty($item['author-link']) && ($item['author-link'] != $item['owner-link'])) { $author = APContact::getByURL($item['owner-link'], false); // We send automatic follow requests for reshared messages. (We don't need though for forum posts) if ($author['type'] != 'Group') { @@ -1138,7 +1138,7 @@ class Processor */ private static function hasParents(array $item, int $receiver) { - if (($receiver == 0) || ($item['gravity'] == GRAVITY_PARENT)) { + if (($receiver == 0) || ($item['gravity'] == Item::GRAVITY_PARENT)) { return true; } @@ -1149,7 +1149,7 @@ class Processor if ($item['verb'] != Activity::ANNOUNCE) { switch (DI::pConfig()->get($receiver, 'system', 'accept_only_sharer')) { case Item::COMPLETION_COMMENT: - $add_parent = ($item['gravity'] != GRAVITY_ACTIVITY); + $add_parent = ($item['gravity'] != Item::GRAVITY_ACTIVITY); break; case Item::COMPLETION_NONE: @@ -1283,7 +1283,7 @@ class Processor */ private static function postMail(array $activity, array $item) { - if (($item['gravity'] != GRAVITY_PARENT) && !DBA::exists('mail', ['uri' => $item['thr-parent'], 'uid' => $item['uid']])) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && !DBA::exists('mail', ['uri' => $item['thr-parent'], 'uid' => $item['uid']])) { Logger::info('Parent not found, mail will be discarded.', ['uid' => $item['uid'], 'uri' => $item['thr-parent']]); return false; } @@ -1859,7 +1859,7 @@ class Processor return; } - Item::markForDeletion(['uri' => $activity['object_id'], 'author-id' => $author_id, 'gravity' => GRAVITY_ACTIVITY]); + Item::markForDeletion(['uri' => $activity['object_id'], 'author-id' => $author_id, 'gravity' => Item::GRAVITY_ACTIVITY]); Queue::remove($activity); } diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 30348c7ad..5545d5b8a 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -264,7 +264,7 @@ class Receiver } } - if (Post::exists(['uri' => $object_id, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]])) { + if (Post::exists(['uri' => $object_id, 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]])) { // We just assume "note" since it doesn't make a difference for the further processing return 'as:Note'; } diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 38482d3ec..baa5c1350 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -266,7 +266,7 @@ class Transmitter $condition = array_merge($condition, [ 'uid' => $owner['uid'], 'author-id' => Contact::getIdForURL($owner['url'], 0, false), - 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], + 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'network' => Protocol::FEDERATED, 'parent-network' => Protocol::FEDERATED, 'origin' => true, @@ -351,7 +351,7 @@ class Transmitter 'uid' => $owner['uid'], 'author-id' => $owner_cid, 'private' => [Item::PUBLIC, Item::UNLISTED], - 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], + 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT], 'network' => Protocol::FEDERATED, 'parent-network' => Protocol::FEDERATED, 'origin' => true, @@ -577,7 +577,7 @@ class Transmitter $item_profile = APContact::getByURL($item['author-link']); $exclude[] = $item['author-link']; - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $exclude[] = $item['owner-link']; } @@ -665,7 +665,7 @@ class Transmitter $data = ['to' => [], 'cc' => [], 'bcc' => []]; - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $actor_profile = APContact::getByURL($item['owner-link']); } else { $actor_profile = APContact::getByURL($item['author-link']); @@ -753,10 +753,10 @@ class Transmitter if (!empty($item['parent'])) { $parents = Post::select(['id', 'author-link', 'owner-link', 'gravity', 'uri'], ['parent' => $item['parent']], ['order' => ['id']]); while ($parent = Post::fetch($parents)) { - if ($parent['gravity'] == GRAVITY_PARENT) { + if ($parent['gravity'] == Item::GRAVITY_PARENT) { $profile = APContact::getByURL($parent['owner-link'], false); if (!empty($profile)) { - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { // Comments to forums are directed to the forum // But comments to forums aren't directed to the followers collection // This rule is only valid when the actor isn't the forum. @@ -971,7 +971,7 @@ class Transmitter $inboxes = []; - if ($item['gravity'] == GRAVITY_ACTIVITY) { + if ($item['gravity'] == Item::GRAVITY_ACTIVITY) { $item_profile = APContact::getByURL($item['author-link'], false); } else { $item_profile = APContact::getByURL($item['owner-link'], false); @@ -1060,7 +1060,7 @@ class Transmitter $mail['parent-uri'] = $reply['uri']; $mail['parent-uri-id'] = $reply['uri-id']; $mail['parent-author-id'] = Contact::getIdForURL($reply['from-url'], 0, false); - $mail['gravity'] = ($mail['reply'] ? GRAVITY_COMMENT: GRAVITY_PARENT); + $mail['gravity'] = ($mail['reply'] ? Item::GRAVITY_COMMENT: Item::GRAVITY_PARENT); $mail['event-type'] = ''; $mail['language'] = ''; $mail['parent'] = 0; @@ -1245,7 +1245,7 @@ class Transmitter if (!$object_mode) { $data = ['@context' => $context ?? ActivityPub::CONTEXT]; - if ($item['deleted'] && ($item['gravity'] == GRAVITY_ACTIVITY)) { + if ($item['deleted'] && ($item['gravity'] == Item::GRAVITY_ACTIVITY)) { $type = 'Undo'; } elseif ($item['deleted']) { $type = 'Delete'; @@ -1256,7 +1256,7 @@ class Transmitter if ($type == 'Delete') { $data['id'] = Item::newURI($item['guid']) . '/' . $type;; - } elseif (($item['gravity'] == GRAVITY_ACTIVITY) && ($type != 'Undo')) { + } elseif (($item['gravity'] == Item::GRAVITY_ACTIVITY) && ($type != 'Undo')) { $data['id'] = $item['uri']; } else { $data['id'] = $item['uri'] . '/' . $type; @@ -1264,7 +1264,7 @@ class Transmitter $data['type'] = $type; - if (($type != 'Announce') || ($item['gravity'] != GRAVITY_PARENT)) { + if (($type != 'Announce') || ($item['gravity'] != Item::GRAVITY_PARENT)) { $data['actor'] = $item['author-link']; } else { $data['actor'] = $item['owner-link']; @@ -1557,7 +1557,7 @@ class Transmitter // We are treating posts differently when they are directed to a community. // This is done to better support Lemmy. Most of the changes should work with other systems as well. // But to not risk compatibility issues we currently perform the changes only for communities. - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $isCommunityPost = !empty(Tag::getByURIId($item['uri-id'], [Tag::EXCLUSIVE_MENTION])); $links = Post\Media::getByURIId($item['uri-id'], [Post\Media::HTML]); if ($isCommunityPost && (count($links) == 1)) { diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 47637bc2e..7540d99d9 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -799,7 +799,7 @@ class DFRN $dfrnowner = self::addEntryAuthor($doc, "dfrn:owner", $item["owner-link"], $item); $entry->appendChild($dfrnowner); - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { $parent = Post::selectFirst(['guid', 'plink'], ['uri' => $item['thr-parent'], 'uid' => $item['uid']]); if (DBA::isResult($parent)) { $attributes = ["ref" => $item['thr-parent'], "type" => "text/html", @@ -888,7 +888,7 @@ class DFRN if ($item['object-type'] != '') { XML::addElement($doc, $entry, 'activity:object-type', $item['object-type']); - } elseif ($item['gravity'] == GRAVITY_PARENT) { + } elseif ($item['gravity'] == Item::GRAVITY_PARENT) { XML::addElement($doc, $entry, 'activity:object-type', Activity\ObjectType::NOTE); } else { XML::addElement($doc, $entry, 'activity:object-type', Activity\ObjectType::COMMENT); @@ -1612,21 +1612,21 @@ class DFRN || ($item['verb'] == Activity::ATTENDMAYBE) || ($item['verb'] == Activity::ANNOUNCE) ) { - $item['gravity'] = GRAVITY_ACTIVITY; + $item['gravity'] = Item::GRAVITY_ACTIVITY; // only one like or dislike per person // split into two queries for performance issues $condition = [ - 'uid' => $item['uid'], - 'author-id' => $item['author-id'], - 'gravity' => GRAVITY_ACTIVITY, - 'verb' => $item['verb'], + 'uid' => $item['uid'], + 'author-id' => $item['author-id'], + 'gravity' => Item::GRAVITY_ACTIVITY, + 'verb' => $item['verb'], 'parent-uri' => $item['thr-parent'], ]; if (Post::exists($condition)) { return false; } - $condition = ['uid' => $item['uid'], 'author-id' => $item['author-id'], 'gravity' => GRAVITY_ACTIVITY, + $condition = ['uid' => $item['uid'], 'author-id' => $item['author-id'], 'gravity' => Item::GRAVITY_ACTIVITY, 'verb' => $item['verb'], 'thr-parent' => $item['thr-parent']]; if (Post::exists($condition)) { return false; @@ -1938,7 +1938,7 @@ class DFRN // Now assign the rest of the values that depend on the type of the message if (in_array($entrytype, [self::REPLY, self::REPLY_RC])) { - $item['gravity'] = GRAVITY_COMMENT; + $item['gravity'] = Item::GRAVITY_COMMENT; if (!isset($item['object-type'])) { $item['object-type'] = Activity\ObjectType::COMMENT; @@ -1964,7 +1964,7 @@ class DFRN if ($entrytype == self::REPLY_RC) { $item['wall'] = 1; } elseif ($entrytype == self::TOP_LEVEL) { - $item['gravity'] = GRAVITY_PARENT; + $item['gravity'] = Item::GRAVITY_PARENT; if (!isset($item['object-type'])) { $item['object-type'] = Activity\ObjectType::NOTE; @@ -2034,7 +2034,7 @@ class DFRN Logger::info('Contact is not sharing with the user', ['uid' => $item['uid'], 'owner-id' => $item['owner-id'], 'author-id' => $item['author-id'], 'gravity' => $item['gravity'], 'uri' => $item['uri']]); return; } - if (($item['gravity'] == GRAVITY_ACTIVITY) && DI::pConfig()->get($item['uid'], 'system', 'accept_only_sharer') == Item::COMPLETION_COMMENT) { + if (($item['gravity'] == Item::GRAVITY_ACTIVITY) && DI::pConfig()->get($item['uid'], 'system', 'accept_only_sharer') == Item::COMPLETION_COMMENT) { Logger::info('Completion is set to "comment", but this is an activity. so we stop here.', ['uid' => $item['uid'], 'owner-id' => $item['owner-id'], 'author-id' => $item['author-id'], 'gravity' => $item['gravity'], 'uri' => $item['uri']]); return; } @@ -2119,13 +2119,13 @@ class DFRN } // When it is a starting post it has to belong to the person that wants to delete it - if (($item['gravity'] == GRAVITY_PARENT) && ($item['contact-id'] != $importer['id'])) { + if (($item['gravity'] == Item::GRAVITY_PARENT) && ($item['contact-id'] != $importer['id'])) { Logger::info('Item with URI ' . $uri . ' do not belong to contact ' . $importer['id'] . ' - ignoring deletion.'); return; } // Comments can be deleted by the thread owner or comment owner - if (($item['gravity'] != GRAVITY_PARENT) && ($item['contact-id'] != $importer['id'])) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && ($item['contact-id'] != $importer['id'])) { $condition = ['id' => $item['parent'], 'contact-id' => $importer['id']]; if (!Post::exists($condition)) { Logger::info('Item with URI ' . $uri . ' was not found or must not be deleted by contact ' . $importer['id'] . ' - ignoring deletion.'); diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 66ace1d3d..70616104b 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -83,7 +83,7 @@ class Diaspora } $items = Post::select(['author-id', 'author-link', 'parent-author-link', 'parent-guid', 'guid'], - ['parent' => $item['parent'], 'gravity' => [GRAVITY_COMMENT, GRAVITY_ACTIVITY]]); + ['parent' => $item['parent'], 'gravity' => [Item::GRAVITY_COMMENT, Item::GRAVITY_ACTIVITY]]); while ($item = Post::fetch($items)) { $contact = DBA::selectFirst('contact', ['id', 'url', 'name', 'protocol', 'batch', 'network'], ['id' => $item['author-id']]); @@ -1548,7 +1548,7 @@ class Diaspora $datarray['uri-id'] = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]); $datarray['verb'] = Activity::POST; - $datarray['gravity'] = GRAVITY_COMMENT; + $datarray['gravity'] = Item::GRAVITY_COMMENT; $datarray['thr-parent'] = $thr_parent ?: $toplevel_parent_item['uri']; @@ -1801,7 +1801,7 @@ class Diaspora $datarray['uri'] = self::getUriFromGuid($author, $guid); $datarray['verb'] = $verb; - $datarray['gravity'] = GRAVITY_ACTIVITY; + $datarray['gravity'] = Item::GRAVITY_ACTIVITY; $datarray['thr-parent'] = $toplevel_parent_item['uri']; $datarray['object-type'] = Activity\ObjectType::NOTE; @@ -1812,7 +1812,7 @@ class Diaspora $datarray['changed'] = $datarray['created'] = $datarray['edited'] = DateTimeFormat::utcNow(); // like on comments have the comment as parent. So we need to fetch the toplevel parent - if ($toplevel_parent_item['gravity'] != GRAVITY_PARENT) { + if ($toplevel_parent_item['gravity'] != Item::GRAVITY_PARENT) { $toplevel = Post::selectFirst(['origin'], ['id' => $toplevel_parent_item['parent']]); $origin = $toplevel['origin']; } else { @@ -1981,7 +1981,7 @@ class Diaspora $datarray['uri'] = self::getUriFromGuid($author, $guid); $datarray['verb'] = Activity::FOLLOW; - $datarray['gravity'] = GRAVITY_ACTIVITY; + $datarray['gravity'] = Item::GRAVITY_ACTIVITY; $datarray['thr-parent'] = $toplevel_parent_item['uri']; $datarray['object-type'] = Activity\ObjectType::NOTE; @@ -2002,9 +2002,9 @@ class Diaspora // Send all existing comments and likes to the requesting server $comments = Post::select(['id', 'uri-id', 'parent-author-network', 'author-network', 'verb', 'gravity'], - ['parent' => $toplevel_parent_item['id'], 'gravity' => [GRAVITY_COMMENT, GRAVITY_ACTIVITY]]); + ['parent' => $toplevel_parent_item['id'], 'gravity' => [Item::GRAVITY_COMMENT, Item::GRAVITY_ACTIVITY]]); while ($comment = Post::fetch($comments)) { - if (($comment['gravity'] == GRAVITY_ACTIVITY) && !in_array($comment['verb'], [Activity::LIKE, Activity::DISLIKE])) { + if (($comment['gravity'] == Item::GRAVITY_ACTIVITY) && !in_array($comment['verb'], [Activity::LIKE, Activity::DISLIKE])) { Logger::info('Unsupported activities are not relayed', ['item' => $comment['id'], 'verb' => $comment['verb']]); continue; } @@ -2302,7 +2302,7 @@ class Diaspora $datarray['thr-parent'] = $parent['uri']; $datarray['verb'] = $datarray['body'] = Activity::ANNOUNCE; - $datarray['gravity'] = GRAVITY_ACTIVITY; + $datarray['gravity'] = Item::GRAVITY_ACTIVITY; $datarray['object-type'] = Activity\ObjectType::NOTE; $datarray['protocol'] = $item['protocol']; @@ -2387,7 +2387,7 @@ class Diaspora $datarray['uri-id'] = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]); $datarray['verb'] = Activity::POST; - $datarray['gravity'] = GRAVITY_PARENT; + $datarray['gravity'] = Item::GRAVITY_PARENT; $datarray['protocol'] = Conversation::PARCEL_DIASPORA; $datarray['source'] = $xml; @@ -2706,7 +2706,7 @@ class Diaspora $datarray['owner-id'] = $datarray['author-id']; $datarray['verb'] = Activity::POST; - $datarray['gravity'] = GRAVITY_PARENT; + $datarray['gravity'] = Item::GRAVITY_PARENT; $datarray['protocol'] = Conversation::PARCEL_DIASPORA; $datarray['source'] = $xml; @@ -3596,7 +3596,7 @@ class Diaspora // - Implicit mentions are enabled if ( $item['author-id'] != $thread_parent_item['author-id'] - && ($thread_parent_item['gravity'] != GRAVITY_PARENT) + && ($thread_parent_item['gravity'] != Item::GRAVITY_PARENT) && (empty($item['uid']) || !Feature::isEnabled($item['uid'], 'explicit_mentions')) && !DI::config()->get('system', 'disable_implicit_mentions') ) { @@ -3729,7 +3729,7 @@ class Diaspora $msg_type = 'retraction'; - if ($item['gravity'] == GRAVITY_PARENT) { + if ($item['gravity'] == Item::GRAVITY_PARENT) { $target_type = 'Post'; } elseif (in_array($item['verb'], [Activity::LIKE, Activity::DISLIKE])) { $target_type = 'Like'; @@ -4069,12 +4069,12 @@ class Diaspora return false; } - if (($parent_post['gravity'] == GRAVITY_COMMENT) && empty($parent_post['signed_text'])) { + if (($parent_post['gravity'] == Item::GRAVITY_COMMENT) && empty($parent_post['signed_text'])) { Logger::info('Parent comment has got no Diaspora signature.', ['parent-id' => $parent_id]); return false; } - if ($parent_post['gravity'] == GRAVITY_COMMENT) { + if ($parent_post['gravity'] == Item::GRAVITY_COMMENT) { return self::parentSupportDiaspora($parent_post['thr-parent-id']); } diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 7ff86c1db..3253a1309 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -252,20 +252,21 @@ class Feed $author['owner-avatar'] = $contact['thumb']; } - $header = []; - $header['uid'] = $importer['uid'] ?? 0; - $header['network'] = Protocol::FEED; + $header = [ + 'uid' => $importer['uid'] ?? 0, + 'network' => Protocol::FEED, + 'wall' => 0, + 'origin' => 0, + 'gravity' => Item::GRAVITY_PARENT, + 'private' => Item::PUBLIC, + 'verb' => Activity::POST, + 'object-type' => Activity\ObjectType::NOTE, + 'post-type' => Item::PT_ARTICLE, + 'contact-id' => $contact['id'] ?? 0, + ]; + $datarray['protocol'] = $protocol; $datarray['direction'] = Conversation::PULL; - $header['wall'] = 0; - $header['origin'] = 0; - $header['gravity'] = GRAVITY_PARENT; - $header['private'] = Item::PUBLIC; - $header['verb'] = Activity::POST; - $header['object-type'] = Activity\ObjectType::NOTE; - $header['post-type'] = Item::PT_ARTICLE; - - $header['contact-id'] = $contact['id'] ?? 0; if (!is_object($entries)) { Logger::info("There are no entries in this feed."); @@ -954,13 +955,13 @@ class Feed $condition = ["`uid` = ? AND `received` > ? AND NOT `deleted` AND `gravity` IN (?, ?) AND `private` != ? AND `visible` AND `wall` AND `parent-network` IN (?, ?, ?, ?)", - $owner['uid'], $check_date, GRAVITY_PARENT, GRAVITY_COMMENT, + $owner['uid'], $check_date, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT, Item::PRIVATE, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DFRN, Protocol::DIASPORA]; if ($filter === 'comments') { $condition[0] .= " AND `gravity` = ? "; - $condition[] = GRAVITY_COMMENT; + $condition[] = Item::GRAVITY_COMMENT; } if ($owner['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) { @@ -1087,7 +1088,7 @@ class Feed */ private static function noteEntry(DOMDocument $doc, array $item, array $owner): DOMElement { - if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { Logger::info('Feed entry author does not match feed owner', ['owner' => $owner['url'], 'author' => $item['author-link']]); } @@ -1151,7 +1152,7 @@ class Feed { $mentioned = []; - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { $parent = Post::selectFirst(['guid', 'author-link', 'owner-link'], ['id' => $item['parent']]); $thrparent = Post::selectFirst(['guid', 'author-link', 'owner-link', 'plink'], ['uid' => $owner['uid'], 'uri' => $item['thr-parent']]); diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index bd6002392..216579466 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -391,7 +391,7 @@ class OStatus $header['network'] = Protocol::OSTATUS; $header['wall'] = 0; $header['origin'] = 0; - $header['gravity'] = GRAVITY_COMMENT; + $header['gravity'] = Item::GRAVITY_COMMENT; if (!is_object($doc->firstChild) || empty($doc->firstChild->tagName)) { return false; @@ -499,7 +499,7 @@ class OStatus $item['verb'] = Activity::LIKE; $item['thr-parent'] = $orig_uri; - $item['gravity'] = GRAVITY_ACTIVITY; + $item['gravity'] = Item::GRAVITY_ACTIVITY; $item['object-type'] = Activity\ObjectType::NOTE; } @@ -714,7 +714,7 @@ class OStatus } } else { $item['thr-parent'] = $item['uri']; - $item['gravity'] = GRAVITY_PARENT; + $item['gravity'] = Item::GRAVITY_PARENT; } self::$itemlist[] = $item; @@ -1359,7 +1359,7 @@ class OStatus */ private static function likeEntry(DOMDocument $doc, array $item, array $owner, bool $toplevel): DOMElement { - if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { Logger::info('OStatus entry is from author ' . $owner['url'] . ' - not from ' . $item['author-link'] . '. Quitting.'); } @@ -1509,7 +1509,7 @@ class OStatus */ private static function noteEntry(DOMDocument $doc, array $item, array $owner, bool $toplevel): DOMElement { - if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { + if (($item['gravity'] != Item::GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) { Logger::info('OStatus entry is from author ' . $owner['url'] . ' - not from ' . $item['author-link'] . '. Quitting.'); } @@ -1639,7 +1639,7 @@ class OStatus { $mentioned = []; - if ($item['gravity'] != GRAVITY_PARENT) { + if ($item['gravity'] != Item::GRAVITY_PARENT) { $parent = Post::selectFirst(['guid', 'author-link', 'owner-link'], ['id' => $item['parent']]); $thrparent = Post::selectFirst(['guid', 'author-link', 'owner-link', 'plink'], ['uid' => $owner['uid'], 'uri' => $item['thr-parent']]); diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 32d488700..fa0121c83 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -25,18 +25,21 @@ use Friendica\Contact\FriendSuggest\Collection\FriendSuggests; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestNotFoundException; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Model; +use Friendica\Model\Contact; +use Friendica\Model\FContact; +use Friendica\Model\GServer; +use Friendica\Model\Item; +use Friendica\Model\Post; +use Friendica\Model\User; +use Friendica\Protocol\Activity; use Friendica\Protocol\DFRN; use Friendica\Protocol\Diaspora; use Friendica\Protocol\Email; -use Friendica\Protocol\Activity; -use Friendica\Util\Network; -use Friendica\Core\Worker; -use Friendica\Model\FContact; -use Friendica\Model\Item; use Friendica\Protocol\Relay; +use Friendica\Util\Network; class Delivery { @@ -75,7 +78,7 @@ class Delivery $uid = $post_uriid; $target_item = []; } else { - $item = Model\Post::selectFirst(['id', 'parent'], ['uri-id' => $post_uriid, 'uid' => $sender_uid]); + $item = Post::selectFirst(['id', 'parent'], ['uri-id' => $post_uriid, 'uid' => $sender_uid]); if (!DBA::isResult($item) || empty($item['parent'])) { Logger::warning('Post not found', ['uri-id' => $post_uriid, 'uid' => $sender_uid]); return; @@ -85,9 +88,9 @@ class Delivery $condition = ['id' => [$target_id, $parent_id], 'visible' => true]; $params = ['order' => ['id']]; - $itemdata = Model\Post::select(Item::DELIVER_FIELDLIST, $condition, $params); + $itemdata = Post::select(Item::DELIVER_FIELDLIST, $condition, $params); - while ($item = Model\Post::fetch($itemdata)) { + while ($item = Post::fetch($itemdata)) { if ($item['verb'] == Activity::ANNOUNCE) { continue; } @@ -124,14 +127,14 @@ class Delivery } $condition = ['uri' => $target_item['thr-parent'], 'uid' => $target_item['uid']]; - $thr_parent = Model\Post::selectFirst(['network', 'object'], $condition); + $thr_parent = Post::selectFirst(['network', 'object'], $condition); if (!DBA::isResult($thr_parent)) { // Shouldn't happen. But when this does, we just take the parent as thread parent. // That's totally okay for what we use this variable here. $thr_parent = $parent; } - if (!empty($contact_id) && Model\Contact::isArchived($contact_id)) { + if (!empty($contact_id) && Contact::isArchived($contact_id)) { Logger::info('Contact is archived', ['id' => $contact_id, 'cmd' => $cmd, 'item' => $target_item['id']]); self::setFailedQueue($cmd, $target_item); return; @@ -144,7 +147,7 @@ class Delivery } } - $top_level = $target_item['gravity'] == GRAVITY_PARENT; + $top_level = $target_item['gravity'] == Item::GRAVITY_PARENT; // This is IMPORTANT!!!! @@ -176,7 +179,7 @@ class Delivery && empty($parent['allow_gid']) && empty($parent['deny_cid']) && empty($parent['deny_gid']) - && ($parent["private"] != Model\Item::PRIVATE)) { + && ($parent['private'] != Item::PRIVATE)) { $public_message = true; } } @@ -185,7 +188,7 @@ class Delivery Logger::warning('No delivery data', ['command' => $cmd, 'uri-id' => $post_uriid, 'cid' => $contact_id]); } - $owner = Model\User::getOwnerDataById($uid); + $owner = User::getOwnerDataById($uid); if (!DBA::isResult($owner)) { self::setFailedQueue($cmd, $target_item); return; @@ -205,7 +208,7 @@ class Delivery return; } - $protocol = Model\GServer::getProtocol($contact['gsid'] ?? 0); + $protocol = GServer::getProtocol($contact['gsid'] ?? 0); // Transmit via Diaspora if the thread had started as Diaspora post. // Also transmit via Diaspora if this is a direct answer to a Diaspora comment. @@ -250,7 +253,7 @@ class Delivery return; } - Model\Post\DeliveryData::incrementQueueFailed($item['uri-id'] ?? $item['id']); + Post\DeliveryData::incrementQueueFailed($item['uri-id'] ?? $item['id']); } /** @@ -281,7 +284,7 @@ class Delivery if ($cmd == self::MAIL) { $item = $target_item; - $item['body'] = Model\Item::fixPrivatePhotos($item['body'], $owner['uid'], null, $item['contact-id']); + $item['body'] = Item::fixPrivatePhotos($item['body'], $owner['uid'], null, $item['contact-id']); $atom = DFRN::mail($item, $owner); } elseif ($cmd == self::SUGGESTION) { $item = $target_item; @@ -311,13 +314,13 @@ class Delivery Logger::debug('Notifier entry: ' . $contact["url"] . ' ' . (($target_item['guid'] ?? '') ?: $target_item['id']) . ' entry: ' . $atom); - $protocol = Model\Post\DeliveryData::DFRN; + $protocol = Post\DeliveryData::DFRN; // We don't have a relationship with contacts on a public post. // Se we transmit with the new method and via Diaspora as a fallback if (!empty($items) && (($items[0]['uid'] == 0) || ($contact['uid'] == 0))) { // Transmit in public if it's a relay post - $public_dfrn = ($contact['contact-type'] == Model\Contact::TYPE_RELAY); + $public_dfrn = ($contact['contact-type'] == Contact::TYPE_RELAY); $deliver_status = DFRN::transmit($owner, $contact, $atom, $public_dfrn); @@ -327,17 +330,17 @@ class Delivery if ($cmd == Delivery::POST) { if (($deliver_status >= 200) && ($deliver_status <= 299)) { - Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); + Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); - Model\GServer::setProtocol($contact['gsid'] ?? 0, $protocol); + GServer::setProtocol($contact['gsid'] ?? 0, $protocol); } else { - Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); + Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } return; } - if ((($deliver_status < 200) || ($deliver_status > 299)) && (empty($server_protocol) || ($server_protocol == Model\Post\DeliveryData::LEGACY_DFRN))) { + if ((($deliver_status < 200) || ($deliver_status > 299)) && (empty($server_protocol) || ($server_protocol == Post\DeliveryData::LEGACY_DFRN))) { // Transmit via Diaspora if not possible via Friendica self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup); return; @@ -351,20 +354,20 @@ class Delivery if (($deliver_status >= 200) && ($deliver_status <= 299)) { // We successfully delivered a message, the contact is alive - Model\Contact::unmarkForArchival($contact); + Contact::unmarkForArchival($contact); - Model\GServer::setProtocol($contact['gsid'] ?? 0, $protocol); + GServer::setProtocol($contact['gsid'] ?? 0, $protocol); if ($cmd == Delivery::POST) { - Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); + Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); } } else { // The message could not be delivered. We mark the contact as "dead" - Model\Contact::markForArchival($contact); + Contact::markForArchival($contact); Logger::info('Delivery failed: defer message', ['id' => ($target_item['guid'] ?? '') ?: $target_item['id']]); if (!Worker::defer() && $cmd == Delivery::POST) { - Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); + Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } } @@ -386,7 +389,7 @@ class Delivery private static function deliverDiaspora(string $cmd, array $contact, array $owner, array $items, array $target_item, bool $public_message, bool $top_level, bool $followup) { // We don't treat Forum posts as "wall-to-wall" to be able to post them via Diaspora - $walltowall = $top_level && ($owner['id'] != $items[0]['contact-id']) & ($owner['account-type'] != Model\User::ACCOUNT_TYPE_COMMUNITY); + $walltowall = $top_level && ($owner['id'] != $items[0]['contact-id']) & ($owner['account-type'] != User::ACCOUNT_TYPE_COMMUNITY); if ($public_message) { $loc = 'public batch ' . $contact['batch']; @@ -438,30 +441,30 @@ class Delivery if (($deliver_status >= 200) && ($deliver_status <= 299)) { // We successfully delivered a message, the contact is alive - Model\Contact::unmarkForArchival($contact); + Contact::unmarkForArchival($contact); - Model\GServer::setProtocol($contact['gsid'] ?? 0, Model\Post\DeliveryData::DIASPORA); + GServer::setProtocol($contact['gsid'] ?? 0, Post\DeliveryData::DIASPORA); if ($cmd == Delivery::POST) { - Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Model\Post\DeliveryData::DIASPORA); + Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Post\DeliveryData::DIASPORA); } } else { // The message could not be delivered. We mark the contact as "dead" - Model\Contact::markForArchival($contact); + Contact::markForArchival($contact); // When it is delivered to the public endpoint, we do mark the relay contact for archival as well if ($public_message) { Relay::markForArchival($contact); } - if (empty($contact['contact-type']) || ($contact['contact-type'] != Model\Contact::TYPE_RELAY)) { + if (empty($contact['contact-type']) || ($contact['contact-type'] != Contact::TYPE_RELAY)) { Logger::info('Delivery failed: defer message', ['id' => ($target_item['guid'] ?? '') ?: $target_item['id']]); // defer message for redelivery if (!Worker::defer() && $cmd == Delivery::POST) { - Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); + Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } elseif ($cmd == Delivery::POST) { - Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); + Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } } @@ -525,7 +528,7 @@ class Delivery // only expose our real email address to true friends - if (($contact['rel'] == Model\Contact::FRIEND) && !$contact['blocked']) { + if (($contact['rel'] == Contact::FRIEND) && !$contact['blocked']) { if ($reply_to) { $headers = 'From: ' . Email::encodeHeader($local_user['username'],'UTF-8') . ' <' . $reply_to . '>' . "\n"; $headers .= 'Sender: ' . $local_user['email'] . "\n"; @@ -551,13 +554,13 @@ class Delivery if (empty($target_item['title'])) { $condition = ['uri' => $target_item['parent-uri'], 'uid' => $owner['uid']]; - $title = Model\Post::selectFirst(['title'], $condition); + $title = Post::selectFirst(['title'], $condition); if (DBA::isResult($title) && ($title['title'] != '')) { $subject = $title['title']; } else { $condition = ['parent-uri' => $target_item['parent-uri'], 'uid' => $owner['uid']]; - $title = Model\Post::selectFirst(['title'], $condition); + $title = Post::selectFirst(['title'], $condition); if (DBA::isResult($title) && ($title['title'] != '')) { $subject = $title['title']; @@ -575,7 +578,7 @@ class Delivery if ($success) { // Success - Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Model\Post\DeliveryData::MAIL); + Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Post\DeliveryData::MAIL); Logger::info('Delivered via mail', ['guid' => $target_item['guid'], 'to' => $addr, 'subject' => $subject]); } else { // Failed diff --git a/src/Worker/ExpirePosts.php b/src/Worker/ExpirePosts.php index bbdfaa42c..10325b32b 100644 --- a/src/Worker/ExpirePosts.php +++ b/src/Worker/ExpirePosts.php @@ -68,7 +68,7 @@ class ExpirePosts { Logger::notice('Delete expired posts'); // physically remove anything that has been deleted for more than two months - $condition = ["`gravity` = ? AND `deleted` AND `changed` < ?", GRAVITY_PARENT, DateTimeFormat::utc('now - 60 days')]; + $condition = ["`gravity` = ? AND `deleted` AND `changed` < ?", Item::GRAVITY_PARENT, DateTimeFormat::utc('now - 60 days')]; $rows = Post::select(['guid', 'uri-id', 'uid'], $condition); while ($row = Post::fetch($rows)) { Logger::info('Delete expired item', ['uri-id' => $row['uri-id'], 'guid' => $row['guid']]); @@ -134,7 +134,7 @@ class ExpirePosts } $rows = 0; - $userposts = DBA::select('post-user', [], ["`gravity` = ? AND `uri-id` not in (select `uri-id` from `post-thread`)", GRAVITY_PARENT]); + $userposts = DBA::select('post-user', [], ["`gravity` = ? AND `uri-id` not in (select `uri-id` from `post-thread`)", Item::GRAVITY_PARENT]); while ($fields = DBA::fetch($userposts)) { $post_fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread', $fields); $post_fields['commented'] = $post_fields['changed'] = $post_fields['created']; @@ -149,7 +149,7 @@ class ExpirePosts } $rows = 0; - $userposts = DBA::select('post-user', [], ["`gravity` = ? AND `id` not in (select `post-user-id` from `post-thread-user`)", GRAVITY_PARENT]); + $userposts = DBA::select('post-user', [], ["`gravity` = ? AND `id` not in (select `post-user-id` from `post-thread-user`)", Item::GRAVITY_PARENT]); while ($fields = DBA::fetch($userposts)) { $post_fields = DI::dbaDefinition()->truncateFieldsForTable('post-thread-user', $fields); $post_fields['commented'] = $post_fields['changed'] = $post_fields['created']; @@ -264,7 +264,7 @@ class ExpirePosts AND `i`.`parent-uri-id` = `post-user`.`uri-id`) AND NOT `uri-id` IN (SELECT `parent-uri-id` FROM `post-user` AS `i` WHERE `i`.`uid` = ? AND `i`.`parent-uri-id` = `post-user`.`uri-id` AND `i`.`received` > ?))", - GRAVITY_PARENT, 0, DateTimeFormat::utc('now - ' . (int)$expire_days_unclaimed . ' days'), 0, 0, DateTimeFormat::utc('now - ' . (int)$expire_days_unclaimed . ' days')]); + Item::GRAVITY_PARENT, 0, DateTimeFormat::utc('now - ' . (int)$expire_days_unclaimed . ' days'), 0, 0, DateTimeFormat::utc('now - ' . (int)$expire_days_unclaimed . ' days')]); Logger::notice('Start deleting unclaimed public items'); $affected_count = 0; diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 7d3d3d6b7..3092364c5 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -143,7 +143,7 @@ class Notifier } } - $top_level = $target_item['gravity'] == GRAVITY_PARENT; + $top_level = $target_item['gravity'] == Item::GRAVITY_PARENT; } $owner = User::getOwnerDataById($uid); diff --git a/tests/datasets/api.fixture.php b/tests/datasets/api.fixture.php index ace928b09..bafbefd6d 100644 --- a/tests/datasets/api.fixture.php +++ b/tests/datasets/api.fixture.php @@ -387,7 +387,7 @@ return [ 'uri-id' => 1, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -402,7 +402,7 @@ return [ 'uri-id' => 2, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -417,7 +417,7 @@ return [ 'uri-id' => 3, 'parent-uri-id' => 3, 'thr-parent-id' => 3, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 43, @@ -432,7 +432,7 @@ return [ 'uri-id' => 4, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -447,7 +447,7 @@ return [ 'uri-id' => 5, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -462,7 +462,7 @@ return [ 'uri-id' => 6, 'parent-uri-id' => 6, 'thr-parent-id' => 6, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -477,7 +477,7 @@ return [ 'uri-id' => 7, 'parent-uri-id' => 7, 'thr-parent-id' => 7, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -505,7 +505,7 @@ return [ 'thr-parent-id' => 1, 'private' => Item::PUBLIC, 'global' => true, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'wall' => 1, 'origin' => 1, @@ -519,7 +519,7 @@ return [ 'origin' => 1, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -540,7 +540,7 @@ return [ 'origin' => 1, 'parent-uri-id' => 3, 'thr-parent-id' => 3, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 43, @@ -561,7 +561,7 @@ return [ 'origin' => 1, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -582,7 +582,7 @@ return [ 'origin' => 1, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -603,7 +603,7 @@ return [ 'origin' => 1, 'parent-uri-id' => 6, 'thr-parent-id' => 6, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -624,7 +624,7 @@ return [ 'origin' => 0, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -645,7 +645,7 @@ return [ 'origin' => 0, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -666,7 +666,7 @@ return [ 'origin' => 0, 'parent-uri-id' => 3, 'thr-parent-id' => 3, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 43, @@ -687,7 +687,7 @@ return [ 'origin' => 0, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 44, @@ -708,7 +708,7 @@ return [ 'origin' => 0, 'parent-uri-id' => 1, 'thr-parent-id' => 1, - 'gravity' => GRAVITY_COMMENT, + 'gravity' => Item::GRAVITY_COMMENT, 'network' => Protocol::DFRN, 'owner-id' => 42, 'author-id' => 42, @@ -735,7 +735,7 @@ return [ 'thr-parent-id' => 6, 'private' => Item::PUBLIC, 'global' => true, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'origin' => 0, 'deleted' => 0, @@ -756,7 +756,7 @@ return [ 'thr-parent-id' => 7, 'private' => Item::PUBLIC, 'global' => true, - 'gravity' => GRAVITY_PARENT, + 'gravity' => Item::GRAVITY_PARENT, 'network' => Protocol::DFRN, 'origin' => 0, 'deleted' => 0, diff --git a/update.php b/update.php index fab51993c..e66887a37 100644 --- a/update.php +++ b/update.php @@ -299,7 +299,7 @@ function update_1349() } if (!DBA::e("UPDATE `item` INNER JOIN `item-activity` ON `item`.`uri-id` = `item-activity`.`uri-id` - SET `vid` = `item-activity`.`activity` + 1 WHERE `gravity` = ? AND (`vid` IS NULL OR `vid` = 0)", GRAVITY_ACTIVITY)) { + SET `vid` = `item-activity`.`activity` + 1 WHERE `gravity` = ? AND (`vid` IS NULL OR `vid` = 0)", Item::GRAVITY_ACTIVITY)) { return Update::FAILED; } diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 4254a9904..863992c40 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -33,7 +33,9 @@ use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model; +use Friendica\Model\Item; use Friendica\Model\Contact; +use Friendica\Model\Profile; use Friendica\Module; use Friendica\Util\Strings; @@ -203,7 +205,7 @@ function frio_remote_nav(App $a, array &$nav_info) { if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { // get the homelink from $_SESSION - $homelink = Model\Profile::getMyURL(); + $homelink = Profile::getMyURL(); if (!$homelink) { $homelink = Session::get('visitor_home', ''); } @@ -216,7 +218,7 @@ function frio_remote_nav(App $a, array &$nav_info) } elseif (!local_user() && remote_user()) { $remoteUser = Contact::getById(remote_user(), $fields); $nav_info['nav']['remote'] = DI::l10n()->t('Guest'); - } elseif (Model\Profile::getMyURL()) { + } elseif (Profile::getMyURL()) { $remoteUser = Contact::getByURL($homelink, null, $fields); $nav_info['nav']['remote'] = DI::l10n()->t('Visitor'); } else { @@ -257,7 +259,7 @@ function frio_display_item(App $a, &$arr) if ( local_user() && in_array($arr['item']['uid'], [0, local_user()]) - && $arr['item']['gravity'] == GRAVITY_PARENT + && $arr['item']['gravity'] == Item::GRAVITY_PARENT && !$arr['item']['self'] && !$arr['item']['mention'] ) { From 8f92d1cc8ee82c11d2e95f91ec494cf6b50e7ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2022 23:27:54 +0200 Subject: [PATCH 024/641] Changes: - unified class import, we had these both: ```` use Friendica\Model\Item as ModelItem; use Friendica\Object\Post as PostObject; ```` In first version the namespace was prefixing class name, in second suffixing it. --- src/Content/Conversation.php | 22 +++++++++++----------- src/Content/Item.php | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 03f2502d2..0f0259aaa 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -36,7 +36,7 @@ use Friendica\Core\Session; use Friendica\Core\Theme; use Friendica\Database\DBA; use Friendica\Model\Contact; -use Friendica\Model\Item; +use Friendica\Model\Item as ItemModel; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; @@ -135,7 +135,7 @@ class Conversation return; } - if (!empty($activity['verb']) && $this->activity->match($activity['verb'], $verb) && ($activity['gravity'] != Item::GRAVITY_PARENT)) { + if (!empty($activity['verb']) && $this->activity->match($activity['verb'], $verb) && ($activity['gravity'] != ItemModel::GRAVITY_PARENT)) { $author = [ 'uid' => 0, 'id' => $activity['author-id'], @@ -755,7 +755,7 @@ class Conversation $item['pagedrop'] = $page_dropping; - if ($item['gravity'] == Item::GRAVITY_PARENT) { + if ($item['gravity'] == ItemModel::GRAVITY_PARENT) { $item_object = new PostObject($item); $conv->addParent($item_object); } @@ -825,7 +825,7 @@ class Conversation } if (!empty($activity)) { - if (($row['gravity'] == Item::GRAVITY_PARENT)) { + if (($row['gravity'] == ItemModel::GRAVITY_PARENT)) { $row['post-reason'] = Item::PR_ANNOUNCEMENT; $row = array_merge($row, $activity); @@ -834,7 +834,7 @@ class Conversation $row['causer-link'] = $contact['url']; $row['causer-avatar'] = $contact['thumb']; $row['causer-name'] = $contact['name']; - } elseif (($row['gravity'] == Item::GRAVITY_ACTIVITY) && ($row['verb'] == Activity::ANNOUNCE) && + } elseif (($row['gravity'] == ItemModel::GRAVITY_ACTIVITY) && ($row['verb'] == Activity::ANNOUNCE) && ($row['author-id'] == $activity['causer-id'])) { return $row; } @@ -867,7 +867,7 @@ class Conversation $row['owner-name'] = $row['causer-name']; } - if (in_array($row['gravity'], [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]) && !empty($row['causer-id'])) { + if (in_array($row['gravity'], [ItemModel::GRAVITY_PARENT, ItemModel::GRAVITY_COMMENT]) && !empty($row['causer-id'])) { $causer = ['uid' => 0, 'id' => $row['causer-id'], 'network' => $row['causer-network'], 'url' => $row['causer-link']]; $row['reshared'] = $this->l10n->t('%s reshared this.', '' . htmlentities($row['causer-name']) . ''); @@ -941,7 +941,7 @@ class Conversation $activitycounter = []; foreach ($parents as $parent) { - if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == Item::GRAVITY_ACTIVITY)) { + if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == ItemModel::GRAVITY_ACTIVITY)) { $uriid = $parent['thr-parent-id']; if (!empty($parent['author-id'])) { $activities[$uriid] = ['causer-id' => $parent['author-id']]; @@ -993,10 +993,10 @@ class Conversation } if ($max_comments > 0) { - if (($row['gravity'] == Item::GRAVITY_COMMENT) && (++$commentcounter[$row['parent-uri-id']] > $max_comments)) { + if (($row['gravity'] == ItemModel::GRAVITY_COMMENT) && (++$commentcounter[$row['parent-uri-id']] > $max_comments)) { continue; } - if (($row['gravity'] == Item::GRAVITY_ACTIVITY) && (++$activitycounter[$row['parent-uri-id']] > $max_comments)) { + if (($row['gravity'] == ItemModel::GRAVITY_ACTIVITY) && (++$activitycounter[$row['parent-uri-id']] > $max_comments)) { continue; } } @@ -1025,7 +1025,7 @@ class Conversation $this->profiler->startRecording('rendering'); $children = []; foreach ($item_list as $i => $item) { - if ($item['gravity'] != Item::GRAVITY_PARENT) { + if ($item['gravity'] != ItemModel::GRAVITY_PARENT) { if ($recursive) { // Fallback to parent-uri if thr-parent is not set $thr_parent = $item['thr-parent-id']; @@ -1182,7 +1182,7 @@ class Conversation // Extract the top level items foreach ($item_array as $item) { - if ($item['gravity'] == Item::GRAVITY_PARENT) { + if ($item['gravity'] == ItemModel::GRAVITY_PARENT) { $parents[] = $item; } } diff --git a/src/Content/Item.php b/src/Content/Item.php index 01699aaac..db1753893 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -31,7 +31,7 @@ use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Group; -use Friendica\Model\Item as ModelItem; +use Friendica\Model\Item as ItemModel; use Friendica\Model\Photo; use Friendica\Model\Tag; use Friendica\Model\Post; @@ -331,7 +331,7 @@ class Item $sub_link = $contact_url = $pm_url = $status_link = ''; $photos_link = $posts_link = $block_link = $ignore_link = ''; - if (local_user() && local_user() == $item['uid'] && $item['gravity'] == ModelItem::GRAVITY_PARENT && !$item['self'] && !$item['mention']) { + if (local_user() && local_user() == $item['uid'] && $item['gravity'] == ItemModel::GRAVITY_PARENT && !$item['self'] && !$item['mention']) { $sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;'; } @@ -392,7 +392,7 @@ class Item ]; if (!empty($item['language'])) { - $menu[$this->l10n->t('Languages')] = 'javascript:alert(\'' . ModelItem::getLanguageMessage($item) . '\');'; + $menu[$this->l10n->t('Languages')] = 'javascript:alert(\'' . ItemModel::getLanguageMessage($item) . '\');'; } if ((($cid == 0) || ($rel == Contact::FOLLOWER)) && @@ -470,7 +470,7 @@ class Item } $item['inform'] .= 'cid:' . $contact['id']; - if (($item['gravity'] == ModelItem::GRAVITY_COMMENT) || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { + if (($item['gravity'] == ItemModel::GRAVITY_COMMENT) || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) { continue; } @@ -492,9 +492,9 @@ class Item } Logger::info('Got inform', ['inform' => $item['inform']]); - if (($item['gravity'] == ModelItem::GRAVITY_PARENT) && !empty($forum_contact) && ($private_forum || $only_to_forum)) { + if (($item['gravity'] == ItemModel::GRAVITY_PARENT) && !empty($forum_contact) && ($private_forum || $only_to_forum)) { // we tagged a forum in a top level post. Now we change the post - $item['private'] = $private_forum ? ModelItem::PRIVATE : ModelItem::UNLISTED; + $item['private'] = $private_forum ? ItemModel::PRIVATE : ItemModel::UNLISTED; if ($only_to_forum) { $item['postopts'] = ''; @@ -510,14 +510,14 @@ class Item $item['allow_cid'] = ''; $item['allow_gid'] = ''; } - } elseif ($setPermissions && ($item['gravity'] == ModelItem::GRAVITY_PARENT)) { + } elseif ($setPermissions && ($item['gravity'] == ItemModel::GRAVITY_PARENT)) { if (empty($receivers)) { // For security reasons direct posts without any receiver will be posts to yourself $self = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]); $receivers[] = $self['id']; } - $item['private'] = ModelItem::PRIVATE; + $item['private'] = ItemModel::PRIVATE; $item['allow_cid'] = ''; $item['allow_gid'] = ''; $item['deny_cid'] = ''; From 85ed0742cf801b95e0f554b441a8c424c5155806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2022 23:31:36 +0200 Subject: [PATCH 025/641] Fixed: - Content\Item versus Model\Item is really confusing! --- src/Content/Conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 0f0259aaa..2e8439a0b 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -369,7 +369,7 @@ class Conversation '$permset' => $this->l10n->t('Permission settings'), '$shortpermset' => $this->l10n->t('Permissions'), '$wall' => $notes_cid ? 0 : 1, - '$posttype' => $notes_cid ? Item::PT_PERSONAL_NOTE : Item::PT_ARTICLE, + '$posttype' => $notes_cid ? ItemModel::PT_PERSONAL_NOTE : ItemModel::PT_ARTICLE, '$content' => $x['content'] ?? '', '$post_id' => $x['post_id'] ?? '', '$baseurl' => $this->baseURL->get(true), From ebf3b7e62d130918e44f2ce2b10ed925166e603b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2022 23:38:14 +0200 Subject: [PATCH 026/641] Changes: - Content\Item versus Model\Item solved (?) --- src/Content/Conversation.php | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 2e8439a0b..5bdec3cb9 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -641,7 +641,7 @@ class Conversation unset($likebuttons['dislike']); } - $body_html = Item::prepareBody($item, true, $preview); + $body_html = ItemModel::prepareBody($item, true, $preview); [$categories, $folders] = $this->item->determineCategoriesTerms($item, local_user()); @@ -698,7 +698,7 @@ class Conversation 'owner_name' => '', 'owner_url' => '', 'owner_photo' => $this->baseURL->remove($this->item->getOwnerAvatar($item)), - 'plink' => Item::getPlink($item), + 'plink' => ItemModel::getPlink($item), 'edpost' => false, 'pinned' => $pinned, 'isstarred' => 'unstarred', @@ -826,7 +826,7 @@ class Conversation if (!empty($activity)) { if (($row['gravity'] == ItemModel::GRAVITY_PARENT)) { - $row['post-reason'] = Item::PR_ANNOUNCEMENT; + $row['post-reason'] = ItemModel::PR_ANNOUNCEMENT; $row = array_merge($row, $activity); $contact = Contact::getById($activity['causer-id'], ['url', 'name', 'thumb']); @@ -841,25 +841,25 @@ class Conversation } switch ($row['post-reason']) { - case Item::PR_TO: + case ItemModel::PR_TO: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'to')]; break; - case Item::PR_CC: + case ItemModel::PR_CC: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'cc')]; break; - case Item::PR_BTO: + case ItemModel::PR_BTO: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'bto')]; break; - case Item::PR_BCC: + case ItemModel::PR_BCC: $row['direction'] = ['direction' => 7, 'title' => $this->l10n->t('You had been addressed (%s).', 'bcc')]; break; - case Item::PR_FOLLOWER: + case ItemModel::PR_FOLLOWER: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('You are following %s.', $row['causer-name'] ?: $row['author-name'])]; break; - case Item::PR_TAG: + case ItemModel::PR_TAG: $row['direction'] = ['direction' => 4, 'title' => $this->l10n->t('You subscribed to one or more tags in this post.')]; break; - case Item::PR_ANNOUNCEMENT: + case ItemModel::PR_ANNOUNCEMENT: if (!empty($row['causer-id']) && $this->pConfig->get(local_user(), 'system', 'display_resharer')) { $row['owner-id'] = $row['causer-id']; $row['owner-link'] = $row['causer-link']; @@ -874,34 +874,34 @@ class Conversation } $row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Reshared') : $this->l10n->t('Reshared by %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case Item::PR_COMMENT: + case ItemModel::PR_COMMENT: $row['direction'] = ['direction' => 5, 'title' => $this->l10n->t('%s is participating in this thread.', $row['author-name'])]; break; - case Item::PR_STORED: + case ItemModel::PR_STORED: $row['direction'] = ['direction' => 8, 'title' => $this->l10n->t('Stored for general reasons')]; break; - case Item::PR_GLOBAL: + case ItemModel::PR_GLOBAL: $row['direction'] = ['direction' => 9, 'title' => $this->l10n->t('Global post')]; break; - case Item::PR_RELAY: + case ItemModel::PR_RELAY: $row['direction'] = ['direction' => 10, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Sent via an relay server') : $this->l10n->t('Sent via the relay server %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case Item::PR_FETCHED: + case ItemModel::PR_FETCHED: $row['direction'] = ['direction' => 2, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Fetched') : $this->l10n->t('Fetched because of %s <%s>', $row['causer-name'], $row['causer-link']))]; break; - case Item::PR_COMPLETION: + case ItemModel::PR_COMPLETION: $row['direction'] = ['direction' => 2, 'title' => $this->l10n->t('Stored because of a child post to complete this thread.')]; break; - case Item::PR_DIRECT: + case ItemModel::PR_DIRECT: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('Local delivery')]; break; - case Item::PR_ACTIVITY: + case ItemModel::PR_ACTIVITY: $row['direction'] = ['direction' => 2, 'title' => $this->l10n->t('Stored because of your activity (like, comment, star, ...)')]; break; - case Item::PR_DISTRIBUTE: + case ItemModel::PR_DISTRIBUTE: $row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('Distributed')]; break; - case Item::PR_PUSHED: + case ItemModel::PR_PUSHED: $row['direction'] = ['direction' => 1, 'title' => $this->l10n->t('Pushed to us')]; break; } @@ -979,7 +979,7 @@ class Conversation $params = ['order' => ['uri-id' => true, 'uid' => true]]; - $thread_items = Post::selectForUser($uid, array_merge(Item::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); + $thread_items = Post::selectForUser($uid, array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); $items = []; From 1f9fc13d0399fb9b83c56753b0ff364a0d81fbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 13 Sep 2022 00:09:18 +0200 Subject: [PATCH 027/641] Rewrites: From: ```` $start, + 'finish' => $finish, + 'summary' => $summary, + 'desc' => $desc, + 'location' => $location, + 'type' => $type, + 'nofinish' => $nofinish, + 'uid' => $uid, + 'cid' => $cid, + 'allow_cid' => $str_contact_allow, + 'allow_gid' => $str_group_allow, + 'deny_cid' => $str_contact_deny, + 'deny_gid' => $str_group_deny, + 'private' => $private_event, + 'id' => $event_id, + ]; if (intval($_REQUEST['preview'])) { System::httpExit(Event::getHTML($datarray)); diff --git a/mod/item.php b/mod/item.php index 9bb082884..56384b22b 100644 --- a/mod/item.php +++ b/mod/item.php @@ -307,7 +307,7 @@ function item_post(App $a) { // for non native networks use the network of the original post as network of the item if (($toplevel_item['network'] != Protocol::DIASPORA) && ($toplevel_item['network'] != Protocol::OSTATUS) - && ($network == "")) { + && ($network == '')) { $network = $toplevel_item['network']; } @@ -462,7 +462,7 @@ function item_post(App $a) { $data = BBCode::getAttachmentData($body); $match = []; - if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"])) + if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data['type'])) && ($posttype != Item::PT_PERSONAL_NOTE)) { $posttype = Item::PT_PAGE; $objecttype = Activity\ObjectType::BOOKMARK; @@ -477,11 +477,11 @@ function item_post(App $a) { $objecttype = Activity\ObjectType::NOTE; // Default value $objectdata = BBCode::getAttachedData($body); - if ($objectdata["type"] == "link") { + if ($objectdata['type'] == 'link') { $objecttype = Activity\ObjectType::BOOKMARK; - } elseif ($objectdata["type"] == "video") { + } elseif ($objectdata['type'] == 'video') { $objecttype = Activity\ObjectType::VIDEO; - } elseif ($objectdata["type"] == "photo") { + } elseif ($objectdata['type'] == 'photo') { $objecttype = Activity\ObjectType::IMAGE; } @@ -509,7 +509,7 @@ function item_post(App $a) { $verb = Activity::POST; } - if ($network == "") { + if ($network == '') { $network = Protocol::DFRN; } @@ -532,68 +532,65 @@ function item_post(App $a) { $thr_parent_uri = $uri; } - $datarray = []; - $datarray['uid'] = $profile_uid; - $datarray['wall'] = $wall; - $datarray['gravity'] = $gravity; - $datarray['network'] = $network; - $datarray['contact-id'] = $contact_id; - $datarray['owner-name'] = $contact_record['name'] ?? ''; - $datarray['owner-link'] = $contact_record['url'] ?? ''; - $datarray['owner-avatar'] = $contact_record['thumb'] ?? ''; - $datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']); - $datarray['author-name'] = $author['name']; - $datarray['author-link'] = $author['url']; - $datarray['author-avatar'] = $author['thumb']; - $datarray['author-id'] = Contact::getIdForURL($datarray['author-link']); - $datarray['created'] = empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at']; - $datarray['edited'] = $datarray['created']; - $datarray['commented'] = $datarray['created']; - $datarray['changed'] = $datarray['created']; - $datarray['received'] = DateTimeFormat::utcNow(); - $datarray['extid'] = $extid; - $datarray['guid'] = $guid; - $datarray['uri'] = $uri; - $datarray['title'] = $title; - $datarray['body'] = $body; - $datarray['app'] = $app; - $datarray['location'] = $location; - $datarray['coord'] = $coord; - $datarray['file'] = $categories; - $datarray['inform'] = $inform; - $datarray['verb'] = $verb; - $datarray['post-type'] = $posttype; - $datarray['object-type'] = $objecttype; - $datarray['allow_cid'] = $str_contact_allow; - $datarray['allow_gid'] = $str_group_allow; - $datarray['deny_cid'] = $str_contact_deny; - $datarray['deny_gid'] = $str_group_deny; - $datarray['private'] = $private; - $datarray['pubmail'] = $pubmail_enabled; - $datarray['attach'] = $attachments; + $datarray = [ + 'uid' => $profile_uid, + 'wall' => $wall, + 'gravity' => $gravity, + 'network' => $network, + 'contact-id' => $contact_id, + 'owner-name' => $contact_record['name'] ?? '', + 'owner-link' => $contact_record['url'] ?? '', + 'owner-avatar' => $contact_record['thumb'] ?? '', + 'author-name' => $author['name'], + 'author-link' => $author['url'], + 'author-avatar' => $author['thumb'], + 'created' => empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at'], + 'received' => DateTimeFormat::utcNow(), + 'extid' => $extid, + 'guid' => $guid, + 'uri' => $uri, + 'title' => $title, + 'body' => $body, + 'app' => $app, + 'location' => $location, + 'coord' => $coord, + 'file' => $categories, + 'inform' => $inform, + 'verb' => $verb, + 'post-type' => $posttype, + 'object-type' => $objecttype, + 'allow_cid' => $str_contact_allow, + 'allow_gid' => $str_group_allow, + 'deny_cid' => $str_contact_deny, + 'deny_gid' => $str_group_deny, + 'private' => $private, + 'pubmail' => $pubmail_enabled, + 'attach' => $attachments, + 'thr-parent' => $thr_parent_uri, + 'postopts' => $postopts, + 'origin' => $origin, + 'object' => $object, + 'attachments' => $_REQUEST['attachments'] ?? [], + /* + * These fields are for the convenience of addons... + * 'self' if true indicates the owner is posting on their own wall + * If parent is 0 it is a top-level post. + */ + 'parent' => $toplevel_item_id, + 'self' => $self, + // This triggers posts via API and the mirror functions + 'api_source' => $api_source, + // This field is for storing the raw conversation data + 'protocol' => Conversation::PARCEL_DIRECT, + 'direction' => Conversation::PUSH, + ]; - $datarray['thr-parent'] = $thr_parent_uri; - - $datarray['postopts'] = $postopts; - $datarray['origin'] = $origin; - $datarray['object'] = $object; - - $datarray['attachments'] = $_REQUEST['attachments'] ?? []; - - /* - * These fields are for the convenience of addons... - * 'self' if true indicates the owner is posting on their own wall - * If parent is 0 it is a top-level post. - */ - $datarray['parent'] = $toplevel_item_id; - $datarray['self'] = $self; - - // This triggers posts via API and the mirror functions - $datarray['api_source'] = $api_source; - - // This field is for storing the raw conversation data - $datarray['protocol'] = Conversation::PARCEL_DIRECT; - $datarray['direction'] = Conversation::PUSH; + // These cannot be part of above initialization ... + $datarray['edited'] = $datarray['created']; + $datarray['commented'] = $datarray['created']; + $datarray['changed'] = $datarray['created']; + $datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']); + $datarray['author-id'] = Contact::getIdForURL($datarray['author-link']); $datarray['edit'] = $orig_post; @@ -606,14 +603,14 @@ function item_post(App $a) { if ($preview) { // We set the datarray ID to -1 because in preview mode the dataray // doesn't have an ID. - $datarray["id"] = -1; - $datarray["uri-id"] = -1; - $datarray["author-network"] = Protocol::DFRN; - $datarray["author-updated"] = ''; - $datarray["author-gsid"] = 0; - $datarray["author-uri-id"] = ItemURI::getIdByURI($datarray["author-link"]); - $datarray["owner-updated"] = ''; - $datarray["has-media"] = false; + $datarray['id'] = -1; + $datarray['uri-id'] = -1; + $datarray['author-network'] = Protocol::DFRN; + $datarray['author-updated'] = ''; + $datarray['author-gsid'] = 0; + $datarray['author-uri-id'] = ItemURI::getIdByURI($datarray['author-link']); + $datarray['owner-updated'] = ''; + $datarray['has-media'] = false; $datarray['body'] = Item::improveSharedDataInBody($datarray); $o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true); @@ -657,13 +654,13 @@ function item_post(App $a) { $datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']); $datarray['body'] = Item::improveSharedDataInBody($datarray); - if ($orig_post) { + if ($orig_post) { $fields = [ - 'title' => $datarray['title'], - 'body' => $datarray['body'], - 'attach' => $datarray['attach'], - 'file' => $datarray['file'], - 'edited' => DateTimeFormat::utcNow(), + 'title' => $datarray['title'], + 'body' => $datarray['body'], + 'attach' => $datarray['attach'], + 'file' => $datarray['file'], + 'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow() ]; @@ -807,6 +804,7 @@ function item_content(App $a) } } break; + case 'block': $item = Post::selectFirstForUser(local_user(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]); if (empty($item['author-id'])) { diff --git a/mod/tagger.php b/mod/tagger.php index 4dba34f70..a6d459524 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -35,8 +35,8 @@ use Friendica\Protocol\Activity; use Friendica\Util\XML; use Friendica\Worker\Delivery; -function tagger_content(App $a) { - +function tagger_content(App $a) +{ if (!Session::isAuthenticated()) { return; } @@ -116,41 +116,41 @@ EOT; $termlink = html_entity_decode('⌗') . '[url=' . DI::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]'; - $arr = []; - - $arr['guid'] = System::createUUID(); - $arr['uri'] = $uri; - $arr['uid'] = $owner_uid; - $arr['contact-id'] = $contact['id']; - $arr['wall'] = $item['wall']; - $arr['gravity'] = Item::GRAVITY_COMMENT; - $arr['parent'] = $item['id']; - $arr['thr-parent'] = $item['uri']; - $arr['owner-name'] = $item['author-name']; - $arr['owner-link'] = $item['author-link']; - $arr['owner-avatar'] = $item['author-avatar']; - $arr['author-name'] = $contact['name']; - $arr['author-link'] = $contact['url']; - $arr['author-avatar'] = $contact['thumb']; - $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; $plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]'; - $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink, $termlink ); - $arr['verb'] = Activity::TAG; - $arr['target-type'] = $targettype; - $arr['target'] = $target; - $arr['object-type'] = $objtype; - $arr['object'] = $obj; - $arr['private'] = $item['private']; - $arr['allow_cid'] = $item['allow_cid']; - $arr['allow_gid'] = $item['allow_gid']; - $arr['deny_cid'] = $item['deny_cid']; - $arr['deny_gid'] = $item['deny_gid']; - $arr['visible'] = 1; - $arr['unseen'] = 1; - $arr['origin'] = 1; + $arr = [ + 'guid' => System::createUUID(), + 'uri' => $uri, + 'uid' => $owner_uid, + 'contact-id' => $contact['id'], + 'wall' => $item['wall'], + 'gravity' => Item::GRAVITY_COMMENT, + 'parent' => $item['id'], + 'thr-parent' => $item['uri'], + 'owner-name' => $item['author-name'], + 'owner-link' => $item['author-link'], + 'owner-avatar' => $item['author-avatar'], + 'author-name' => $contact['name'], + 'author-link' => $contact['url'], + 'author-avatar' => $contact['thumb'], + 'body' => sprintf( $bodyverb, $ulink, $alink, $plink, $termlink), + 'verb' => Activity::TAG, + 'target-type' => $targettype, + 'target' => $target, + 'object-type' => $objtype, + 'object' => $obj, + 'private' => $item['private'], + 'allow_cid' => $item['allow_cid'], + 'allow_gid' => $item['allow_gid'], + 'deny_cid' => $item['deny_cid'], + 'deny_gid' => $item['deny_gid'], + 'visible' => 1, + 'unseen' => 1, + 'origin' => 1, + ]; + $post_id = Item::insert($arr); From 34c3f189fc0368953a04f5b9c13aa86ced48ce1f Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 14 Oct 2022 22:48:03 +0000 Subject: [PATCH 028/641] Updated database.sql and messages.po --- database.sql | 2 +- view/lang/C/messages.po | 282 ++++++++++++++++++++-------------------- 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/database.sql b/database.sql index 119228656..c1b64fbed 100644 --- a/database.sql +++ b/database.sql @@ -1,5 +1,5 @@ -- ------------------------------------------ --- Friendica 2022.09-rc (Giant Rhubarb) +-- Friendica 2022.12-dev (Giant Rhubarb) -- DB_UPDATE_VERSION 1485 -- ------------------------------------------ diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 080bd7366..1552d9cf3 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2022.09-rc\n" +"Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-25 07:08+0000\n" +"POT-Creation-Date: 2022-10-14 22:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" #: mod/cal.php:46 mod/cal.php:50 mod/follow.php:39 mod/redir.php:36 -#: mod/redir.php:177 src/Module/Conversation/Community.php:183 +#: mod/redir.php:177 src/Module/Conversation/Community.php:181 #: src/Module/Debug/ItemBody.php:38 src/Module/Diaspora/Receive.php:57 #: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:41 #: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57 @@ -105,7 +105,7 @@ msgid "calendar" msgstr "" #: mod/display.php:143 mod/photos.php:802 -#: src/Module/Conversation/Community.php:177 src/Module/Directory.php:49 +#: src/Module/Conversation/Community.php:175 src/Module/Directory.php:49 #: src/Module/Search/Index.php:65 msgid "Public access denied." msgstr "" @@ -119,7 +119,7 @@ msgid "The feed for this item is unavailable." msgstr "" #: mod/editpost.php:38 mod/events.php:217 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:181 mod/item.php:186 mod/item.php:870 mod/message.php:69 +#: mod/item.php:181 mod/item.php:186 mod/item.php:865 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:33 #: mod/photos.php:160 mod/photos.php:891 mod/repair_ostatus.php:31 #: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156 @@ -267,7 +267,7 @@ msgstr "" msgid "Preview" msgstr "" -#: mod/editpost.php:130 mod/fbrowser.php:118 mod/fbrowser.php:145 +#: mod/editpost.php:130 mod/fbrowser.php:119 mod/fbrowser.php:146 #: mod/follow.php:144 mod/photos.php:1004 mod/photos.php:1105 mod/tagrm.php:35 #: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:386 #: src/Module/Contact/Revoke.php:108 src/Module/RemoteFollow.php:127 @@ -426,7 +426,7 @@ msgstr "" msgid "Basic" msgstr "" -#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:475 +#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:477 #: src/Module/Profile/Profile.php:249 msgid "Advanced" msgstr "" @@ -440,12 +440,12 @@ msgstr "" msgid "Photos" msgstr "" -#: mod/fbrowser.php:120 mod/fbrowser.php:147 +#: mod/fbrowser.php:121 mod/fbrowser.php:148 #: src/Module/Settings/Profile/Photo/Index.php:129 msgid "Upload" msgstr "" -#: mod/fbrowser.php:142 +#: mod/fbrowser.php:143 msgid "Files" msgstr "" @@ -469,8 +469,8 @@ msgstr "" msgid "OStatus support is disabled. Contact can't be added." msgstr "" -#: mod/follow.php:138 src/Content/Item.php:397 src/Content/Widget.php:80 -#: src/Model/Contact.php:1146 src/Model/Contact.php:1157 +#: mod/follow.php:138 src/Content/Item.php:400 src/Content/Widget.php:80 +#: src/Model/Contact.php:1169 src/Model/Contact.php:1180 #: view/theme/vier/theme.php:181 msgid "Connect/Follow" msgstr "" @@ -507,7 +507,7 @@ msgid "Add a personal note:" msgstr "" #: mod/follow.php:163 mod/unfollow.php:109 src/Module/BaseProfile.php:59 -#: src/Module/Contact.php:445 +#: src/Module/Contact.php:447 msgid "Status Messages and Posts" msgstr "" @@ -523,19 +523,19 @@ msgstr "" msgid "Empty post discarded." msgstr "" -#: mod/item.php:682 +#: mod/item.php:677 msgid "Post updated." msgstr "" -#: mod/item.php:692 mod/item.php:697 +#: mod/item.php:687 mod/item.php:692 msgid "Item wasn't stored." msgstr "" -#: mod/item.php:708 +#: mod/item.php:703 msgid "Item couldn't be fetched." msgstr "" -#: mod/item.php:848 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:843 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 #: src/Module/Debug/ItemBody.php:57 msgid "Item not found." @@ -1070,7 +1070,7 @@ msgid "Rotate CCW (left)" msgstr "" #: mod/photos.php:1333 mod/photos.php:1389 mod/photos.php:1463 -#: src/Module/Contact.php:545 src/Module/Item/Compose.php:160 +#: src/Module/Contact.php:547 src/Module/Item/Compose.php:160 #: src/Object/Post.php:989 msgid "This is you" msgstr "" @@ -1411,15 +1411,15 @@ msgstr "" msgid "Friend Suggestions" msgstr "" -#: mod/tagger.php:78 src/Content/Item.php:297 src/Model/Item.php:2846 +#: mod/tagger.php:78 src/Content/Item.php:300 src/Model/Item.php:2855 msgid "photo" msgstr "" -#: mod/tagger.php:78 src/Content/Item.php:291 src/Content/Item.php:301 +#: mod/tagger.php:78 src/Content/Item.php:294 src/Content/Item.php:304 msgid "status" msgstr "" -#: mod/tagger.php:111 src/Content/Item.php:311 +#: mod/tagger.php:111 src/Content/Item.php:314 #, php-format msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "" @@ -1595,16 +1595,16 @@ msgid "All contacts" msgstr "" #: src/BaseModule.php:424 src/Content/Widget.php:235 src/Core/ACL.php:194 -#: src/Module/Contact.php:368 src/Module/PermissionTooltip.php:122 +#: src/Module/Contact.php:370 src/Module/PermissionTooltip.php:122 #: src/Module/PermissionTooltip.php:144 msgid "Followers" msgstr "" -#: src/BaseModule.php:429 src/Content/Widget.php:236 src/Module/Contact.php:369 +#: src/BaseModule.php:429 src/Content/Widget.php:236 src/Module/Contact.php:371 msgid "Following" msgstr "" -#: src/BaseModule.php:434 src/Content/Widget.php:237 src/Module/Contact.php:370 +#: src/BaseModule.php:434 src/Content/Widget.php:237 src/Module/Contact.php:372 msgid "Mutual friends" msgstr "" @@ -2292,50 +2292,50 @@ msgstr "" msgid "show more" msgstr "" -#: src/Content/Item.php:288 src/Model/Item.php:2844 +#: src/Content/Item.php:291 src/Model/Item.php:2853 msgid "event" msgstr "" -#: src/Content/Item.php:380 view/theme/frio/theme.php:266 +#: src/Content/Item.php:383 view/theme/frio/theme.php:266 msgid "Follow Thread" msgstr "" -#: src/Content/Item.php:381 src/Model/Contact.php:1151 +#: src/Content/Item.php:384 src/Model/Contact.php:1174 msgid "View Status" msgstr "" -#: src/Content/Item.php:382 src/Content/Item.php:400 src/Model/Contact.php:1089 -#: src/Model/Contact.php:1143 src/Model/Contact.php:1152 +#: src/Content/Item.php:385 src/Content/Item.php:403 src/Model/Contact.php:1112 +#: src/Model/Contact.php:1166 src/Model/Contact.php:1175 #: src/Module/Directory.php:158 src/Module/Settings/Profile/Index.php:225 msgid "View Profile" msgstr "" -#: src/Content/Item.php:383 src/Model/Contact.php:1153 +#: src/Content/Item.php:386 src/Model/Contact.php:1176 msgid "View Photos" msgstr "" -#: src/Content/Item.php:384 src/Model/Contact.php:1144 -#: src/Model/Contact.php:1154 +#: src/Content/Item.php:387 src/Model/Contact.php:1167 +#: src/Model/Contact.php:1177 msgid "Network Posts" msgstr "" -#: src/Content/Item.php:385 src/Model/Contact.php:1145 -#: src/Model/Contact.php:1155 +#: src/Content/Item.php:388 src/Model/Contact.php:1168 +#: src/Model/Contact.php:1178 msgid "View Contact" msgstr "" -#: src/Content/Item.php:386 src/Model/Contact.php:1156 +#: src/Content/Item.php:389 src/Model/Contact.php:1179 msgid "Send PM" msgstr "" -#: src/Content/Item.php:387 src/Module/Admin/Blocklist/Contact.php:100 +#: src/Content/Item.php:390 src/Module/Admin/Blocklist/Contact.php:100 #: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154 -#: src/Module/Contact.php:399 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Block" msgstr "" -#: src/Content/Item.php:388 src/Module/Contact.php:400 +#: src/Content/Item.php:391 src/Module/Contact.php:402 #: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457 #: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:204 @@ -2343,7 +2343,7 @@ msgstr "" msgid "Ignore" msgstr "" -#: src/Content/Item.php:392 src/Object/Post.php:455 +#: src/Content/Item.php:395 src/Object/Post.php:455 msgid "Languages" msgstr "" @@ -2381,7 +2381,7 @@ msgid "Sign in" msgstr "" #: src/Content/Nav.php:192 src/Module/BaseProfile.php:56 -#: src/Module/Contact.php:434 src/Module/Contact/Profile.php:380 +#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380 #: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:236 msgid "Status" msgstr "" @@ -2392,7 +2392,7 @@ msgid "Your posts and conversations" msgstr "" #: src/Content/Nav.php:193 src/Module/BaseProfile.php:48 -#: src/Module/BaseSettings.php:55 src/Module/Contact.php:458 +#: src/Module/BaseSettings.php:55 src/Module/Contact.php:460 #: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:241 #: src/Module/Welcome.php:57 view/theme/frio/theme.php:237 msgid "Profile" @@ -2407,7 +2407,7 @@ msgid "Your photos" msgstr "" #: src/Content/Nav.php:195 src/Module/BaseProfile.php:72 -#: src/Module/BaseProfile.php:75 src/Module/Contact.php:450 +#: src/Module/BaseProfile.php:75 src/Module/Contact.php:452 #: view/theme/frio/theme.php:239 msgid "Media" msgstr "" @@ -2481,8 +2481,8 @@ msgstr "" #: src/Content/Nav.php:237 src/Content/Nav.php:296 #: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:125 -#: src/Module/BaseProfile.php:128 src/Module/Contact.php:371 -#: src/Module/Contact.php:465 view/theme/frio/theme.php:247 +#: src/Module/BaseProfile.php:128 src/Module/Contact.php:373 +#: src/Module/Contact.php:467 view/theme/frio/theme.php:247 msgid "Contacts" msgstr "" @@ -2628,39 +2628,39 @@ msgstr "" msgid "last" msgstr "" -#: src/Content/Text/BBCode.php:998 src/Content/Text/BBCode.php:1833 -#: src/Content/Text/BBCode.php:1834 +#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1867 +#: src/Content/Text/BBCode.php:1868 msgid "Image/photo" msgstr "" -#: src/Content/Text/BBCode.php:1188 +#: src/Content/Text/BBCode.php:1222 #, php-format msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1213 src/Model/Item.php:3420 -#: src/Model/Item.php:3426 src/Model/Item.php:3427 +#: src/Content/Text/BBCode.php:1247 src/Model/Item.php:3429 +#: src/Model/Item.php:3435 src/Model/Item.php:3436 msgid "Link to source" msgstr "" -#: src/Content/Text/BBCode.php:1751 src/Content/Text/HTML.php:940 +#: src/Content/Text/BBCode.php:1785 src/Content/Text/HTML.php:940 msgid "Click to open/close" msgstr "" -#: src/Content/Text/BBCode.php:1782 +#: src/Content/Text/BBCode.php:1816 msgid "$1 wrote:" msgstr "" -#: src/Content/Text/BBCode.php:1838 src/Content/Text/BBCode.php:1839 +#: src/Content/Text/BBCode.php:1872 src/Content/Text/BBCode.php:1873 msgid "Encrypted content" msgstr "" -#: src/Content/Text/BBCode.php:2057 +#: src/Content/Text/BBCode.php:2093 msgid "Invalid source protocol" msgstr "" -#: src/Content/Text/BBCode.php:2072 +#: src/Content/Text/BBCode.php:2108 msgid "Invalid link protocol" msgstr "" @@ -2712,7 +2712,7 @@ msgstr "" msgid "Examples: Robert Morgenstein, Fishing" msgstr "" -#: src/Content/Widget.php:82 src/Module/Contact.php:392 +#: src/Content/Widget.php:82 src/Module/Contact.php:394 #: src/Module/Directory.php:97 view/theme/vier/theme.php:183 msgid "Find" msgstr "" @@ -2739,7 +2739,7 @@ msgid "Local Directory" msgstr "" #: src/Content/Widget.php:211 src/Model/Group.php:587 -#: src/Module/Contact.php:355 src/Module/Welcome.php:76 +#: src/Module/Contact.php:357 src/Module/Welcome.php:76 msgid "Groups" msgstr "" @@ -2751,7 +2751,7 @@ msgstr "" msgid "Relationships" msgstr "" -#: src/Content/Widget.php:244 src/Module/Contact.php:307 +#: src/Content/Widget.php:244 src/Module/Contact.php:309 #: src/Module/Group.php:293 msgid "All Contacts" msgstr "" @@ -2795,7 +2795,7 @@ msgstr "" msgid "Organisations" msgstr "" -#: src/Content/Widget.php:523 src/Model/Contact.php:1582 +#: src/Content/Widget.php:523 src/Model/Contact.php:1605 msgid "News" msgstr "" @@ -3588,81 +3588,81 @@ msgstr "" msgid "Legacy module file not found: %s" msgstr "" -#: src/Model/Contact.php:1147 src/Model/Contact.php:1158 +#: src/Model/Contact.php:1170 src/Model/Contact.php:1181 msgid "UnFollow" msgstr "" -#: src/Model/Contact.php:1164 src/Module/Admin/Users/Pending.php:107 +#: src/Model/Contact.php:1187 src/Module/Admin/Users/Pending.php:107 #: src/Module/Notifications/Introductions.php:130 #: src/Module/Notifications/Introductions.php:202 msgid "Approve" msgstr "" -#: src/Model/Contact.php:1578 +#: src/Model/Contact.php:1601 msgid "Organisation" msgstr "" -#: src/Model/Contact.php:1586 +#: src/Model/Contact.php:1609 msgid "Forum" msgstr "" -#: src/Model/Contact.php:2774 +#: src/Model/Contact.php:2795 msgid "Disallowed profile URL." msgstr "" -#: src/Model/Contact.php:2779 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2800 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "" -#: src/Model/Contact.php:2784 +#: src/Model/Contact.php:2805 msgid "Connect URL missing." msgstr "" -#: src/Model/Contact.php:2793 +#: src/Model/Contact.php:2814 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "" -#: src/Model/Contact.php:2835 +#: src/Model/Contact.php:2856 msgid "The profile address specified does not provide adequate information." msgstr "" -#: src/Model/Contact.php:2837 +#: src/Model/Contact.php:2858 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: src/Model/Contact.php:2840 +#: src/Model/Contact.php:2861 msgid "An author or name was not found." msgstr "" -#: src/Model/Contact.php:2843 +#: src/Model/Contact.php:2864 msgid "No browser URL could be matched to this address." msgstr "" -#: src/Model/Contact.php:2846 +#: src/Model/Contact.php:2867 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "" -#: src/Model/Contact.php:2847 +#: src/Model/Contact.php:2868 msgid "Use mailto: in front of address to force email check." msgstr "" -#: src/Model/Contact.php:2853 +#: src/Model/Contact.php:2874 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "" -#: src/Model/Contact.php:2858 +#: src/Model/Contact.php:2879 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "" -#: src/Model/Contact.php:2917 +#: src/Model/Contact.php:2938 msgid "Unable to retrieve contact information." msgstr "" @@ -3782,66 +3782,66 @@ msgstr "" msgid "Edit groups" msgstr "" -#: src/Model/Item.php:1956 +#: src/Model/Item.php:1965 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "" -#: src/Model/Item.php:2848 +#: src/Model/Item.php:2857 msgid "activity" msgstr "" -#: src/Model/Item.php:2850 +#: src/Model/Item.php:2859 msgid "comment" msgstr "" -#: src/Model/Item.php:2853 +#: src/Model/Item.php:2862 msgid "post" msgstr "" -#: src/Model/Item.php:2969 +#: src/Model/Item.php:2978 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3332 +#: src/Model/Item.php:3341 msgid "bytes" msgstr "" -#: src/Model/Item.php:3363 +#: src/Model/Item.php:3372 #, 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:3365 +#: src/Model/Item.php:3374 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3370 +#: src/Model/Item.php:3379 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3372 +#: src/Model/Item.php:3381 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3374 +#: src/Model/Item.php:3383 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3408 src/Model/Item.php:3409 +#: src/Model/Item.php:3417 src/Model/Item.php:3418 msgid "View on separate page" msgstr "" @@ -4292,7 +4292,7 @@ msgstr "" #: src/Module/Admin/Blocklist/Server/Add.php:121 #: src/Module/Admin/Blocklist/Server/Import.php:117 #: src/Module/Admin/Blocklist/Server/Index.php:93 -#: src/Module/Admin/Federation.php:200 src/Module/Admin/Item/Delete.php:64 +#: src/Module/Admin/Federation.php:201 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:84 #: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:433 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:233 @@ -4357,8 +4357,8 @@ msgstr "" msgid "List of active accounts" msgstr "" -#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:315 -#: src/Module/Contact.php:375 +#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:317 +#: src/Module/Contact.php:377 msgid "Pending" msgstr "" @@ -4366,8 +4366,8 @@ msgstr "" msgid "List of pending registrations" msgstr "" -#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:323 -#: src/Module/Contact.php:376 +#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:325 +#: src/Module/Contact.php:378 msgid "Blocked" msgstr "" @@ -4460,7 +4460,7 @@ msgstr "" #: src/Module/Admin/Blocklist/Contact.php:101 #: src/Module/Admin/Users/Blocked.php:142 src/Module/Admin/Users/Index.php:156 -#: src/Module/Contact.php:399 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Unblock" msgstr "" @@ -4821,75 +4821,75 @@ msgstr "" msgid "Manage Additional Features" msgstr "" -#: src/Module/Admin/Federation.php:68 +#: src/Module/Admin/Federation.php:69 msgid "Other" msgstr "" -#: src/Module/Admin/Federation.php:140 src/Module/Admin/Federation.php:389 +#: src/Module/Admin/Federation.php:141 src/Module/Admin/Federation.php:390 msgid "unknown" msgstr "" -#: src/Module/Admin/Federation.php:173 +#: src/Module/Admin/Federation.php:174 #, php-format msgid "%2$s total system" msgid_plural "%2$s total systems" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:174 +#: src/Module/Admin/Federation.php:175 #, php-format msgid "%2$s active user last month" msgid_plural "%2$s active users last month" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:175 +#: src/Module/Admin/Federation.php:176 #, php-format msgid "%2$s active user last six months" msgid_plural "%2$s active users last six months" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:176 +#: src/Module/Admin/Federation.php:177 #, php-format msgid "%2$s registered user" msgid_plural "%2$s registered users" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:177 +#: src/Module/Admin/Federation.php:178 #, php-format msgid "%2$s locally created post or comment" msgid_plural "%2$s locally created posts and comments" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:180 +#: src/Module/Admin/Federation.php:181 #, php-format msgid "%2$s post per user" msgid_plural "%2$s posts per user" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:185 +#: src/Module/Admin/Federation.php:186 #, php-format msgid "%2$s user per system" msgid_plural "%2$s users per system" msgstr[0] "" msgstr[1] "" -#: src/Module/Admin/Federation.php:195 +#: src/Module/Admin/Federation.php:196 msgid "" "This page offers you some numbers to the known part of the federated social " "network your Friendica node is part of. These numbers are not complete but " "only reflect the part of the network your node is aware of." msgstr "" -#: src/Module/Admin/Federation.php:201 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Federation.php:202 src/Module/BaseAdmin.php:90 msgid "Federation Statistics" msgstr "" -#: src/Module/Admin/Federation.php:205 +#: src/Module/Admin/Federation.php:206 #, php-format msgid "" "Currently this node is aware of %2$s node (%3$s active users last month, " @@ -6733,7 +6733,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: src/Module/BaseProfile.php:51 src/Module/Contact.php:461 +#: src/Module/BaseProfile.php:51 src/Module/Contact.php:463 msgid "Profile Details" msgstr "" @@ -6807,110 +6807,110 @@ msgid_plural "%d contacts edited." msgstr[0] "" msgstr[1] "" -#: src/Module/Contact.php:310 +#: src/Module/Contact.php:312 msgid "Show all contacts" msgstr "" -#: src/Module/Contact.php:318 +#: src/Module/Contact.php:320 msgid "Only show pending contacts" msgstr "" -#: src/Module/Contact.php:326 +#: src/Module/Contact.php:328 msgid "Only show blocked contacts" msgstr "" -#: src/Module/Contact.php:331 src/Module/Contact.php:378 +#: src/Module/Contact.php:333 src/Module/Contact.php:380 #: src/Object/Post.php:339 msgid "Ignored" msgstr "" -#: src/Module/Contact.php:334 +#: src/Module/Contact.php:336 msgid "Only show ignored contacts" msgstr "" -#: src/Module/Contact.php:339 src/Module/Contact.php:379 +#: src/Module/Contact.php:341 src/Module/Contact.php:381 msgid "Archived" msgstr "" -#: src/Module/Contact.php:342 +#: src/Module/Contact.php:344 msgid "Only show archived contacts" msgstr "" -#: src/Module/Contact.php:347 src/Module/Contact.php:377 +#: src/Module/Contact.php:349 src/Module/Contact.php:379 msgid "Hidden" msgstr "" -#: src/Module/Contact.php:350 +#: src/Module/Contact.php:352 msgid "Only show hidden contacts" msgstr "" -#: src/Module/Contact.php:358 +#: src/Module/Contact.php:360 msgid "Organize your contact groups" msgstr "" -#: src/Module/Contact.php:390 +#: src/Module/Contact.php:392 msgid "Search your contacts" msgstr "" -#: src/Module/Contact.php:391 src/Module/Search/Index.php:207 +#: src/Module/Contact.php:393 src/Module/Search/Index.php:207 #, php-format msgid "Results for: %s" msgstr "" -#: src/Module/Contact.php:398 +#: src/Module/Contact.php:400 msgid "Update" msgstr "" -#: src/Module/Contact.php:400 src/Module/Contact/Profile.php:349 +#: src/Module/Contact.php:402 src/Module/Contact/Profile.php:349 #: src/Module/Contact/Profile.php:457 msgid "Unignore" msgstr "" -#: src/Module/Contact.php:402 +#: src/Module/Contact.php:404 msgid "Batch Actions" msgstr "" -#: src/Module/Contact.php:437 +#: src/Module/Contact.php:439 msgid "Conversations started by this contact" msgstr "" -#: src/Module/Contact.php:442 +#: src/Module/Contact.php:444 msgid "Posts and Comments" msgstr "" -#: src/Module/Contact.php:453 +#: src/Module/Contact.php:455 msgid "Posts containing media objects" msgstr "" -#: src/Module/Contact.php:468 +#: src/Module/Contact.php:470 msgid "View all known contacts" msgstr "" -#: src/Module/Contact.php:478 +#: src/Module/Contact.php:480 msgid "Advanced Contact Settings" msgstr "" -#: src/Module/Contact.php:512 +#: src/Module/Contact.php:514 msgid "Mutual Friendship" msgstr "" -#: src/Module/Contact.php:516 +#: src/Module/Contact.php:518 msgid "is a fan of yours" msgstr "" -#: src/Module/Contact.php:520 +#: src/Module/Contact.php:522 msgid "you are a fan of" msgstr "" -#: src/Module/Contact.php:538 +#: src/Module/Contact.php:540 msgid "Pending outgoing contact request" msgstr "" -#: src/Module/Contact.php:540 +#: src/Module/Contact.php:542 msgid "Pending incoming contact request" msgstr "" -#: src/Module/Contact.php:553 src/Module/Contact/Profile.php:334 +#: src/Module/Contact.php:555 src/Module/Contact/Profile.php:334 #, php-format msgid "Visit %s's profile [%s]" msgstr "" @@ -7262,44 +7262,44 @@ msgid "" "not reflect the opinions of this node’s users." msgstr "" -#: src/Module/Conversation/Community.php:76 +#: src/Module/Conversation/Community.php:74 msgid "Local Community" msgstr "" -#: src/Module/Conversation/Community.php:79 +#: src/Module/Conversation/Community.php:77 msgid "Posts from local users on this server" msgstr "" -#: src/Module/Conversation/Community.php:87 +#: src/Module/Conversation/Community.php:85 msgid "Global Community" msgstr "" -#: src/Module/Conversation/Community.php:90 +#: src/Module/Conversation/Community.php:88 msgid "Posts from users of the whole federated network" msgstr "" -#: src/Module/Conversation/Community.php:123 +#: src/Module/Conversation/Community.php:121 msgid "Own Contacts" msgstr "" -#: src/Module/Conversation/Community.php:127 +#: src/Module/Conversation/Community.php:125 msgid "Include" msgstr "" -#: src/Module/Conversation/Community.php:128 +#: src/Module/Conversation/Community.php:126 msgid "Hide" msgstr "" -#: src/Module/Conversation/Community.php:145 src/Module/Search/Index.php:152 +#: src/Module/Conversation/Community.php:143 src/Module/Search/Index.php:152 #: src/Module/Search/Index.php:194 msgid "No results." msgstr "" -#: src/Module/Conversation/Community.php:201 +#: src/Module/Conversation/Community.php:199 msgid "Community option not available." msgstr "" -#: src/Module/Conversation/Community.php:217 +#: src/Module/Conversation/Community.php:215 msgid "Not available." msgstr "" From f862d73f49d5d1e4b65bb9d62eb1fc02703f32b9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 15 Oct 2022 09:25:11 +0200 Subject: [PATCH 029/641] added PHP GMP module to the installation section of the Vagrant VM provision --- bin/dev/vagrant_provision.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index 3992550ee..d82ed2823 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -51,7 +51,7 @@ service apache2 restart #Install php echo ">>> Installing PHP7" -apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip +apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip php-gmp systemctl restart apache2 echo ">>> Installing PHP8" @@ -59,7 +59,7 @@ apt-get install -qq -y lsb-release ca-certificates apt-transport-https software- echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add - apt update -apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip +apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip php8.0-gmp systemctl restart apache2 #Install mysql From 8e1af9277a48f74f66b97271657c082154f38450 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 15 Oct 2022 13:00:52 +0000 Subject: [PATCH 030/641] Improve quite generation --- src/Content/Item.php | 10 ++++++--- src/Content/Text/BBCode.php | 18 ++++++++++++++- src/Model/Item.php | 7 +++--- src/Protocol/ActivityPub/Transmitter.php | 28 +++++++++++++++++++----- 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 6cbcb6369..1838d4ac4 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -574,9 +574,10 @@ class Item * * @param string $url * @param integer $uid + * @param bool $add_media * @return string */ - public function createSharedPostByUrl(string $url, int $uid = 0): string + public function createSharedPostByUrl(string $url, int $uid = 0, bool $add_media = false): string { if (!empty($uid)) { $id = ModelItem::searchByLink($url, $uid); @@ -599,7 +600,7 @@ class Item return ''; } - return $this->createSharedBlockByArray($shared_item); + return $this->createSharedBlockByArray($shared_item, $add_media); } /** @@ -652,9 +653,10 @@ class Item * Add a share block for the given item array * * @param array $item + * @param bool $add_media * @return string */ - public function createSharedBlockByArray(array $item): string + public function createSharedBlockByArray(array $item, bool $add_media = false): string { if ($item['network'] == Protocol::FEED) { return PageInfo::getFooterFromUrl($item['plink']); @@ -662,6 +664,8 @@ class Item $item['guid'] = ''; $item['uri'] = ''; $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + } elseif ($add_media) { + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); } $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']); diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 59b2e77a4..d03161df9 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1085,6 +1085,22 @@ class BBCode ); } + /** + * Remove the share block + * + * @param string $body + * @return string + */ + public static function removeSharedData(string $body): string + { + return BBCode::convertShare( + $body, + function (array $attributes) { + return ''; + } + ); + } + /** * This function converts a [share] block to text according to a provided callback function whose signature is: * @@ -1134,7 +1150,7 @@ class BBCode ); DI::profiler()->stopRecording(); - return $return; + return trim($return); } /** diff --git a/src/Model/Item.php b/src/Model/Item.php index ceb8fcc88..439c1b990 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1123,7 +1123,7 @@ class Item if (!empty($quote_id) && Post::exists(['uri-id' => $quote_id, 'network' => Protocol::FEDERATED])) { $item['quote-uri-id'] = $quote_id; - $item['raw-body'] = BBCode::replaceSharedData($item['raw-body']); + $item['raw-body'] = BBCode::removeSharedData($item['raw-body']); } if (!DBA::exists('contact', ['id' => $item['author-id'], 'network' => Protocol::DFRN])) { @@ -3612,9 +3612,10 @@ class Item * Improve the data in shared posts * * @param array $item + * @param bool $add_media * @return string body */ - public static function improveSharedDataInBody(array $item): string + public static function improveSharedDataInBody(array $item, bool $add_media = false): string { $shared = BBCode::fetchShareAttributes($item['body']); if (empty($shared['guid']) && empty($shared['message_id'])) { @@ -3624,7 +3625,7 @@ class Item $link = $shared['link'] ?: $shared['message_id']; if (empty($shared_content)) { - $shared_content = DI::contentItem()->createSharedPostByUrl($link, $item['uid'] ?? 0); + $shared_content = DI::contentItem()->createSharedPostByUrl($link, $item['uid'] ?? 0, $add_media); } if (empty($shared_content)) { diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index de9a3535f..c37fefb42 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -40,6 +40,7 @@ use Friendica\Model\User; use Friendica\Network\HTTPException; use Friendica\Protocol\Activity; use Friendica\Protocol\ActivityPub; +use Friendica\Protocol\Diaspora; use Friendica\Protocol\Relay; use Friendica\Util\DateTimeFormat; use Friendica\Util\HTTPSignature; @@ -1621,6 +1622,8 @@ class Transmitter $permission_block = self::createPermissionBlockForItem($item, false); + $real_quote = false; + $body = $item['body']; if ($type == 'Note') { @@ -1662,9 +1665,22 @@ class Transmitter $body = BBCode::setMentionsToNicknames($body); - if (!empty($item['quote-uri'])) { - $body = BBCode::replaceSharedData($body); + if (!empty($item['quote-uri']) && Post::exists(['uri-id' => $item['quote-uri-id'], 'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN]])) { + $real_quote = true; + if (Diaspora::isReshare($body, false)) { + $body = BBCode::replaceSharedData($body); + } elseif (strpos($body, $item['quote-uri']) === false) { + $body .= "\n♲ " . $item['quote-uri']; + } $data['quoteUrl'] = $item['quote-uri']; + } elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) { + $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; + $shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]); + if (!empty($shared_item['uri-id'])) { + $shared_item['body'] = Post\Media::addAttachmentsToBody($shared_item['uri-id'], $shared_item['body']); + $body .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item); + $item['body'] = Item::improveSharedDataInBody($item, true); + } } $data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB); @@ -1677,9 +1693,11 @@ class Transmitter if (!empty($language)) { $richbody = BBCode::setMentionsToNicknames($item['body'] ?? ''); - $shared = BBCode::fetchShareAttributes($richbody); - if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) { - $richbody = BBCode::replaceSharedData($richbody); + if ($real_quote) { + $shared = BBCode::fetchShareAttributes($richbody); + if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) { + $richbody = BBCode::replaceSharedData($richbody); + } } $richbody = BBCode::removeAttachment($richbody); From 49ed627aedb39f0d627d919daf5470c884bdba81 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 15 Oct 2022 17:31:57 +0200 Subject: [PATCH 031/641] change IP of Vagrant VM --- Vagrantfile | 2 +- bin/dev/vagrant_provision.sh | 2 +- mods/local.config.vagrant.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 4684d9f09..168735123 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,5 +1,5 @@ -server_ip = "192.168.22.10" +server_ip = "192.168.56.10" server_memory = "2048" # MB server_timezone = "UTC" diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index d82ed2823..40d08cedb 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -45,7 +45,7 @@ apt-get install -qq apache2 a2enmod rewrite actions ssl cp /vagrant/bin/dev/vagrant_vhost.sh /usr/local/bin/vhost chmod guo+x /usr/local/bin/vhost -vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local +vhost -s 192.168.56.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local a2dissite 000-default service apache2 restart diff --git a/mods/local.config.vagrant.php b/mods/local.config.vagrant.php index 98e9a42e7..da873116d 100644 --- a/mods/local.config.vagrant.php +++ b/mods/local.config.vagrant.php @@ -29,7 +29,7 @@ return [ // **************************************************************** 'config' => [ - 'hostname' => 'friendica.local', + 'hostname' => '192.168.56.10', 'admin_email' => 'admin@friendica.local', 'sitename' => 'Friendica Social Network', 'register_policy' => \Friendica\Module\Register::OPEN, From 9383d7849b9a3518dd7aa1476e43539387bf54f9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 15 Oct 2022 17:33:47 +0200 Subject: [PATCH 032/641] adopt IP change in the Vagrant docs --- doc/Vagrant.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Vagrant.md b/doc/Vagrant.md index 3751b7bc0..ea098e3fb 100644 --- a/doc/Vagrant.md +++ b/doc/Vagrant.md @@ -10,7 +10,7 @@ Getting started No need to setup up a webserver, database etc. before actually starting. Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica. -It brings an Debian Bullseye with PHP 7.4 and MariaDB 10.5.11. +It brings an Debian Bullseye with PHP 8.0 and MariaDB 10.5.11. What you need to do: @@ -24,7 +24,7 @@ This will start the virtual machine. Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica. 4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server. 5. Open you test installation in a browser. -Go to friendica.local (or 192.168.22.10). +Go to friendica.local (or 192.168.56.10). friendica.local is using a self-signed TLS certificate, so you will need to add an exception to trust the certificate the first time you are visiting the page. The mysql database is called "friendica", the mysql user and password both are "friendica". 6. Work on Friendica's code in your git clone on your machine (not in the VM). @@ -66,4 +66,4 @@ On the next Vagrant up, the version problem should be fixed. If `friendica.local` is not resolved, you may need to add an entry to the `/etc/hosts` file (or similar configuration depending on the OS you are using). -For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/). \ No newline at end of file +For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/). From a192e099abb66f003cfa487fc0d52921a7a99180 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 16 Oct 2022 10:14:18 +0200 Subject: [PATCH 033/641] [docs] note the preference of MariaDB over other MySQL implementation in the install docs --- doc/Install.md | 2 +- doc/de/Install.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Install.md b/doc/Install.md index b109113ef..d0c3576ac 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -34,7 +34,7 @@ Due to the large variety of operating systems and PHP platforms in existence we * The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it) * Some form of email server or email gateway such that PHP mail() works. If you cannot set up your own email server, you can use the [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) addon and use a remote SMTP server. -* MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.) +* MySQL with support of InnoDB and Barracuda (we suggest a MariaDB server as all development is done using these, but alternatives like MySQL or Percona Server etc. might work as well) * ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks (Windows) * installation into a top-level domain or sub-domain (without a directory/path component in the URL) is RECOMMENDED. Directory paths will not be as convenient to use and have not been thoroughly tested. This is REQUIRED if you wish to communicate with the Diaspora network. diff --git a/doc/de/Install.md b/doc/de/Install.md index 03a46f615..94ca08a2b 100644 --- a/doc/de/Install.md +++ b/doc/de/Install.md @@ -31,7 +31,7 @@ Requirements * Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert) * Einen E-Mail Server, so dass PHP `mail()` funktioniert. Wenn kein eigener E-Mail Server zur Verfügung steht, kann alternativ das [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) Addon mit einem externen SMTP Account verwendet werden. -* Mysql 5.6+ (oder eine äquivalente Alternative: MariaDB, Percona Server etc.) +* Mysql Server mit Unterstützung vom InnoDB und Barracuda (wir empfehlen MariaDB da die Entwicklung mit solchen Server erfolgt, aber Alternativen wie MySQL, Percona Server etc. sollten auch funktionieren) * die Möglichkeit, wiederkehrende Aufgaben mit cron (Linux/Mac) oder "Scheduled Tasks" einzustellen (Windows) [Beachte: andere Optionen sind in Abschnitt 7 dieser Dokumentation zu finden] * Installation in einer Top-Level-Domain oder Subdomain (ohne eine Verzeichnis/Pfad-Komponente in der URL) wird bevorzugt. Verzeichnispfade sind für diesen Zweck nicht so günstig und wurden auch nicht ausführlich getestet. From d826fe0a3bccca8d8fd7fdee567a81994b6bde5a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 16 Oct 2022 11:24:50 -0400 Subject: [PATCH 034/641] Refactor files related to the Compose page and frio theme settings - Use dependencies instead of most DI calls in Module\Item\Compose - Group translation strings in a subkey of the template variables array - Rewrite array initializations in theme/frio/config --- src/Content/Conversation.php | 2 +- src/Module/Item/Compose.php | 114 ++++++++++++++++++++------------ view/templates/item/compose.tpl | 46 ++++++------- view/theme/frio/config.php | 73 ++++++++++---------- 4 files changed, 134 insertions(+), 101 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 744e9ed18..237d192fd 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -328,7 +328,7 @@ class Conversation $created_at = ''; } - $tpl = Renderer::getMarkupTemplate("jot.tpl"); + $tpl = Renderer::getMarkupTemplate('jot.tpl'); $o .= Renderer::replaceMacros($tpl, [ '$new_post' => $this->l10n->t('New Post'), diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index a3ca4296a..895a548e4 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -22,10 +22,13 @@ namespace Friendica\Module\Item; use DateTime; +use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Feature; use Friendica\Core\ACL; use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Renderer; use Friendica\Core\Theme; use Friendica\Database\DBA; @@ -33,13 +36,40 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\User; +use Friendica\Module\Response; use Friendica\Module\Security\Login; +use Friendica\Navigation\SystemMessages; use Friendica\Network\HTTPException\NotImplementedException; +use Friendica\Util\ACLFormatter; use Friendica\Util\Crypto; +use Friendica\Util\Profiler; use Friendica\Util\Temporal; +use Psr\Log\LoggerInterface; class Compose extends BaseModule { + /** @var SystemMessages */ + private $systemMessages; + + /** @var ACLFormatter */ + private $ACLFormatter; + + /** @var App\Page */ + private $page; + + /** @var IManagePersonalConfigValues */ + private $pConfig; + + public function __construct(IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + { + parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); + + $this->systemMessages = $systemMessages; + $this->ACLFormatter = $ACLFormatter; + $this->page = $page; + $this->pConfig = $pConfig; + } + protected function post(array $request = []) { if (!empty($_REQUEST['body'])) { @@ -47,23 +77,22 @@ class Compose extends BaseModule require_once 'mod/item.php'; item_post(DI::app()); } else { - notice(DI::l10n()->t('Please enter a post body.')); + $this->systemMessages->addNotice($this->l10n->t('Please enter a post body.')); } } protected function content(array $request = []): string { if (!local_user()) { - return Login::form('compose', false); + return Login::form('compose'); } $a = DI::app(); if ($a->getCurrentTheme() !== 'frio') { - throw new NotImplementedException(DI::l10n()->t('This feature is only available with the frio theme.')); + throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.')); } - /// @TODO Retrieve parameter from router $posttype = $this->parameters['type'] ?? Item::PT_ARTICLE; if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) { switch ($posttype) { @@ -78,16 +107,14 @@ class Compose extends BaseModule $user = User::getById(local_user(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'default-location']); - $aclFormatter = DI::aclFormatter(); - - $contact_allow_list = $aclFormatter->expand($user['allow_cid']); - $group_allow_list = $aclFormatter->expand($user['allow_gid']); - $contact_deny_list = $aclFormatter->expand($user['deny_cid']); - $group_deny_list = $aclFormatter->expand($user['deny_gid']); + $contact_allow_list = $this->ACLFormatter->expand($user['allow_cid']); + $group_allow_list = $this->ACLFormatter->expand($user['allow_gid']); + $contact_deny_list = $this->ACLFormatter->expand($user['deny_cid']); + $group_deny_list = $this->ACLFormatter->expand($user['deny_gid']); switch ($posttype) { case Item::PT_PERSONAL_NOTE: - $compose_title = DI::l10n()->t('Compose new personal note'); + $compose_title = $this->l10n->t('Compose new personal note'); $type = 'note'; $doesFederate = false; $contact_allow_list = [$a->getContactId()]; @@ -96,7 +123,7 @@ class Compose extends BaseModule $group_deny_list = []; break; default: - $compose_title = DI::l10n()->t('Compose new post'); + $compose_title = $this->l10n->t('Compose new post'); $type = 'post'; $doesFederate = true; @@ -129,13 +156,13 @@ class Compose extends BaseModule Hook::callAll('jot_tool', $jotplugins); // Output - DI::page()->registerFooterScript(Theme::getPathForFile('js/ajaxupload.js')); - DI::page()->registerFooterScript(Theme::getPathForFile('js/linkPreview.js')); - DI::page()->registerFooterScript(Theme::getPathForFile('js/compose.js')); + $this->page->registerFooterScript(Theme::getPathForFile('js/ajaxupload.js')); + $this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js')); + $this->page->registerFooterScript(Theme::getPathForFile('js/compose.js')); $contact = Contact::getById($a->getContactId()); - if (DI::config()->get(local_user(), 'system', 'set_creation_date')) { + if ($this->pConfig->get(local_user(), 'system', 'set_creation_date')) { $created_at = Temporal::getDateTimeField( new \DateTime(DBA::NULL_DATETIME), new \DateTime('now'), @@ -149,39 +176,42 @@ class Compose extends BaseModule $tpl = Renderer::getMarkupTemplate('item/compose.tpl'); return Renderer::replaceMacros($tpl, [ - '$compose_title'=> $compose_title, - '$visibility_title'=> DI::l10n()->t('Visibility'), + '$l10n' => [ + 'compose_title' => $compose_title, + 'default' => '', + 'visibility_title' => $this->l10n->t('Visibility'), + 'mytitle' => $this->l10n->t('This is you'), + 'submit' => $this->l10n->t('Submit'), + 'edbold' => $this->l10n->t('Bold'), + 'editalic' => $this->l10n->t('Italic'), + 'eduline' => $this->l10n->t('Underline'), + 'edquote' => $this->l10n->t('Quote'), + 'edcode' => $this->l10n->t('Code'), + 'edimg' => $this->l10n->t('Image'), + 'edurl' => $this->l10n->t('Link'), + 'edattach' => $this->l10n->t('Link or Media'), + 'prompttext' => $this->l10n->t('Please enter a image/video/audio/webpage URL:'), + 'preview' => $this->l10n->t('Preview'), + 'location_set' => $this->l10n->t('Set your location'), + 'location_clear' => $this->l10n->t('Clear the location'), + 'location_unavailable' => $this->l10n->t('Location services are unavailable on your device'), + 'location_disabled' => $this->l10n->t('Location services are disabled. Please check the website\'s permissions on your device'), + 'wait' => $this->l10n->t('Please wait'), + 'placeholdertitle' => $this->l10n->t('Set title'), + 'placeholdercategory' => Feature::isEnabled(local_user(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '', + ], + '$id' => 0, '$posttype' => $posttype, '$type' => $type, '$wall' => $wall, - '$default' => '', - '$mylink' => DI::baseUrl()->remove($contact['url']), - '$mytitle' => DI::l10n()->t('This is you'), - '$myphoto' => DI::baseUrl()->remove($contact['thumb']), - '$submit' => DI::l10n()->t('Submit'), - '$edbold' => DI::l10n()->t('Bold'), - '$editalic' => DI::l10n()->t('Italic'), - '$eduline' => DI::l10n()->t('Underline'), - '$edquote' => DI::l10n()->t('Quote'), - '$edcode' => DI::l10n()->t('Code'), - '$edimg' => DI::l10n()->t('Image'), - '$edurl' => DI::l10n()->t('Link'), - '$edattach' => DI::l10n()->t('Link or Media'), - '$prompttext' => DI::l10n()->t('Please enter a image/video/audio/webpage URL:'), - '$preview' => DI::l10n()->t('Preview'), - '$location_set' => DI::l10n()->t('Set your location'), - '$location_clear' => DI::l10n()->t('Clear the location'), - '$location_unavailable' => DI::l10n()->t('Location services are unavailable on your device'), - '$location_disabled' => DI::l10n()->t('Location services are disabled. Please check the website\'s permissions on your device'), - '$wait' => DI::l10n()->t('Please wait'), - '$placeholdertitle' => DI::l10n()->t('Set title'), - '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t('Categories (comma-separated list)') : ''), + '$mylink' => $this->baseUrl->remove($contact['url']), + '$myphoto' => $this->baseUrl->remove($contact['thumb']), '$scheduled_at' => Temporal::getDateTimeField( new DateTime(), new DateTime('now + 6 months'), null, - DI::l10n()->t('Scheduled at'), + $this->l10n->t('Scheduled at'), 'scheduled_at' ), '$created_at' => $created_at, @@ -197,7 +227,7 @@ class Compose extends BaseModule '$jotplugins' => $jotplugins, '$rand_num' => Crypto::randomDigits(12), - '$acl_selector' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), $doesFederate, [ + '$acl_selector' => ACL::getFullSelectorHTML($this->page, $a->getLoggedInUserId(), $doesFederate, [ 'allow_cid' => $contact_allow_list, 'allow_gid' => $group_allow_list, 'deny_cid' => $contact_deny_list, diff --git a/view/templates/item/compose.tpl b/view/templates/item/compose.tpl index cbab655d2..a01ea95a0 100644 --- a/view/templates/item/compose.tpl +++ b/view/templates/item/compose.tpl @@ -1,5 +1,5 @@
-

{{$compose_title}}

+

{{$l10n.compose_title}}

{{**}} @@ -8,74 +8,72 @@
- +
- {{if $placeholdercategory}} + {{if $l10n.placeholdercategory}}
- +
{{/if}}

- - - - - - -

- +

{{if $type == 'post'}} - + {{/if}} - + - {{if $preview}} - - {{/if}} - + +

{{if $type == 'post'}} -

{{$visibility_title}}

+

{{$l10n.visibility_title}}

{{$acl_selector nofilter}}
diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 7445155f9..1ee67db3d 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -43,7 +43,7 @@ function theme_post(App $a) 'background_image', 'bg_image_option', 'login_bg_image', - 'login_bg_color' + 'login_bg_color', ] as $field) { if (isset($_POST['frio_' . $field])) { DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]); @@ -73,7 +73,7 @@ function theme_admin_post(App $a) 'background_image', 'bg_image_option', 'login_bg_image', - 'login_bg_color' + 'login_bg_color', ] as $field) { if (isset($_POST['frio_' . $field])) { DI::config()->set('frio', $field, $_POST['frio_' . $field]); @@ -84,48 +84,55 @@ function theme_admin_post(App $a) } } -function theme_content(App $a) +function theme_content(): string { if (!local_user()) { - return; + return ''; } - $arr = []; - $node_scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'scheme')); + $arr = [ + 'scheme' => DI::pConfig()->get(local_user(), 'frio', 'scheme', + DI::pConfig()->get(local_user(), 'frio', 'schema', + DI::config()->get('frio', 'scheme', + DI::config()->get('frio', 'schema') + ) + ) + ), - $arr['scheme'] = DI::pConfig()->get(local_user(), 'frio', 'scheme', DI::pConfig()->get(local_user(), 'frio', 'schema', $node_scheme)); - $arr['scheme_accent'] = DI::pConfig()->get(local_user(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')); - $arr['share_string'] = ''; - $arr['nav_bg'] = DI::pConfig()->get(local_user(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')); - $arr['nav_icon_color'] = DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')); - $arr['link_color'] = DI::pConfig()->get(local_user(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')); - $arr['background_color'] = DI::pConfig()->get(local_user(), 'frio', 'background_color', DI::config()->get('frio', 'background_color')); - $arr['contentbg_transp'] = DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp', DI::config()->get('frio', 'contentbg_transp')); - $arr['background_image'] = DI::pConfig()->get(local_user(), 'frio', 'background_image', DI::config()->get('frio', 'background_image')); - $arr['bg_image_option'] = DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')); + 'share_string' => '', + 'scheme_accent' => DI::pConfig()->get(local_user(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')), + 'nav_bg' => DI::pConfig()->get(local_user(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')), + 'nav_icon_color' => DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')), + 'link_color' => DI::pConfig()->get(local_user(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')), + 'background_color' => DI::pConfig()->get(local_user(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')), + 'contentbg_transp' => DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')), + 'background_image' => DI::pConfig()->get(local_user(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')), + 'bg_image_option' => DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')), + ]; return frio_form($arr); } -function theme_admin(App $a) +function theme_admin(): string { if (!local_user()) { - return; + return ''; } - $arr = []; - $arr['scheme'] = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); - $arr['scheme_accent'] = DI::config()->get('frio', 'scheme_accent'); - $arr['share_string'] = ''; - $arr['nav_bg'] = DI::config()->get('frio', 'nav_bg'); - $arr['nav_icon_color'] = DI::config()->get('frio', 'nav_icon_color'); - $arr['link_color'] = DI::config()->get('frio', 'link_color'); - $arr['background_color'] = DI::config()->get('frio', 'background_color'); - $arr['contentbg_transp'] = DI::config()->get('frio', 'contentbg_transp'); - $arr['background_image'] = DI::config()->get('frio', 'background_image'); - $arr['bg_image_option'] = DI::config()->get('frio', 'bg_image_option'); - $arr['login_bg_image'] = DI::config()->get('frio', 'login_bg_image'); - $arr['login_bg_color'] = DI::config()->get('frio', 'login_bg_color'); + $arr = [ + 'scheme' => DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')), + 'scheme_accent' => DI::config()->get('frio', 'scheme_accent'), + 'share_string' => '', + 'nav_bg' => DI::config()->get('frio', 'nav_bg'), + 'nav_icon_color' => DI::config()->get('frio', 'nav_icon_color'), + 'link_color' => DI::config()->get('frio', 'link_color'), + 'background_color' => DI::config()->get('frio', 'background_color'), + 'contentbg_transp' => DI::config()->get('frio', 'contentbg_transp'), + 'background_image' => DI::config()->get('frio', 'background_image'), + 'bg_image_option' => DI::config()->get('frio', 'bg_image_option'), + 'login_bg_image' => DI::config()->get('frio', 'login_bg_image'), + 'login_bg_color' => DI::config()->get('frio', 'login_bg_color'), + ]; return frio_form($arr); } @@ -183,7 +190,5 @@ function frio_form($arr) $ctx['$login_bg_color'] = ['frio_login_bg_color', DI::l10n()->t('Login page background color'), $arr['login_bg_color'], DI::l10n()->t('Leave background image and color empty for theme defaults'), false]; } - $o = Renderer::replaceMacros($t, $ctx); - - return $o; + return Renderer::replaceMacros($t, $ctx); } From e556dc3c31101d880d9bc7a1188bb107fe57a246 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 16 Oct 2022 11:49:27 -0400 Subject: [PATCH 035/641] Add new frio.always_open_compose setting - This setting allows the New Post button to always open the Compose page instead of the modal by default --- src/Content/Conversation.php | 3 ++- src/Module/Item/Compose.php | 10 +++++++++- view/templates/item/compose.tpl | 3 +++ view/theme/frio/config.php | 6 ++++++ view/theme/frio/js/theme.js | 10 ++++++---- view/theme/frio/templates/jot.tpl | 2 +- view/theme/frio/templates/theme_settings.tpl | 2 ++ 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 237d192fd..84f75cff3 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -393,7 +393,8 @@ class Conversation '$message' => $this->l10n->t('Message'), '$browser' => $this->l10n->t('Browser'), - '$compose_link_title' => $this->l10n->t('Open Compose page'), + '$compose_link_title' => $this->l10n->t('Open Compose page'), + '$always_open_compose' => $this->pConfig->get(local_user(), 'frio', 'always_open_compose', false), ]); diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index 895a548e4..bd531d484 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -26,6 +26,7 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Feature; use Friendica\Core\ACL; +use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; @@ -60,7 +61,10 @@ class Compose extends BaseModule /** @var IManagePersonalConfigValues */ private $pConfig; - public function __construct(IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + /** @var IManageConfigValues */ + private $config; + + public function __construct(IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -68,6 +72,7 @@ class Compose extends BaseModule $this->ACLFormatter = $ACLFormatter; $this->page = $page; $this->pConfig = $pConfig; + $this->config = $config; } protected function post(array $request = []) @@ -199,6 +204,9 @@ class Compose extends BaseModule 'wait' => $this->l10n->t('Please wait'), 'placeholdertitle' => $this->l10n->t('Set title'), 'placeholdercategory' => Feature::isEnabled(local_user(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '', + 'always_open_compose' => $this->pConfig->get(local_user(), 'frio', 'always_open_compose', + $this->config->get('frio', 'always_open_compose', false)) ? '' : + $this->l10n->t('You can make this page always open when you use the New Post button in the Theme Customization settings.'), ], '$id' => 0, diff --git a/view/templates/item/compose.tpl b/view/templates/item/compose.tpl index a01ea95a0..5583650e0 100644 --- a/view/templates/item/compose.tpl +++ b/view/templates/item/compose.tpl @@ -1,5 +1,8 @@

{{$l10n.compose_title}}

+ {{if $l10n.always_open_compose}} +

{{$l10n.always_open_compose nofilter}}

+ {{/if}}
{{**}} diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 1ee67db3d..2dcf00204 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -44,6 +44,7 @@ function theme_post(App $a) 'bg_image_option', 'login_bg_image', 'login_bg_color', + 'always_open_compose', ] as $field) { if (isset($_POST['frio_' . $field])) { DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]); @@ -74,6 +75,7 @@ function theme_admin_post(App $a) 'bg_image_option', 'login_bg_image', 'login_bg_color', + 'always_open_compose', ] as $field) { if (isset($_POST['frio_' . $field])) { DI::config()->set('frio', $field, $_POST['frio_' . $field]); @@ -108,6 +110,7 @@ function theme_content(): string 'contentbg_transp' => DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')), 'background_image' => DI::pConfig()->get(local_user(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')), 'bg_image_option' => DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')), + 'always_open_compose' => DI::pConfig()->get(local_user(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)), ]; return frio_form($arr); @@ -132,6 +135,7 @@ function theme_admin(): string 'bg_image_option' => DI::config()->get('frio', 'bg_image_option'), 'login_bg_image' => DI::config()->get('frio', 'login_bg_image'), 'login_bg_color' => DI::config()->get('frio', 'login_bg_color'), + 'always_open_compose' => DI::config()->get('frio', 'always_open_compose', false), ]; return frio_form($arr); @@ -180,6 +184,8 @@ function frio_form($arr) '$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', DI::l10n()->t('Set the background image'), $arr['background_image'], $background_image_help, false], '$bg_image_options_title' => DI::l10n()->t('Background image style'), '$bg_image_options' => Image::get_options($arr), + + '$always_open_compose' => ['frio_always_open_compose', DI::l10n()->t('Always open Compose page'), $arr['always_open_compose'], DI::l10n()->t('The New Post button always open the Compose page instead of the modal form. When this is disabled, the Compose page can be accessed with a middle click on the link or from the modal.')], ]; if (array_key_exists('login_bg_image', $arr) && !array_key_exists('login_bg_image', $disable)) { diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index edd7282f7..60aa88ba5 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -87,10 +87,12 @@ $(document).ready(function () { if ($("#jot-popup").is(":hidden")) { $jotButton.hide(); } - $jotButton.on("click", function (e) { - e.preventDefault(); - jotShow(); - }); + if ($jotButton.hasClass('modal-open')) { + $jotButton.on("click", function (e) { + e.preventDefault(); + jotShow(); + }); + } } let $body = $("body"); diff --git a/view/theme/frio/templates/jot.tpl b/view/theme/frio/templates/jot.tpl index 0f878d4c5..c38e8531c 100644 --- a/view/theme/frio/templates/jot.tpl +++ b/view/theme/frio/templates/jot.tpl @@ -1,5 +1,5 @@ {{* The button to open the jot - in This theme we move the button with js to the second nav bar *}} - +
diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl index 7dfc49719..3c3c9cc2e 100644 --- a/view/theme/frio/templates/theme_settings.tpl +++ b/view/theme/frio/templates/theme_settings.tpl @@ -209,6 +209,8 @@ }); +{{include file="field_checkbox.tpl" field=$always_open_compose}} +
From bcc1350f1d905ff162deb26605a02dbc640928aa Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 16 Oct 2022 13:21:43 -0400 Subject: [PATCH 036/641] Updated main translation file after adding strings --- view/lang/C/messages.po | 205 ++++++++++++++++++++++------------------ 1 file changed, 111 insertions(+), 94 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 1552d9cf3..eed528689 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-14 22:46+0000\n" +"POT-Creation-Date: 2022-10-16 12:38-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -212,7 +212,7 @@ msgid "audio link" msgstr "" #: mod/editpost.php:103 src/Content/Conversation.php:352 -#: src/Module/Item/Compose.php:173 +#: src/Module/Item/Compose.php:200 msgid "Set your location" msgstr "" @@ -230,7 +230,7 @@ msgstr "" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1489 mod/wallmessage.php:142 src/Content/Conversation.php:368 -#: src/Content/Conversation.php:713 src/Module/Item/Compose.php:177 +#: src/Content/Conversation.php:714 src/Module/Item/Compose.php:204 #: src/Object/Post.php:538 msgid "Please wait" msgstr "" @@ -248,12 +248,12 @@ msgid "Public post" msgstr "" #: mod/editpost.php:120 src/Content/Conversation.php:357 -#: src/Module/Item/Compose.php:178 +#: src/Module/Item/Compose.php:205 msgid "Set title" msgstr "" #: mod/editpost.php:122 src/Content/Conversation.php:359 -#: src/Module/Item/Compose.php:179 +#: src/Module/Item/Compose.php:206 msgid "Categories (comma-separated list)" msgstr "" @@ -263,7 +263,7 @@ msgstr "" #: mod/editpost.php:128 mod/events.php:513 mod/photos.php:1337 #: mod/photos.php:1393 mod/photos.php:1467 src/Content/Conversation.php:383 -#: src/Module/Item/Compose.php:172 src/Object/Post.php:1003 +#: src/Module/Item/Compose.php:199 src/Object/Post.php:1003 msgid "Preview" msgstr "" @@ -276,37 +276,37 @@ msgid "Cancel" msgstr "" #: mod/editpost.php:134 src/Content/Conversation.php:343 -#: src/Module/Item/Compose.php:163 src/Object/Post.php:994 +#: src/Module/Item/Compose.php:190 src/Object/Post.php:994 msgid "Bold" msgstr "" #: mod/editpost.php:135 src/Content/Conversation.php:344 -#: src/Module/Item/Compose.php:164 src/Object/Post.php:995 +#: src/Module/Item/Compose.php:191 src/Object/Post.php:995 msgid "Italic" msgstr "" #: mod/editpost.php:136 src/Content/Conversation.php:345 -#: src/Module/Item/Compose.php:165 src/Object/Post.php:996 +#: src/Module/Item/Compose.php:192 src/Object/Post.php:996 msgid "Underline" msgstr "" #: mod/editpost.php:137 src/Content/Conversation.php:346 -#: src/Module/Item/Compose.php:166 src/Object/Post.php:997 +#: src/Module/Item/Compose.php:193 src/Object/Post.php:997 msgid "Quote" msgstr "" #: mod/editpost.php:138 src/Content/Conversation.php:347 -#: src/Module/Item/Compose.php:167 src/Object/Post.php:998 +#: src/Module/Item/Compose.php:194 src/Object/Post.php:998 msgid "Code" msgstr "" #: mod/editpost.php:139 src/Content/Conversation.php:349 -#: src/Module/Item/Compose.php:169 src/Object/Post.php:1000 +#: src/Module/Item/Compose.php:196 src/Object/Post.php:1000 msgid "Link" msgstr "" #: mod/editpost.php:140 src/Content/Conversation.php:350 -#: src/Module/Item/Compose.php:170 src/Object/Post.php:1001 +#: src/Module/Item/Compose.php:197 src/Object/Post.php:1001 msgid "Link or Media" msgstr "" @@ -415,9 +415,9 @@ msgstr "" #: src/Module/Delegation.php:148 src/Module/FriendSuggest.php:144 #: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:331 src/Module/Invite.php:178 -#: src/Module/Item/Compose.php:162 src/Module/Profile/Profile.php:247 +#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:247 #: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:992 -#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 +#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:171 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 msgid "Submit" msgstr "" @@ -1070,7 +1070,7 @@ msgid "Rotate CCW (left)" msgstr "" #: mod/photos.php:1333 mod/photos.php:1389 mod/photos.php:1463 -#: src/Module/Contact.php:547 src/Module/Item/Compose.php:160 +#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:989 msgid "This is you" msgstr "" @@ -1080,11 +1080,11 @@ msgstr "" msgid "Comment" msgstr "" -#: mod/photos.php:1424 src/Content/Conversation.php:629 src/Object/Post.php:256 +#: mod/photos.php:1424 src/Content/Conversation.php:630 src/Object/Post.php:256 msgid "Select" msgstr "" -#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:630 +#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:631 #: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140 #: src/Module/Admin/Users/Index.php:153 msgid "Delete" @@ -1947,7 +1947,7 @@ msgid "%s attends maybe." msgstr "" #: src/Content/Conversation.php:222 src/Content/Conversation.php:260 -#: src/Content/Conversation.php:873 +#: src/Content/Conversation.php:874 #, php-format msgid "%s reshared this." msgstr "" @@ -2020,7 +2020,7 @@ msgstr "" msgid "Visible to everybody" msgstr "" -#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:171 +#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:198 #: src/Object/Post.php:1002 msgid "Please enter a image/video/audio/webpage URL:" msgstr "" @@ -2041,7 +2041,7 @@ msgstr "" msgid "Delete item(s)?" msgstr "" -#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:143 +#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:175 msgid "Created at" msgstr "" @@ -2053,7 +2053,7 @@ msgstr "" msgid "Share" msgstr "" -#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:168 +#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:195 #: src/Object/Post.php:999 msgid "Image" msgstr "" @@ -2062,117 +2062,117 @@ msgstr "" msgid "Video" msgstr "" -#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:184 +#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:222 msgid "Scheduled at" msgstr "" -#: src/Content/Conversation.php:657 src/Object/Post.php:244 +#: src/Content/Conversation.php:658 src/Object/Post.php:244 msgid "Pinned item" msgstr "" -#: src/Content/Conversation.php:673 src/Object/Post.php:486 +#: src/Content/Conversation.php:674 src/Object/Post.php:486 #: src/Object/Post.php:487 #, php-format msgid "View %s's profile @ %s" msgstr "" -#: src/Content/Conversation.php:686 src/Object/Post.php:474 +#: src/Content/Conversation.php:687 src/Object/Post.php:474 msgid "Categories:" msgstr "" -#: src/Content/Conversation.php:687 src/Object/Post.php:475 +#: src/Content/Conversation.php:688 src/Object/Post.php:475 msgid "Filed under:" msgstr "" -#: src/Content/Conversation.php:695 src/Object/Post.php:500 +#: src/Content/Conversation.php:696 src/Object/Post.php:500 #, php-format msgid "%s from %s" msgstr "" -#: src/Content/Conversation.php:711 +#: src/Content/Conversation.php:712 msgid "View in context" msgstr "" -#: src/Content/Conversation.php:776 +#: src/Content/Conversation.php:777 msgid "remove" msgstr "" -#: src/Content/Conversation.php:780 +#: src/Content/Conversation.php:781 msgid "Delete Selected Items" msgstr "" -#: src/Content/Conversation.php:845 src/Content/Conversation.php:848 -#: src/Content/Conversation.php:851 src/Content/Conversation.php:854 +#: src/Content/Conversation.php:846 src/Content/Conversation.php:849 +#: src/Content/Conversation.php:852 src/Content/Conversation.php:855 #, php-format msgid "You had been addressed (%s)." msgstr "" -#: src/Content/Conversation.php:857 +#: src/Content/Conversation.php:858 #, php-format msgid "You are following %s." msgstr "" -#: src/Content/Conversation.php:860 +#: src/Content/Conversation.php:861 msgid "You subscribed to one or more tags in this post." msgstr "" -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 msgid "Reshared" msgstr "" -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 #, php-format msgid "Reshared by %s <%s>" msgstr "" -#: src/Content/Conversation.php:878 +#: src/Content/Conversation.php:879 #, php-format msgid "%s is participating in this thread." msgstr "" -#: src/Content/Conversation.php:881 +#: src/Content/Conversation.php:882 msgid "Stored for general reasons" msgstr "" -#: src/Content/Conversation.php:884 +#: src/Content/Conversation.php:885 msgid "Global post" msgstr "" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 msgid "Sent via an relay server" msgstr "" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 #, php-format msgid "Sent via the relay server %s <%s>" msgstr "" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 msgid "Fetched" msgstr "" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 #, php-format msgid "Fetched because of %s <%s>" msgstr "" -#: src/Content/Conversation.php:893 +#: src/Content/Conversation.php:894 msgid "Stored because of a child post to complete this thread." msgstr "" -#: src/Content/Conversation.php:896 +#: src/Content/Conversation.php:897 msgid "Local delivery" msgstr "" -#: src/Content/Conversation.php:899 +#: src/Content/Conversation.php:900 msgid "Stored because of your activity (like, comment, star, ...)" msgstr "" -#: src/Content/Conversation.php:902 +#: src/Content/Conversation.php:903 msgid "Distributed" msgstr "" -#: src/Content/Conversation.php:905 +#: src/Content/Conversation.php:906 msgid "Pushed to us" msgstr "" @@ -2628,39 +2628,39 @@ msgstr "" msgid "last" msgstr "" -#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1867 -#: src/Content/Text/BBCode.php:1868 +#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1883 +#: src/Content/Text/BBCode.php:1884 msgid "Image/photo" msgstr "" -#: src/Content/Text/BBCode.php:1222 +#: src/Content/Text/BBCode.php:1238 #, php-format msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1247 src/Model/Item.php:3429 +#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3429 #: src/Model/Item.php:3435 src/Model/Item.php:3436 msgid "Link to source" msgstr "" -#: src/Content/Text/BBCode.php:1785 src/Content/Text/HTML.php:940 +#: src/Content/Text/BBCode.php:1801 src/Content/Text/HTML.php:940 msgid "Click to open/close" msgstr "" -#: src/Content/Text/BBCode.php:1816 +#: src/Content/Text/BBCode.php:1832 msgid "$1 wrote:" msgstr "" -#: src/Content/Text/BBCode.php:1872 src/Content/Text/BBCode.php:1873 +#: src/Content/Text/BBCode.php:1888 src/Content/Text/BBCode.php:1889 msgid "Encrypted content" msgstr "" -#: src/Content/Text/BBCode.php:2093 +#: src/Content/Text/BBCode.php:2109 msgid "Invalid source protocol" msgstr "" -#: src/Content/Text/BBCode.php:2108 +#: src/Content/Text/BBCode.php:2124 msgid "Invalid link protocol" msgstr "" @@ -8094,40 +8094,46 @@ msgid "" "important, please visit http://friendi.ca" msgstr "" -#: src/Module/Item/Compose.php:50 +#: src/Module/Item/Compose.php:85 msgid "Please enter a post body." msgstr "" -#: src/Module/Item/Compose.php:63 +#: src/Module/Item/Compose.php:98 msgid "This feature is only available with the frio theme." msgstr "" -#: src/Module/Item/Compose.php:90 +#: src/Module/Item/Compose.php:122 msgid "Compose new personal note" msgstr "" -#: src/Module/Item/Compose.php:99 +#: src/Module/Item/Compose.php:131 msgid "Compose new post" msgstr "" -#: src/Module/Item/Compose.php:153 +#: src/Module/Item/Compose.php:187 msgid "Visibility" msgstr "" -#: src/Module/Item/Compose.php:174 +#: src/Module/Item/Compose.php:201 msgid "Clear the location" msgstr "" -#: src/Module/Item/Compose.php:175 +#: src/Module/Item/Compose.php:202 msgid "Location services are unavailable on your device" msgstr "" -#: src/Module/Item/Compose.php:176 +#: src/Module/Item/Compose.php:203 msgid "" "Location services are disabled. Please check the website's permissions on " "your device" msgstr "" +#: src/Module/Item/Compose.php:209 +msgid "" +"You can make this page always open when you use the New Post button in the " +"Theme Customization settings." +msgstr "" + #: src/Module/Item/Follow.php:52 msgid "Unable to follow this item." msgstr "" @@ -9456,7 +9462,7 @@ msgid "Content Settings" msgstr "" #: src/Module/Settings/Display.php:205 view/theme/duepuntozero/config.php:70 -#: view/theme/frio/config.php:161 view/theme/quattro/config.php:72 +#: view/theme/frio/config.php:172 view/theme/quattro/config.php:72 #: view/theme/vier/config.php:120 msgid "Theme settings" msgstr "" @@ -11119,113 +11125,124 @@ msgstr "" msgid "Variations" msgstr "" -#: view/theme/frio/config.php:142 +#: view/theme/frio/config.php:153 msgid "Light (Accented)" msgstr "" -#: view/theme/frio/config.php:143 +#: view/theme/frio/config.php:154 msgid "Dark (Accented)" msgstr "" -#: view/theme/frio/config.php:144 +#: view/theme/frio/config.php:155 msgid "Black (Accented)" msgstr "" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Note" msgstr "" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Check image permissions if all users are allowed to see the image" msgstr "" -#: view/theme/frio/config.php:162 +#: view/theme/frio/config.php:173 msgid "Custom" msgstr "" -#: view/theme/frio/config.php:163 +#: view/theme/frio/config.php:174 msgid "Legacy" msgstr "" -#: view/theme/frio/config.php:164 +#: view/theme/frio/config.php:175 msgid "Accented" msgstr "" -#: view/theme/frio/config.php:165 +#: view/theme/frio/config.php:176 msgid "Select color scheme" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Select scheme accent" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Blue" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Red" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Purple" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Green" msgstr "" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Pink" msgstr "" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "Copy or paste schemestring" msgstr "" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "" "You can copy this string to share your theme with others. Pasting here " "applies the schemestring" msgstr "" -#: view/theme/frio/config.php:168 +#: view/theme/frio/config.php:179 msgid "Navigation bar background color" msgstr "" -#: view/theme/frio/config.php:169 +#: view/theme/frio/config.php:180 msgid "Navigation bar icon color " msgstr "" -#: view/theme/frio/config.php:170 +#: view/theme/frio/config.php:181 msgid "Link color" msgstr "" -#: view/theme/frio/config.php:171 +#: view/theme/frio/config.php:182 msgid "Set the background color" msgstr "" -#: view/theme/frio/config.php:172 +#: view/theme/frio/config.php:183 msgid "Content background opacity" msgstr "" -#: view/theme/frio/config.php:173 +#: view/theme/frio/config.php:184 msgid "Set the background image" msgstr "" -#: view/theme/frio/config.php:174 +#: view/theme/frio/config.php:185 msgid "Background image style" msgstr "" -#: view/theme/frio/config.php:179 +#: view/theme/frio/config.php:188 +msgid "Always open Compose page" +msgstr "" + +#: view/theme/frio/config.php:188 +msgid "" +"The New Post button always open the Compose page " +"instead of the modal form. When this is disabled, the Compose page can be " +"accessed with a middle click on the link or from the modal." +msgstr "" + +#: view/theme/frio/config.php:192 msgid "Login page background image" msgstr "" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Login page background color" msgstr "" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Leave background image and color empty for theme defaults" msgstr "" From f8f0dfa91ab226fe1f94abe8cf86f2c5ceeeec12 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Oct 2022 21:37:05 +0000 Subject: [PATCH 037/641] Detect linked posts and add them as quote --- src/Content/Item.php | 12 +++-- src/Model/Item.php | 43 ++++++++++++--- src/Model/Post/Media.php | 66 ++++++++++++++++++++++++ src/Protocol/ActivityPub/Processor.php | 4 +- src/Protocol/ActivityPub/Transmitter.php | 9 +--- static/dbstructure.config.php | 4 +- 6 files changed, 115 insertions(+), 23 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 1838d4ac4..bfa107325 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -608,9 +608,10 @@ class Item * * @param integer $UriId * @param integer $uid + * @param bool $add_media * @return string */ - public function createSharedPostByUriId(int $UriId, int $uid = 0): string + public function createSharedPostByUriId(int $UriId, int $uid = 0, bool $add_media = false): string { $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; $shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]); @@ -619,7 +620,7 @@ class Item return ''; } - return $this->createSharedBlockByArray($shared_item); + return $this->createSharedBlockByArray($shared_item, $add_media); } /** @@ -627,9 +628,10 @@ class Item * * @param string $guid * @param integer $uid + * @param bool $add_media * @return string */ - public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = ''): string + public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = '', bool $add_media = false): string { $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]); @@ -646,7 +648,7 @@ class Item return ''; } - return $this->createSharedBlockByArray($shared_item); + return $this->createSharedBlockByArray($shared_item, $add_media); } /** @@ -678,7 +680,7 @@ class Item // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { - if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) { + if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid'], 0, '', $add_media))) { $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']); } diff --git a/src/Model/Item.php b/src/Model/Item.php index 439c1b990..3270d170b 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2946,17 +2946,44 @@ class Item $body = $item['body'] ?? ''; $shared = BBCode::fetchShareAttributes($body); if (!empty($shared['guid'])) { - $shared_item = Post::selectFirst(['uri-id', 'plink', 'has-media'], ['guid' => $shared['guid']]); - $shared_uri_id = $shared_item['uri-id'] ?? 0; - $shared_links = [strtolower($shared_item['plink'] ?? '')]; - $shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared['guid'], [], $shared_item['has-media'] ?? false); + $shared_item = Post::selectFirst(['uri-id', 'guid', 'plink', 'has-media'], ['guid' => $shared['guid'], 'uid' => [$item['uid'], 0]]); + } + + $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network', 'has-media']; + + $shared_uri_id = 0; + $shared_links = []; + + if (empty($shared_item['uri-id']) && !empty($item['quote-uri-id'])) { + $shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]); + $quote_uri_id = $item['quote-uri-id'] ?? 0; + $shared_links[] = strtolower($item['quote-uri']); + } elseif (empty($shared_item['uri-id']) && empty($item['quote-uri-id'])) { + $media = Post\Media::getByURIId($item['uri-id'], [Post\Media::ACTIVITY]); + if (!empty($media)) { + $shared_item = Post::selectFirst($fields, ['plink' => $media[0]['url'], 'uid' => [$item['uid'], 0]]); + + if (empty($shared_item['uri-id'])) { + $shared_item = Post::selectFirst($fields, ['uri' => $media[0]['url'], 'uid' => [$item['uid'], 0]]); + $shared_links[] = strtolower($media[0]['url']); + } + + $quote_uri_id = $shared_item['uri-id'] ?? 0; + } + } + + if (!empty($quote_uri_id)) { + $item['body'] .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item); + } + + if (!empty($shared_item['uri-id'])) { + $shared_uri_id = $shared_item['uri-id']; + $shared_links[] = strtolower($shared_item['plink']); + $shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared_item['guid'], [], $shared_item['has-media']); $shared_links = array_merge($shared_links, array_column($shared_attachments['visual'], 'url')); $shared_links = array_merge($shared_links, array_column($shared_attachments['link'], 'url')); $shared_links = array_merge($shared_links, array_column($shared_attachments['additional'], 'url')); $item['body'] = self::replaceVisualAttachments($shared_attachments, $item['body']); - } else { - $shared_uri_id = 0; - $shared_links = []; } $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links, $item['has-media'] ?? false); @@ -3278,7 +3305,7 @@ class Item } DI::profiler()->stopRecording(); - if (isset($data['url']) && !in_array($data['url'], $ignore_links)) { + if (isset($data['url']) && !in_array(strtolower($data['url']), $ignore_links)) { if (!empty($data['description']) || !empty($data['image']) || !empty($data['preview'])) { $parts = parse_url($data['url']); if (!empty($parts['scheme']) && !empty($parts['host'])) { diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index ce00b205c..6d0707743 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -23,10 +23,12 @@ namespace Friendica\Model\Post; use Friendica\Content\Text\BBCode; use Friendica\Core\Logger; +use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Post; @@ -56,6 +58,7 @@ class Media const HTML = 17; const XML = 18; const PLAIN = 19; + const ACTIVITY = 20; const DOCUMENT = 128; /** @@ -215,6 +218,10 @@ class Media $media = self::addType($media); } + if (in_array($media['type'], [self::TEXT, self::APPLICATION, self::HTML, self::XML, self::PLAIN])) { + $media = self::addActivity($media); + } + if ($media['type'] == self::HTML) { $data = ParseUrl::getSiteinfoCached($media['url'], false); $media['preview'] = $data['images'][0]['src'] ?? null; @@ -232,6 +239,65 @@ class Media return $media; } + /** + * Adds the activity type if the media entry is linked to an activity + * + * @param array $media + * @return array + */ + private static function addActivity(array $media): array + { + $id = Item::fetchByLink($media['url']); + if (empty($id)) { + return $media; + } + + $item = Post::selectFirst([], ['id' => $id, 'network' => Protocol::FEDERATED]); + if (empty($item['id'])) { + Logger::debug('Not a federated activity', ['id' => $id, 'uri-id' => $media['uri-id'], 'url' => $media['url']]); + return $media; + } + + if (!empty($item['plink']) && Strings::compareLink($item['plink'], $media['url']) && + parse_url($item['plink'], PHP_URL_HOST) != parse_url($item['uri'], PHP_URL_HOST)) { + Logger::debug('Not a link to an activity', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'plink' => $item['plink'], 'uri' => $item['uri']]); + return $media; + } + + if (in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) { + $media['mimetype'] = 'application/activity+json'; + } elseif ($item['network'] == Protocol::DIASPORA) { + $media['mimetype'] = 'application/xml'; + } else { + $media['mimetype'] = ''; + } + + $contact = Contact::getById($item['author-id'], ['avatar', 'gsid']); + if (!empty($contact['gsid'])) { + $gserver = DBA::selectFirst('gserver', ['url', 'site_name'], ['id' => $contact['gsid']]); + } + + $media['type'] = self::ACTIVITY; + $media['media-uri-id'] = $item['uri-id']; + $media['height'] = null; + $media['width'] = null; + $media['size'] = null; + $media['preview'] = null; + $media['preview-height'] = null; + $media['preview-width'] = null; + $media['description'] = $item['body']; + $media['name'] = $item['title']; + $media['author-url'] = $item['author-link']; + $media['author-name'] = $item['author-name']; + $media['author-image'] = $contact['avatar'] ?? $item['author-avatar']; + $media['publisher-url'] = $gserver['url'] ?? null; + $media['publisher-name'] = $gserver['site_name'] ?? null; + $media['publisher-image'] = null; + + Logger::debug('Activity detected', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'plink' => $item['plink'], 'uri' => $item['uri']]); + return $media; + } + /** * Fetch media data from local resources * @param array $media diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 5183a82c3..04ea02f80 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -170,7 +170,7 @@ class Processor } /** - * Stire attachment data + * Store attachment data * * @param array $activity * @param array $item @@ -187,7 +187,7 @@ class Processor } /** - * Store attachment data + * Store question data * * @param array $activity * @param array $item diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index c37fefb42..8b9571e55 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -1674,13 +1674,8 @@ class Transmitter } $data['quoteUrl'] = $item['quote-uri']; } elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) { - $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; - $shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]); - if (!empty($shared_item['uri-id'])) { - $shared_item['body'] = Post\Media::addAttachmentsToBody($shared_item['uri-id'], $shared_item['body']); - $body .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item); - $item['body'] = Item::improveSharedDataInBody($item, true); - } + $body .= "\n" . DI::contentItem()->createSharedPostByUriId($item['quote-uri-id'], $item['uid'], true); + $item['body'] = Item::improveSharedDataInBody($item, true); } $data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB); diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 5da1c1771..262d7d307 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1485); + define('DB_UPDATE_VERSION', 1486); } return [ @@ -1321,6 +1321,7 @@ return [ "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], "url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"], + "media-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the activities uri-id"], "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"], "mimetype" => ["type" => "varchar(60)", "comment" => ""], "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"], @@ -1342,6 +1343,7 @@ return [ "PRIMARY" => ["id"], "uri-id-url" => ["UNIQUE", "uri-id", "url(512)"], "uri-id-id" => ["uri-id", "id"], + "media-uri-id" => ["media-uri-id"], ] ], "post-question" => [ From b4661b35fdf431cfc5d71d554692cc61d9e80219 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Oct 2022 21:43:48 +0000 Subject: [PATCH 038/641] Improved database.sql --- database.sql | 7 +++-- doc/database/db_post-media.md | 55 ++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/database.sql b/database.sql index c1b64fbed..ab8c300a8 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2022.12-dev (Giant Rhubarb) --- DB_UPDATE_VERSION 1485 +-- DB_UPDATE_VERSION 1486 -- ------------------------------------------ @@ -1292,6 +1292,7 @@ CREATE TABLE IF NOT EXISTS `post-media` ( `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID', `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', `url` varbinary(1024) NOT NULL COMMENT 'Media URL', + `media-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the activities uri-id', `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type', `mimetype` varchar(60) COMMENT '', `height` smallint unsigned COMMENT 'Height of the media', @@ -1311,7 +1312,9 @@ CREATE TABLE IF NOT EXISTS `post-media` ( PRIMARY KEY(`id`), UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)), INDEX `uri-id-id` (`uri-id`,`id`), - FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE + INDEX `media-uri-id` (`media-uri-id`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, + FOREIGN KEY (`media-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media'; -- diff --git a/doc/database/db_post-media.md b/doc/database/db_post-media.md index 59c87cd36..d6e3a703c 100644 --- a/doc/database/db_post-media.md +++ b/doc/database/db_post-media.md @@ -6,36 +6,38 @@ Attached media Fields ------ -| Field | Description | Type | Null | Key | Default | Extra | -| --------------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- | -| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | -| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | | -| url | Media URL | varbinary(1024) | NO | | NULL | | -| type | Media type | tinyint unsigned | NO | | 0 | | -| mimetype | | varchar(60) | YES | | NULL | | -| height | Height of the media | smallint unsigned | YES | | NULL | | -| width | Width of the media | smallint unsigned | YES | | NULL | | -| size | Media size | bigint unsigned | YES | | NULL | | -| preview | Preview URL | varbinary(512) | YES | | NULL | | -| preview-height | Height of the preview picture | smallint unsigned | YES | | NULL | | -| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | | -| description | | text | YES | | NULL | | -| name | Name of the media | varchar(255) | YES | | NULL | | -| author-url | URL of the author of the media | varbinary(383) | YES | | NULL | | -| author-name | Name of the author of the media | varchar(255) | YES | | NULL | | -| author-image | Image of the author of the media | varbinary(383) | YES | | NULL | | -| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | | -| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | | -| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | | +| Field | Description | Type | Null | Key | Default | Extra | +| --------------- | ------------------------------------------------------------------ | ----------------- | ---- | --- | ------- | -------------- | +| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment | +| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | | +| url | Media URL | varbinary(1024) | NO | | NULL | | +| media-uri-id | Id of the item-uri table entry that contains the activities uri-id | int unsigned | YES | | NULL | | +| type | Media type | tinyint unsigned | NO | | 0 | | +| mimetype | | varchar(60) | YES | | NULL | | +| height | Height of the media | smallint unsigned | YES | | NULL | | +| width | Width of the media | smallint unsigned | YES | | NULL | | +| size | Media size | bigint unsigned | YES | | NULL | | +| preview | Preview URL | varbinary(512) | YES | | NULL | | +| preview-height | Height of the preview picture | smallint unsigned | YES | | NULL | | +| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | | +| description | | text | YES | | NULL | | +| name | Name of the media | varchar(255) | YES | | NULL | | +| author-url | URL of the author of the media | varbinary(383) | YES | | NULL | | +| author-name | Name of the author of the media | varchar(255) | YES | | NULL | | +| author-image | Image of the author of the media | varbinary(383) | YES | | NULL | | +| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | | +| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | | +| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | | Indexes ------------ -| Name | Fields | -| ---------- | ------------------------ | -| PRIMARY | id | -| uri-id-url | UNIQUE, uri-id, url(512) | -| uri-id-id | uri-id, id | +| Name | Fields | +| ------------ | ------------------------ | +| PRIMARY | id | +| uri-id-url | UNIQUE, uri-id, url(512) | +| uri-id-id | uri-id, id | +| media-uri-id | media-uri-id | Foreign Keys ------------ @@ -43,5 +45,6 @@ Foreign Keys | Field | Target Table | Target Field | |-------|--------------|--------------| | uri-id | [item-uri](help/database/db_item-uri) | id | +| media-uri-id | [item-uri](help/database/db_item-uri) | id | Return to [database documentation](help/database) From 018858934b0423efb7dd07e660f621f1e8eb75cd Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 05:49:55 +0000 Subject: [PATCH 039/641] The priority is now a class constant --- boot.php | 15 ------- mod/events.php | 2 +- mod/item.php | 3 +- mod/tagger.php | 2 +- src/Console/Relocate.php | 2 +- src/Core/Search.php | 2 +- src/Core/Update.php | 2 +- src/Core/UserImport.php | 2 +- src/Core/Worker.php | 50 +++++++++++++--------- src/Core/Worker/Cron.php | 24 +++++------ src/Model/Contact.php | 32 +++++++------- src/Model/FContact.php | 2 +- src/Model/GServer.php | 6 +-- src/Model/Item.php | 12 +++--- src/Model/Mail.php | 2 +- src/Model/Post/Delayed.php | 2 +- src/Model/Profile.php | 4 +- src/Model/PushSubscriber.php | 6 +-- src/Model/Subscription.php | 2 +- src/Model/User.php | 8 ++-- src/Module/Admin/Blocklist/Contact.php | 2 +- src/Module/Admin/Blocklist/Server/Add.php | 2 +- src/Module/Admin/Site.php | 4 +- src/Module/Api/Friendica/Events/Create.php | 2 +- src/Module/Api/Mastodon/Statuses.php | 3 +- src/Module/Contact.php | 4 +- src/Module/FriendSuggest.php | 2 +- src/Module/Photo.php | 2 +- src/Module/Register.php | 2 +- src/Module/Settings/Account.php | 4 +- src/Protocol/ActivityPub/Processor.php | 6 +-- src/Protocol/ActivityPub/Receiver.php | 2 +- src/Protocol/Diaspora.php | 2 +- src/Protocol/Feed.php | 3 +- src/Worker/CheckDeletedContacts.php | 2 +- src/Worker/Cron.php | 38 ++++++++-------- src/Worker/Directory.php | 2 +- src/Worker/ExpirePosts.php | 4 +- src/Worker/MoveStorage.php | 2 +- src/Worker/Notifier.php | 10 ++--- src/Worker/PollContacts.php | 6 +-- src/Worker/RemoveUser.php | 3 +- src/Worker/UpdateContacts.php | 2 +- src/Worker/UpdateGServers.php | 4 +- static/defaults.config.php | 2 +- update.php | 4 +- 46 files changed, 148 insertions(+), 151 deletions(-) diff --git a/boot.php b/boot.php index 8e7958de3..b90c1fb2e 100644 --- a/boot.php +++ b/boot.php @@ -71,21 +71,6 @@ define('GRAVITY_COMMENT', 6); define('GRAVITY_UNKNOWN', 9); /* @}*/ -/** - * @name Priority - * - * Process priority for the worker - * @{ - */ -define('PRIORITY_UNDEFINED', 0); -define('PRIORITY_CRITICAL', 10); -define('PRIORITY_HIGH', 20); -define('PRIORITY_MEDIUM', 30); -define('PRIORITY_LOW', 40); -define('PRIORITY_NEGLIGIBLE', 50); -define('PRIORITIES', [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE]); -/* @}*/ - // Normally this constant is defined - but not if "pcntl" isn't installed if (!defined('SIGTERM')) { define('SIGTERM', 15); diff --git a/mod/events.php b/mod/events.php index 082cdf55d..eead66c01 100644 --- a/mod/events.php +++ b/mod/events.php @@ -205,7 +205,7 @@ function events_post(App $a) } if (!$cid && $uri_id) { - Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid); + Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid); } DI::baseUrl()->redirect('events'); diff --git a/mod/item.php b/mod/item.php index f3f0fd40d..8f4494ca7 100644 --- a/mod/item.php +++ b/mod/item.php @@ -36,6 +36,7 @@ use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Session; use Friendica\Core\System; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Attach; @@ -635,7 +636,7 @@ function item_post(App $a) { unset($datarray['self']); unset($datarray['api_source']); - Post\Delayed::add($datarray['uri'], $datarray, PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at); + Post\Delayed::add($datarray['uri'], $datarray, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at); item_post_return(DI::baseUrl(), $api_source, $return_path); } } diff --git a/mod/tagger.php b/mod/tagger.php index e0d95ce66..45b743166 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -166,6 +166,6 @@ EOT; $post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]); - Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']); + Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']); System::exit(); } diff --git a/src/Console/Relocate.php b/src/Console/Relocate.php index c1db6ef53..729bee392 100644 --- a/src/Console/Relocate.php +++ b/src/Console/Relocate.php @@ -197,7 +197,7 @@ HELP; $this->out('Schedule relocation messages to remote Friendica and Diaspora hosts'); $users = $this->database->selectToArray('user', ['uid'], ['account_removed' => false, 'account_expired' => false]); foreach ($users as $user) { - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $user['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $user['uid']); } return 0; diff --git a/src/Core/Search.php b/src/Core/Search.php index 5ae1dd7ac..cf3821afc 100644 --- a/src/Core/Search.php +++ b/src/Core/Search.php @@ -192,7 +192,7 @@ class Search } // Add found profiles from the global directory to the local directory - Worker::add(PRIORITY_LOW, 'SearchDirectory', $search); + Worker::add(Worker::PRIORITY_LOW, 'SearchDirectory', $search); return $resultList; } diff --git a/src/Core/Update.php b/src/Core/Update.php index ddb9effd7..ad5b31760 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -92,7 +92,7 @@ class Update */ self::run($basePath); } else { - Worker::add(PRIORITY_CRITICAL, 'DBUpdate'); + Worker::add(Worker::PRIORITY_CRITICAL, 'DBUpdate'); } } } diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 339ce0b65..f8485fc29 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -322,7 +322,7 @@ class UserImport } // send relocate messages - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid); info(DI::l10n()->t("Done. You can now login with your username and password")); DI::baseUrl()->redirect('login'); diff --git a/src/Core/Worker.php b/src/Core/Worker.php index a57792ce7..9ec2f8f04 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -31,12 +31,20 @@ use Friendica\Util\DateTimeFormat; */ class Worker { - const PRIORITY_UNDEFINED = PRIORITY_UNDEFINED; - const PRIORITY_CRITICAL = PRIORITY_CRITICAL; - const PRIORITY_HIGH = PRIORITY_HIGH; - const PRIORITY_MEDIUM = PRIORITY_MEDIUM; - const PRIORITY_LOW = PRIORITY_LOW; - const PRIORITY_NEGLIGIBLE = PRIORITY_NEGLIGIBLE; + /** + * @name Priority + * + * Process priority for the worker + * @{ + */ + const PRIORITY_UNDEFINED = 0; + const PRIORITY_CRITICAL = 10; + const PRIORITY_HIGH = 20; + const PRIORITY_MEDIUM = 30; + const PRIORITY_LOW = 40; + const PRIORITY_NEGLIGIBLE = 50; + const PRIORITIES = [self::PRIORITY_CRITICAL, self::PRIORITY_HIGH, self::PRIORITY_MEDIUM, self::PRIORITY_LOW, self::PRIORITY_NEGLIGIBLE]; + /* @}*/ const STATE_STARTUP = 1; // Worker is in startup. This takes most time. const STATE_LONG_LOOP = 2; // Worker is processing the whole - long - loop. @@ -807,7 +815,7 @@ class Worker $top_priority = self::highestPriority(); $high_running = self::processWithPriorityActive($top_priority); - if (!$high_running && ($top_priority > PRIORITY_UNDEFINED) && ($top_priority < PRIORITY_NEGLIGIBLE)) { + if (!$high_running && ($top_priority > self::PRIORITY_UNDEFINED) && ($top_priority < self::PRIORITY_NEGLIGIBLE)) { Logger::info('Jobs with a higher priority are waiting but none is executed. Open a fastlane.', ['priority' => $top_priority]); $queues = $active + 1; } @@ -939,7 +947,7 @@ class Worker private static function nextPriority() { $waiting = []; - $priorities = [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE]; + $priorities = [self::PRIORITY_CRITICAL, self::PRIORITY_HIGH, self::PRIORITY_MEDIUM, self::PRIORITY_LOW, self::PRIORITY_NEGLIGIBLE]; foreach ($priorities as $priority) { $stamp = (float)microtime(true); if (DBA::exists('workerqueue', ["`priority` = ? AND `pid` = 0 AND NOT `done` AND `next_try` < ?", $priority, DateTimeFormat::utcNow()])) { @@ -948,8 +956,8 @@ class Worker self::$db_duration += (microtime(true) - $stamp); } - if (!empty($waiting[PRIORITY_CRITICAL])) { - return PRIORITY_CRITICAL; + if (!empty($waiting[self::PRIORITY_CRITICAL])) { + return self::PRIORITY_CRITICAL; } $running = []; @@ -1206,8 +1214,8 @@ class Worker * @param (integer|array) priority or parameter array, strings are deprecated and are ignored * * next args are passed as $cmd command line - * or: Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::DELETION, $drop_id); - * or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'Delivery', $post_id); + * or: Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::DELETION, $drop_id); + * or: Worker::add(array('priority' => Worker::PRIORITY_HIGH, 'dont_fork' => true), 'Delivery', $post_id); * * @return int '0' if worker queue entry already existed or there had been an error, otherwise the ID of the worker task * @throws \Friendica\Network\HTTPException\InternalServerErrorException @@ -1230,7 +1238,7 @@ class Worker return 1; } - $priority = PRIORITY_MEDIUM; + $priority = self::PRIORITY_MEDIUM; // Don't fork from frontend tasks by default $dont_fork = DI::config()->get('system', 'worker_dont_fork', false) || !DI::mode()->isBackend(); $created = DateTimeFormat::utcNow(); @@ -1266,9 +1274,9 @@ class Worker $found = DBA::exists('workerqueue', ['command' => $command, 'parameter' => $parameters, 'done' => false]); $added = 0; - if (!is_int($priority) || !in_array($priority, PRIORITIES)) { + if (!is_int($priority) || !in_array($priority, self::PRIORITIES)) { Logger::warning('Invalid priority', ['priority' => $priority, 'command' => $command, 'callstack' => System::callstack(20)]); - $priority = PRIORITY_MEDIUM; + $priority = self::PRIORITY_MEDIUM; } // Quit if there was a database error - a precaution for the update process to 3.5.3 @@ -1383,12 +1391,12 @@ class Worker $delay = (($new_retrial + 2) ** 4) + (rand(1, 30) * ($new_retrial)); $next = DateTimeFormat::utc('now + ' . $delay . ' seconds'); - if (($priority < PRIORITY_MEDIUM) && ($new_retrial > 3)) { - $priority = PRIORITY_MEDIUM; - } elseif (($priority < PRIORITY_LOW) && ($new_retrial > 6)) { - $priority = PRIORITY_LOW; - } elseif (($priority < PRIORITY_NEGLIGIBLE) && ($new_retrial > 8)) { - $priority = PRIORITY_NEGLIGIBLE; + if (($priority < self::PRIORITY_MEDIUM) && ($new_retrial > 3)) { + $priority = self::PRIORITY_MEDIUM; + } elseif (($priority < self::PRIORITY_LOW) && ($new_retrial > 6)) { + $priority = self::PRIORITY_LOW; + } elseif (($priority < self::PRIORITY_NEGLIGIBLE) && ($new_retrial > 8)) { + $priority = self::PRIORITY_NEGLIGIBLE; } Logger::info('Deferred task', ['id' => $id, 'retrial' => $new_retrial, 'created' => $queue['created'], 'next_execution' => $next, 'old_prio' => $queue['priority'], 'new_prio' => $priority]); diff --git a/src/Core/Worker/Cron.php b/src/Core/Worker/Cron.php index 0f2c4b41e..11631e02b 100644 --- a/src/Core/Worker/Cron.php +++ b/src/Core/Worker/Cron.php @@ -47,10 +47,10 @@ class Cron Logger::info('Add cron entries'); // Check for spooled items - Worker::add(['priority' => PRIORITY_HIGH, 'force_priority' => true], 'SpoolPost'); + Worker::add(['priority' => Worker::PRIORITY_HIGH, 'force_priority' => true], 'SpoolPost'); // Run the cron job that calls all other jobs - Worker::add(['priority' => PRIORITY_MEDIUM, 'force_priority' => true], 'Cron'); + Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'Cron'); // Cleaning dead processes self::killStaleWorkers(); @@ -112,12 +112,12 @@ class Cron // To avoid a blocking situation we reschedule the process at the beginning of the queue. // Additionally we are lowering the priority. (But not PRIORITY_CRITICAL) $new_priority = $entry['priority']; - if ($entry['priority'] == PRIORITY_HIGH) { - $new_priority = PRIORITY_MEDIUM; - } elseif ($entry['priority'] == PRIORITY_MEDIUM) { - $new_priority = PRIORITY_LOW; - } elseif ($entry['priority'] != PRIORITY_CRITICAL) { - $new_priority = PRIORITY_NEGLIGIBLE; + if ($entry['priority'] == Worker::PRIORITY_HIGH) { + $new_priority = Worker::PRIORITY_MEDIUM; + } elseif ($entry['priority'] == Worker::PRIORITY_MEDIUM) { + $new_priority = Worker::PRIORITY_LOW; + } elseif ($entry['priority'] != Worker::PRIORITY_CRITICAL) { + $new_priority = Worker::PRIORITY_NEGLIGIBLE; } DBA::update('workerqueue', ['executed' => DBA::NULL_DATETIME, 'created' => DateTimeFormat::utcNow(), 'priority' => $new_priority, 'pid' => 0], ['id' => $entry["id"]] ); @@ -166,13 +166,13 @@ class Cron Logger::info('Directly deliver inbox', ['inbox' => $delivery['inbox'], 'result' => $result['success']]); continue; } elseif ($delivery['failed'] < 3) { - $priority = PRIORITY_HIGH; + $priority = Worker::PRIORITY_HIGH; } elseif ($delivery['failed'] < 6) { - $priority = PRIORITY_MEDIUM; + $priority = Worker::PRIORITY_MEDIUM; } elseif ($delivery['failed'] < 8) { - $priority = PRIORITY_LOW; + $priority = Worker::PRIORITY_LOW; } else { - $priority = PRIORITY_NEGLIGIBLE; + $priority = Worker::PRIORITY_NEGLIGIBLE; } if ($delivery['failed'] >= DI::config()->get('system', 'worker_defer_limit')) { diff --git a/src/Model/Contact.php b/src/Model/Contact.php index ceaf635df..434c2b1f6 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -319,7 +319,7 @@ class Contact // Update the contact in the background if needed if (Probe::isProbable($contact['network']) && ($contact['next-update'] < DateTimeFormat::utcNow())) { - Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); + Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); } // Remove the internal fields @@ -884,7 +884,7 @@ class Contact } // Delete it in the background - Worker::add(PRIORITY_MEDIUM, 'Contact\Remove', $id); + Worker::add(Worker::PRIORITY_MEDIUM, 'Contact\Remove', $id); } /** @@ -908,7 +908,7 @@ class Contact if (in_array($contact['rel'], [self::SHARING, self::FRIEND])) { $cdata = self::getPublicAndUserContactID($contact['id'], $contact['uid']); if (!empty($cdata['public'])) { - Worker::add(PRIORITY_HIGH, 'Contact\Unfollow', $cdata['public'], $contact['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unfollow', $cdata['public'], $contact['uid']); } } @@ -938,7 +938,7 @@ class Contact if (in_array($contact['rel'], [self::FOLLOWER, self::FRIEND])) { $cdata = self::getPublicAndUserContactID($contact['id'], $contact['uid']); if (!empty($cdata['public'])) { - Worker::add(PRIORITY_HIGH, 'Contact\RevokeFollow', $cdata['public'], $contact['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Contact\RevokeFollow', $cdata['public'], $contact['uid']); } } @@ -966,11 +966,11 @@ class Contact $cdata = self::getPublicAndUserContactID($contact['id'], $contact['uid']); if (in_array($contact['rel'], [self::SHARING, self::FRIEND]) && !empty($cdata['public'])) { - Worker::add(PRIORITY_HIGH, 'Contact\Unfollow', $cdata['public'], $contact['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Contact\Unfollow', $cdata['public'], $contact['uid']); } if (in_array($contact['rel'], [self::FOLLOWER, self::FRIEND]) && !empty($cdata['public'])) { - Worker::add(PRIORITY_HIGH, 'Contact\RevokeFollow', $cdata['public'], $contact['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Contact\RevokeFollow', $cdata['public'], $contact['uid']); } self::remove($contact['id']); @@ -1248,7 +1248,7 @@ class Contact $contact_id = $contact['id']; if (Probe::isProbable($contact['network']) && ($contact['next-update'] < DateTimeFormat::utcNow())) { - Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); + Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); } if (empty($update) && (!empty($contact['uri-id']) || is_bool($update))) { @@ -2365,7 +2365,7 @@ class Contact return; } Logger::warning('account-user exists for a different contact id', ['account_user' => $account_user, 'id' => $id, 'uid' => $uid, 'uri-id' => $uri_id, 'url' => $url]); - Worker::add(PRIORITY_HIGH, 'MergeContact', $account_user['id'], $id, $uid); + Worker::add(Worker::PRIORITY_HIGH, 'MergeContact', $account_user['id'], $id, $uid); } elseif (DBA::insert('account-user', ['id' => $id, 'uri-id' => $uri_id, 'uid' => $uid], Database::INSERT_IGNORE)) { Logger::notice('account-user was added', ['id' => $id, 'uid' => $uid, 'uri-id' => $uri_id, 'url' => $url]); } else { @@ -2406,7 +2406,7 @@ class Contact continue; } - Worker::add(PRIORITY_HIGH, 'MergeContact', $first, $duplicate['id'], $uid); + Worker::add(Worker::PRIORITY_HIGH, 'MergeContact', $first, $duplicate['id'], $uid); } DBA::close($duplicates); Logger::info('Duplicates handled', ['uid' => $uid, 'nurl' => $nurl, 'callstack' => System::callstack(20)]); @@ -2608,7 +2608,7 @@ class Contact if ($ret['network'] == Protocol::ACTIVITYPUB) { $apcontact = APContact::getByURL($ret['url'], false); if (!empty($apcontact['featured'])) { - Worker::add(PRIORITY_LOW, 'FetchFeaturedPosts', $ret['url']); + Worker::add(Worker::PRIORITY_LOW, 'FetchFeaturedPosts', $ret['url']); } } @@ -2649,7 +2649,7 @@ class Contact self::updateContact($id, $uid, $uriid, $contact['url'], ['failed' => false, 'local-data' => $has_local_data, 'last-update' => $updated, 'next-update' => $success_next_update, 'success_update' => $updated]); if (Contact\Relation::isDiscoverable($ret['url'])) { - Worker::add(PRIORITY_LOW, 'ContactDiscovery', $ret['url']); + Worker::add(Worker::PRIORITY_LOW, 'ContactDiscovery', $ret['url']); } // Update the public contact @@ -2693,7 +2693,7 @@ class Contact self::updateContact($id, $uid, $ret['uri-id'], $ret['url'], $ret); if (Contact\Relation::isDiscoverable($ret['url'])) { - Worker::add(PRIORITY_LOW, 'ContactDiscovery', $ret['url']); + Worker::add(Worker::PRIORITY_LOW, 'ContactDiscovery', $ret['url']); } return true; @@ -2949,13 +2949,13 @@ class Contact // pull feed and consume it, which should subscribe to the hub. if ($contact['network'] == Protocol::OSTATUS) { - Worker::add(PRIORITY_HIGH, 'OnePoll', $contact_id, 'force'); + Worker::add(Worker::PRIORITY_HIGH, 'OnePoll', $contact_id, 'force'); } if ($probed) { self::updateFromProbeArray($contact_id, $ret); } else { - Worker::add(PRIORITY_HIGH, 'UpdateContact', $contact_id); + Worker::add(Worker::PRIORITY_HIGH, 'UpdateContact', $contact_id); } $result['success'] = Protocol::follow($uid, $contact, $protocol); @@ -3407,10 +3407,10 @@ class Contact } $contact = self::getByURL($url, false, ['id', 'network', 'next-update']); if (empty($contact['id']) && Network::isValidHttpUrl($url)) { - Worker::add(PRIORITY_LOW, 'AddContact', 0, $url); + Worker::add(Worker::PRIORITY_LOW, 'AddContact', 0, $url); ++$added; } elseif (!empty($contact['network']) && Probe::isProbable($contact['network']) && ($contact['next-update'] < DateTimeFormat::utcNow())) { - Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); + Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); ++$updated; } else { ++$unchanged; diff --git a/src/Model/FContact.php b/src/Model/FContact.php index ae6c9cb31..fa21906bc 100644 --- a/src/Model/FContact.php +++ b/src/Model/FContact.php @@ -58,7 +58,7 @@ class FContact $update = empty($person['guid']) || empty($person['uri-id']) || ($person['created'] <= DBA::NULL_DATETIME); if (GServer::getNextUpdateDate(true, $person['created'], $person['updated'], false) < DateTimeFormat::utcNow()) { Logger::debug('Start background update', ['handle' => $handle]); - Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateFContact', $handle); + Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], 'UpdateFContact', $handle); } } } elseif (is_null($update)) { diff --git a/src/Model/GServer.php b/src/Model/GServer.php index ac8a84327..7e4b055d1 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -102,7 +102,7 @@ class GServer return; } - Worker::add(PRIORITY_LOW, 'UpdateGServer', $url, $only_nodeinfo); + Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $url, $only_nodeinfo); } /** @@ -2108,10 +2108,10 @@ class GServer while ($gserver = DBA::fetch($gservers)) { Logger::info('Update peer list', ['server' => $gserver['url'], 'id' => $gserver['id']]); - Worker::add(PRIORITY_LOW, 'UpdateServerPeers', $gserver['url']); + Worker::add(Worker::PRIORITY_LOW, 'UpdateServerPeers', $gserver['url']); Logger::info('Update directory', ['server' => $gserver['url'], 'id' => $gserver['id']]); - Worker::add(PRIORITY_LOW, 'UpdateServerDirectory', $gserver); + Worker::add(Worker::PRIORITY_LOW, 'UpdateServerDirectory', $gserver); $fields = ['last_poco_query' => DateTimeFormat::utcNow()]; self::update($fields, ['nurl' => $gserver['nurl']]); diff --git a/src/Model/Item.php b/src/Model/Item.php index 3270d170b..130a1c463 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -232,7 +232,7 @@ class Item foreach ($notify_items as $notify_item) { $post = Post::selectFirst(['uri-id', 'uid'], ['id' => $notify_item]); - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::POST, (int)$post['uri-id'], (int)$post['uid']); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::POST, (int)$post['uri-id'], (int)$post['uid']); } return $rows; @@ -246,7 +246,7 @@ class Item * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function markForDeletion(array $condition, int $priority = PRIORITY_HIGH) + public static function markForDeletion(array $condition, int $priority = Worker::PRIORITY_HIGH) { $items = Post::select(['id'], $condition); while ($item = Post::fetch($items)) { @@ -277,7 +277,7 @@ class Item } if ($item['uid'] == $uid) { - self::markForDeletionById($item['id'], PRIORITY_HIGH); + self::markForDeletionById($item['id'], Worker::PRIORITY_HIGH); } elseif ($item['uid'] != 0) { Logger::warning('Wrong ownership. Not deleting item', ['id' => $item['id']]); } @@ -293,7 +293,7 @@ class Item * @return boolean success * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function markForDeletionById(int $item_id, int $priority = PRIORITY_HIGH): bool + public static function markForDeletionById(int $item_id, int $priority = Worker::PRIORITY_HIGH): bool { Logger::info('Mark item for deletion by id', ['id' => $item_id, 'callstack' => System::callstack()]); // locate item to be deleted @@ -816,7 +816,7 @@ class Item { $orig_item = $item; - $priority = PRIORITY_HIGH; + $priority = Worker::PRIORITY_HIGH; // If it is a posting where users should get notifications, then define it as wall posting if ($notify) { @@ -826,7 +826,7 @@ class Item $item['protocol'] = Conversation::PARCEL_DIRECT; $item['direction'] = Conversation::PUSH; - if (is_int($notify) && in_array($notify, PRIORITIES)) { + if (is_int($notify) && in_array($notify, Worker::PRIORITIES)) { $priority = $notify; } } else { diff --git a/src/Model/Mail.php b/src/Model/Mail.php index e494119cb..cdcd2258c 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -239,7 +239,7 @@ class Mail } if ($post_id) { - Worker::add(PRIORITY_HIGH, "Notifier", Delivery::MAIL, $post_id); + Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::MAIL, $post_id); return intval($post_id); } else { return -3; diff --git a/src/Model/Post/Delayed.php b/src/Model/Post/Delayed.php index 1f15f26b9..3f96af698 100644 --- a/src/Model/Post/Delayed.php +++ b/src/Model/Post/Delayed.php @@ -80,7 +80,7 @@ class Delayed Logger::notice('Adding post for delayed publishing', ['uid' => $item['uid'], 'delayed' => $delayed, 'uri' => $uri]); - $wid = Worker::add(['priority' => PRIORITY_HIGH, 'delayed' => $delayed], 'DelayedPublish', $item, $notify, $taglist, $attachments, $preparation_mode, $uri); + $wid = Worker::add(['priority' => Worker::PRIORITY_HIGH, 'delayed' => $delayed], 'DelayedPublish', $item, $notify, $taglist, $attachments, $preparation_mode, $uri); if (!$wid) { return 0; } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 094df729e..f6d189a10 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -153,11 +153,11 @@ class Profile if ($owner['net-publish'] || $force) { // Update global directory in background if (Search::getGlobalDirectory()) { - Worker::add(PRIORITY_LOW, 'Directory', $owner['url']); + Worker::add(Worker::PRIORITY_LOW, 'Directory', $owner['url']); } } - Worker::add(PRIORITY_LOW, 'ProfileUpdate', $uid); + Worker::add(Worker::PRIORITY_LOW, 'ProfileUpdate', $uid); } /** diff --git a/src/Model/PushSubscriber.php b/src/Model/PushSubscriber.php index 8aa67eee5..5b6c8813a 100644 --- a/src/Model/PushSubscriber.php +++ b/src/Model/PushSubscriber.php @@ -37,7 +37,7 @@ class PushSubscriber * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function publishFeed(int $uid, int $default_priority = PRIORITY_HIGH) + public static function publishFeed(int $uid, int $default_priority = Worker::PRIORITY_HIGH) { $condition = ['push' => 0, 'uid' => $uid]; DBA::update('push_subscriber', ['push' => 1, 'next_try' => DBA::NULL_DATETIME], $condition); @@ -52,7 +52,7 @@ class PushSubscriber * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function requeue(int $default_priority = PRIORITY_HIGH) + public static function requeue(int $default_priority = Worker::PRIORITY_HIGH) { // We'll push to each subscriber that has push > 0, // i.e. there has been an update (set in notifier.php). @@ -61,7 +61,7 @@ class PushSubscriber while ($subscriber = DBA::fetch($subscribers)) { // We always handle retries with low priority if ($subscriber['push'] > 1) { - $priority = PRIORITY_LOW; + $priority = Worker::PRIORITY_LOW; } else { $priority = $default_priority; } diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index 26617f941..2796b37a0 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -152,7 +152,7 @@ class Subscription $subscriptions = DBA::select('subscription', [], ['uid' => $notification->uid, $type => true]); while ($subscription = DBA::fetch($subscriptions)) { Logger::info('Push notification', ['id' => $subscription['id'], 'uid' => $subscription['uid'], 'type' => $type]); - Worker::add(PRIORITY_HIGH, 'PushSubscription', $subscription['id'], $notification->id); + Worker::add(Worker::PRIORITY_HIGH, 'PushSubscription', $subscription['id'], $notification->id); } DBA::close($subscriptions); } diff --git a/src/Model/User.php b/src/Model/User.php index 574830603..5bd84466f 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -1317,7 +1317,7 @@ class User if (DBA::isResult($profile) && $profile['net-publish'] && Search::getGlobalDirectory()) { $url = DI::baseUrl() . '/profile/' . $user['nickname']; - Worker::add(PRIORITY_LOW, "Directory", $url); + Worker::add(Worker::PRIORITY_LOW, "Directory", $url); } $l10n = DI::l10n()->withLang($register['language']); @@ -1567,14 +1567,14 @@ class User // The user and related data will be deleted in Friendica\Worker\ExpireAndRemoveUsers DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc('now + 7 day')], ['uid' => $uid]); - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::REMOVAL, $uid); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::REMOVAL, $uid); // Send an update to the directory $self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); - Worker::add(PRIORITY_LOW, 'Directory', $self['url']); + Worker::add(Worker::PRIORITY_LOW, 'Directory', $self['url']); // Remove the user relevant data - Worker::add(PRIORITY_NEGLIGIBLE, 'RemoveUser', $uid); + Worker::add(Worker::PRIORITY_NEGLIGIBLE, 'RemoveUser', $uid); return true; } diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index ac1406c7f..35a8a151d 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -59,7 +59,7 @@ class Contact extends BaseAdmin if ($block_purge) { foreach (Model\Contact::selectToArray(['id'], ['nurl' => $contact['nurl']]) as $contact) { - Worker::add(PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']); + Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']); } } diff --git a/src/Module/Admin/Blocklist/Server/Add.php b/src/Module/Admin/Blocklist/Server/Add.php index a4aaa4b65..f060bcd06 100644 --- a/src/Module/Admin/Blocklist/Server/Add.php +++ b/src/Module/Admin/Blocklist/Server/Add.php @@ -82,7 +82,7 @@ class Add extends BaseAdmin if (!empty($request['purge'])) { $gservers = GServer::listByDomainPattern($pattern); foreach (Contact::selectToArray(['id'], ['gsid' => array_column($gservers, 'id')]) as $contact) { - Worker::add(PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']); + Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']); } $this->sysmsg->addInfo($this->l10n->tt('%s server scheduled to be purged.', '%s servers scheduled to be purged.', count($gservers))); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index fbebfcb3f..37d8ed040 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -53,7 +53,7 @@ class Site extends BaseAdmin $a = DI::app(); if (!empty($_POST['republish_directory'])) { - Worker::add(PRIORITY_LOW, 'Directory'); + Worker::add(Worker::PRIORITY_LOW, 'Directory'); return; } @@ -150,7 +150,7 @@ class Site extends BaseAdmin // Has the directory url changed? If yes, then resubmit the existing profiles there if ($global_directory != DI::config()->get('system', 'directory') && ($global_directory != '')) { DI::config()->set('system', 'directory', $global_directory); - Worker::add(PRIORITY_LOW, 'Directory'); + Worker::add(Worker::PRIORITY_LOW, 'Directory'); } if (DI::baseUrl()->getUrlPath() != "") { diff --git a/src/Module/Api/Friendica/Events/Create.php b/src/Module/Api/Friendica/Events/Create.php index 8a8f13b50..8c6ec8f63 100644 --- a/src/Module/Api/Friendica/Events/Create.php +++ b/src/Module/Api/Friendica/Events/Create.php @@ -104,7 +104,7 @@ class Create extends BaseApi $item = ['network' => Protocol::DFRN, 'protocol' => Conversation::PARCEL_DIRECT, 'direction' => Conversation::PUSH]; $item = Event::getItemArrayForId($event_id, $item); if (Item::insert($item)) { - Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$item['uri-id'], $uid); + Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$item['uri-id'], $uid); } } diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 4a8c98697..8cc3e3ddf 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -25,6 +25,7 @@ use Friendica\App\Router; use Friendica\Content\Text\Markdown; use Friendica\Core\Protocol; use Friendica\Core\System; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -204,7 +205,7 @@ class Statuses extends BaseApi if (!empty($request['scheduled_at'])) { $item['guid'] = Item::guid($item, true); $item['uri'] = Item::newURI($item['guid']); - $id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']); + $id = Post\Delayed::add($item['uri'], $item, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']); if (empty($id)) { DI::mstdnError()->InternalError(); } diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 9c073b3ef..4f565a871 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -126,9 +126,9 @@ class Contact extends BaseModule } // pull feed and consume it, which should subscribe to the hub. - Worker::add(PRIORITY_HIGH, 'OnePoll', $contact_id, 'force'); + Worker::add(Worker::PRIORITY_HIGH, 'OnePoll', $contact_id, 'force'); } else { - Worker::add(PRIORITY_HIGH, 'UpdateContact', $contact_id); + Worker::add(Worker::PRIORITY_HIGH, 'UpdateContact', $contact_id); } } diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php index 3cebd72ce..d8a42d8de 100644 --- a/src/Module/FriendSuggest.php +++ b/src/Module/FriendSuggest.php @@ -94,7 +94,7 @@ class FriendSuggest extends BaseModule $note )); - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id); info($this->t('Friend suggestion sent.')); } diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 076dc8107..5fdabd33c 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -338,7 +338,7 @@ class Photo extends BaseModule } if ($update) { Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); - Worker::add(PRIORITY_LOW, 'UpdateContact', $id); + Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id); } else { Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); } diff --git a/src/Module/Register.php b/src/Module/Register.php index 9c09baef8..95cea1458 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -302,7 +302,7 @@ class Register extends BaseModule if ($netpublish && intval(DI::config()->get('config', 'register_policy')) !== self::APPROVE) { $url = $base_url . '/profile/' . $user['nickname']; - Worker::add(PRIORITY_LOW, 'Directory', $url); + Worker::add(Worker::PRIORITY_LOW, 'Directory', $url); } if ($additional_account) { diff --git a/src/Module/Settings/Account.php b/src/Module/Settings/Account.php index 373f1614d..62ad08a4c 100644 --- a/src/Module/Settings/Account.php +++ b/src/Module/Settings/Account.php @@ -375,7 +375,7 @@ class Account extends BaseSettings // "http" or "@" to be present in the string. // All other fields from the row will be ignored if ((strpos($csvRow[0], '@') !== false) || Network::isValidHttpUrl($csvRow[0])) { - Worker::add(PRIORITY_MEDIUM, 'AddContact', local_user(), $csvRow[0]); + Worker::add(Worker::PRIORITY_MEDIUM, 'AddContact', local_user(), $csvRow[0]); } else { Logger::notice('Invalid account', ['url' => $csvRow[0]]); } @@ -394,7 +394,7 @@ class Account extends BaseSettings } if (!empty($request['relocate-submit'])) { - Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user()); + Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user()); info(DI::l10n()->t("Relocate message has been send to your contacts")); DI::baseUrl()->redirect($redirectUrl); } diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 04ea02f80..bb4d61b5a 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -552,7 +552,7 @@ class Processor Logger::notice('Fetching is done by worker.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]); Fetch::add($activity['reply-to-id']); $activity['recursion-depth'] = 0; - $wid = Worker::add(PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO); + $wid = Worker::add(Worker::PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO); Fetch::setWorkerId($activity['reply-to-id'], $wid); } else { Logger::debug('Activity will already be fetched via a worker.', ['url' => $activity['reply-to-id']]); @@ -1665,9 +1665,9 @@ class Processor } if (DI::config()->get('system', 'bulk_delivery')) { Post\Delivery::add($post['uri-id'], $uid, $inbox, $post['created'], Delivery::POST, [$cid]); - Worker::add(PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0); + Worker::add(Worker::PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0); } else { - Worker::add(PRIORITY_HIGH, 'APDelivery', Delivery::POST, $post['id'], $inbox, $uid, [$cid], $post['uri-id']); + Worker::add(Worker::PRIORITY_HIGH, 'APDelivery', Delivery::POST, $post['id'], $inbox, $uid, [$cid], $post['uri-id']); } } } diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 30348c7ad..1ecfaf6aa 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -652,7 +652,7 @@ class Receiver // We delay by 5 seconds to allow to accumulate all receivers $delayed = date(DateTimeFormat::MYSQL, time() + 5); Logger::debug('Initiate processing', ['id' => $object_data['entry-id'], 'uri' => $object_data['object_id']]); - $wid = Worker::add(['priority' => PRIORITY_HIGH, 'delayed' => $delayed], 'ProcessQueue', $object_data['entry-id']); + $wid = Worker::add(['priority' => Worker::PRIORITY_HIGH, 'delayed' => $delayed], 'ProcessQueue', $object_data['entry-id']); Queue::setWorkerId($object_data['entry-id'], $wid); } else { Logger::debug('Other queue entries need to be processed first.', ['id' => $object_data['entry-id']]); diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 66ace1d3d..a2c17f478 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -2020,7 +2020,7 @@ class Diaspora } Logger::info('Deliver participation', ['item' => $comment['id'], 'contact' => $author_contact['cid']]); - if (Worker::add(PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['uri-id'], $author_contact['cid'], $datarray['uid'])) { + if (Worker::add(Worker::PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['uri-id'], $author_contact['cid'], $datarray['uid'])) { Post\DeliveryData::incrementQueueCount($comment['uri-id'], 1); } } diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 7ff86c1db..f1521ac2d 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -30,6 +30,7 @@ use Friendica\Content\Text\HTML; use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -630,7 +631,7 @@ class Feed unset($item['parent-uri']); // Set the delivery priority for "remote self" to "medium" - $notify = PRIORITY_MEDIUM; + $notify = Worker::PRIORITY_MEDIUM; } $condition = ['uid' => $item['uid'], 'uri' => $item['uri']]; diff --git a/src/Worker/CheckDeletedContacts.php b/src/Worker/CheckDeletedContacts.php index 4d1c3b637..f612cd2ee 100644 --- a/src/Worker/CheckDeletedContacts.php +++ b/src/Worker/CheckDeletedContacts.php @@ -34,7 +34,7 @@ class CheckDeletedContacts { $contacts = DBA::select('contact', ['id'], ['deleted' => true]); while ($contact = DBA::fetch($contacts)) { - Worker::add(PRIORITY_MEDIUM, 'Contact\Remove', $contact['id']); + Worker::add(Worker::PRIORITY_MEDIUM, 'Contact\Remove', $contact['id']); } DBA::close($contacts); } diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index 12ea6e60a..21d2f8a20 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -62,25 +62,25 @@ class Cron } // Fork the cron jobs in separate parts to avoid problems when one of them is crashing - Hook::fork(PRIORITY_MEDIUM, 'cron'); + Hook::fork(Worker::PRIORITY_MEDIUM, 'cron'); // Poll contacts - Worker::add(PRIORITY_MEDIUM, 'PollContacts'); + Worker::add(Worker::PRIORITY_MEDIUM, 'PollContacts'); // Update contact information - Worker::add(PRIORITY_LOW, 'UpdateContacts'); + Worker::add(Worker::PRIORITY_LOW, 'UpdateContacts'); // Update server information - Worker::add(PRIORITY_LOW, 'UpdateGServers'); + Worker::add(Worker::PRIORITY_LOW, 'UpdateGServers'); // run the process to update server directories in the background - Worker::add(PRIORITY_LOW, 'UpdateServerDirectories'); + Worker::add(Worker::PRIORITY_LOW, 'UpdateServerDirectories'); // Expire and remove user entries - Worker::add(PRIORITY_MEDIUM, 'ExpireAndRemoveUsers'); + Worker::add(Worker::PRIORITY_MEDIUM, 'ExpireAndRemoveUsers'); // Call possible post update functions - Worker::add(PRIORITY_LOW, 'PostUpdate'); + Worker::add(Worker::PRIORITY_LOW, 'PostUpdate'); // Hourly cron calls if (DI::config()->get('system', 'last_cron_hourly', 0) + 3600 < time()) { @@ -97,11 +97,11 @@ class Cron // Search for new contacts in the directory if (DI::config()->get('system', 'synchronize_directory')) { - Worker::add(PRIORITY_LOW, 'PullDirectory'); + Worker::add(Worker::PRIORITY_LOW, 'PullDirectory'); } // Clear cache entries - Worker::add(PRIORITY_LOW, 'ClearCache'); + Worker::add(Worker::PRIORITY_LOW, 'ClearCache'); DI::config()->set('system', 'last_cron_hourly', time()); } @@ -109,27 +109,27 @@ class Cron // Daily maintenance cron calls if (Worker::isInMaintenanceWindow(true)) { - Worker::add(PRIORITY_LOW, 'UpdateContactBirthdays'); + Worker::add(Worker::PRIORITY_LOW, 'UpdateContactBirthdays'); - Worker::add(PRIORITY_LOW, 'UpdatePhotoAlbums'); + Worker::add(Worker::PRIORITY_LOW, 'UpdatePhotoAlbums'); - Worker::add(PRIORITY_LOW, 'ExpirePosts'); + Worker::add(Worker::PRIORITY_LOW, 'ExpirePosts'); - Worker::add(PRIORITY_LOW, 'ExpireActivities'); + Worker::add(Worker::PRIORITY_LOW, 'ExpireActivities'); - Worker::add(PRIORITY_LOW, 'RemoveUnusedTags'); + Worker::add(Worker::PRIORITY_LOW, 'RemoveUnusedTags'); - Worker::add(PRIORITY_LOW, 'RemoveUnusedContacts'); + Worker::add(Worker::PRIORITY_LOW, 'RemoveUnusedContacts'); - Worker::add(PRIORITY_LOW, 'RemoveUnusedAvatars'); + Worker::add(Worker::PRIORITY_LOW, 'RemoveUnusedAvatars'); // check upstream version? - Worker::add(PRIORITY_LOW, 'CheckVersion'); + Worker::add(Worker::PRIORITY_LOW, 'CheckVersion'); - Worker::add(PRIORITY_LOW, 'CheckDeletedContacts'); + Worker::add(Worker::PRIORITY_LOW, 'CheckDeletedContacts'); if (DI::config()->get('system', 'optimize_tables')) { - Worker::add(PRIORITY_LOW, 'OptimizeTables'); + Worker::add(Worker::PRIORITY_LOW, 'OptimizeTables'); } // Resubscribe to relay servers diff --git a/src/Worker/Directory.php b/src/Worker/Directory.php index bb8041a22..f0ee2ab5d 100644 --- a/src/Worker/Directory.php +++ b/src/Worker/Directory.php @@ -64,7 +64,7 @@ class Directory private static function updateAll() { $users = DBA::select('owner-view', ['url'], ['net-publish' => true, 'account_expired' => false, 'verified' => true]); while ($user = DBA::fetch($users)) { - Worker::add(PRIORITY_LOW, 'Directory', $user['url']); + Worker::add(Worker::PRIORITY_LOW, 'Directory', $user['url']); } DBA::close($users); } diff --git a/src/Worker/ExpirePosts.php b/src/Worker/ExpirePosts.php index bbdfaa42c..ffb40e697 100644 --- a/src/Worker/ExpirePosts.php +++ b/src/Worker/ExpirePosts.php @@ -53,10 +53,10 @@ class ExpirePosts } // Set the expiry for origin posta - Worker::add(PRIORITY_LOW, 'Expire'); + Worker::add(Worker::PRIORITY_LOW, 'Expire'); // update nodeinfo data after everything is cleaned up - Worker::add(PRIORITY_LOW, 'NodeInfo'); + Worker::add(Worker::PRIORITY_LOW, 'NodeInfo'); } /** diff --git a/src/Worker/MoveStorage.php b/src/Worker/MoveStorage.php index 4b24caf5b..30f42e40c 100644 --- a/src/Worker/MoveStorage.php +++ b/src/Worker/MoveStorage.php @@ -37,7 +37,7 @@ class MoveStorage $moved = DI::storageManager()->move($current); if ($moved) { - Worker::add(PRIORITY_LOW, 'MoveStorage'); + Worker::add(Worker::PRIORITY_LOW, 'MoveStorage'); } } } diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 7d3d3d6b7..45dc4de30 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -86,7 +86,7 @@ class Notifier foreach ($inboxes as $inbox => $receivers) { $ap_contacts = array_merge($ap_contacts, $receivers); Logger::info('Delivery via ActivityPub', ['cmd' => $cmd, 'target' => $target_id, 'inbox' => $inbox]); - Worker::add(['priority' => PRIORITY_HIGH, 'created' => $a->getQueueValue('created'), 'dont_fork' => true], + Worker::add(['priority' => Worker::PRIORITY_HIGH, 'created' => $a->getQueueValue('created'), 'dont_fork' => true], 'APDelivery', $cmd, $target_id, $inbox, $uid, $receivers, $post_uriid); } } elseif ($cmd == Delivery::SUGGESTION) { @@ -568,7 +568,7 @@ class Notifier // Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first. // The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts. // This is only important for high and medium priority tasks and not for Low priority jobs like deletions. - if (($contact['network'] == Protocol::DIASPORA) && in_array($a->getQueueValue('priority'), [PRIORITY_HIGH, PRIORITY_MEDIUM])) { + if (($contact['network'] == Protocol::DIASPORA) && in_array($a->getQueueValue('priority'), [Worker::PRIORITY_HIGH, Worker::PRIORITY_MEDIUM])) { $deliver_options = ['priority' => $a->getQueueValue('priority'), 'dont_fork' => true]; } else { $deliver_options = ['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true]; @@ -698,7 +698,7 @@ class Notifier $inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($self_user_id); foreach ($inboxes as $inbox => $receivers) { Logger::info('Account removal via ActivityPub', ['uid' => $self_user_id, 'inbox' => $inbox]); - Worker::add(['priority' => PRIORITY_NEGLIGIBLE, 'created' => $created, 'dont_fork' => true], + Worker::add(['priority' => Worker::PRIORITY_NEGLIGIBLE, 'created' => $created, 'dont_fork' => true], 'APDelivery', Delivery::REMOVAL, 0, $inbox, $self_user_id, $receivers); Worker::coolDown(); } @@ -817,7 +817,7 @@ class Notifier if (DI::config()->get('system', 'bulk_delivery')) { $delivery_queue_count++; Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd, $receivers); - Worker::add(PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0); + Worker::add(Worker::PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0); } else { if (Worker::add(['priority' => $priority, 'created' => $created, 'dont_fork' => true], 'APDelivery', $cmd, $target_item['id'], $inbox, $uid, $receivers, $target_item['uri-id'])) { @@ -834,7 +834,7 @@ class Notifier if (DI::config()->get('system', 'bulk_delivery')) { $delivery_queue_count++; Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd, []); - Worker::add(PRIORITY_MEDIUM, 'APDelivery', '', 0, $inbox, 0); + Worker::add(Worker::PRIORITY_MEDIUM, 'APDelivery', '', 0, $inbox, 0); } else { if (Worker::add(['priority' => $priority, 'dont_fork' => true], 'APDelivery', $cmd, $target_item['id'], $inbox, $uid, [], $target_item['uri-id'])) { $delivery_queue_count++; diff --git a/src/Worker/PollContacts.php b/src/Worker/PollContacts.php index b4312ef0c..454b5a9ae 100644 --- a/src/Worker/PollContacts.php +++ b/src/Worker/PollContacts.php @@ -71,11 +71,11 @@ class PollContacts } if ((($contact['network'] == Protocol::FEED) && ($contact['priority'] <= 3)) || ($contact['network'] == Protocol::MAIL)) { - $priority = PRIORITY_MEDIUM; + $priority = Worker::PRIORITY_MEDIUM; } elseif ($contact['archive']) { - $priority = PRIORITY_NEGLIGIBLE; + $priority = Worker::PRIORITY_NEGLIGIBLE; } else { - $priority = PRIORITY_LOW; + $priority = Worker::PRIORITY_LOW; } Logger::notice("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact['priority'] . " " . $contact["nick"] . " " . $contact["name"]); diff --git a/src/Worker/RemoveUser.php b/src/Worker/RemoveUser.php index 6a2d54422..72ead5264 100644 --- a/src/Worker/RemoveUser.php +++ b/src/Worker/RemoveUser.php @@ -21,6 +21,7 @@ namespace Friendica\Worker; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Item; use Friendica\Model\Post; @@ -48,7 +49,7 @@ class RemoveUser { do { $items = Post::select(['id'], $condition, ['limit' => 100]); while ($item = Post::fetch($items)) { - Item::markForDeletionById($item['id'], PRIORITY_NEGLIGIBLE); + Item::markForDeletionById($item['id'], Worker::PRIORITY_NEGLIGIBLE); } DBA::close($items); } while (Post::exists($condition)); diff --git a/src/Worker/UpdateContacts.php b/src/Worker/UpdateContacts.php index 7e352a27c..ed4a9932f 100644 --- a/src/Worker/UpdateContacts.php +++ b/src/Worker/UpdateContacts.php @@ -59,7 +59,7 @@ class UpdateContacts $contacts = DBA::select('contact', ['id'], $condition, ['order' => ['next-update'], 'limit' => $limit]); $count = 0; while ($contact = DBA::fetch($contacts)) { - if (Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], "UpdateContact", $contact['id'])) { + if (Worker::add(['priority' => Worker::PRIORITY_LOW, 'dont_fork' => true], "UpdateContact", $contact['id'])) { ++$count; } Worker::coolDown(); diff --git a/src/Worker/UpdateGServers.php b/src/Worker/UpdateGServers.php index 108482eae..25a2db16e 100644 --- a/src/Worker/UpdateGServers.php +++ b/src/Worker/UpdateGServers.php @@ -63,12 +63,12 @@ class UpdateGServers // There are duplicated "url" but not "nurl". So we check both addresses instead of just overwriting them, // since that would mean loosing data. if (!empty($gserver['url'])) { - if (Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) { + if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) { $count++; } } if (!empty($gserver['nurl']) && ($gserver['nurl'] != Strings::normaliseLink($gserver['url']))) { - if (Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) { + if (Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) { $count++; } } diff --git a/static/defaults.config.php b/static/defaults.config.php index f20b333dd..647fb73b1 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -284,7 +284,7 @@ return [ // expire-notify-priority (integer) // Priority for the expirary notification - 'expire-notify-priority' => PRIORITY_LOW, + 'expire-notify-priority' => Friendica\Core\Worker::PRIORITY_LOW, // fetch_by_worker (Boolean) // Fetch missing posts via a background process diff --git a/update.php b/update.php index fab51993c..9f348efe6 100644 --- a/update.php +++ b/update.php @@ -131,7 +131,7 @@ function update_1309() continue; } - $deliver_options = ['priority' => PRIORITY_MEDIUM, 'dont_fork' => true]; + $deliver_options = ['priority' => Worker::PRIORITY_MEDIUM, 'dont_fork' => true]; Worker::add($deliver_options, 'Delivery', Delivery::POST, $item['id'], $entry['cid']); Logger::info('Added delivery worker', ['item' => $item['id'], 'contact' => $entry['cid']]); DBA::delete('queue', ['id' => $entry['id']]); @@ -152,7 +152,7 @@ function update_1318() DBA::update('profile', ['marital' => 'In a relation'], ['marital' => 'Unavailable']); DBA::update('profile', ['marital' => 'Single'], ['marital' => 'Available']); - Worker::add(PRIORITY_LOW, 'ProfileUpdate'); + Worker::add(Worker::PRIORITY_LOW, 'ProfileUpdate'); return Update::SUCCESS; } From a994b76ebc85e06d755374eac47dea24c13a6caf Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 17 Oct 2022 08:27:48 +0200 Subject: [PATCH 040/641] DE translation update --- view/lang/de/messages.po | 1281 ++++++++++++++++++-------------------- view/lang/de/strings.php | 103 ++- 2 files changed, 680 insertions(+), 704 deletions(-) diff --git a/view/lang/de/messages.po b/view/lang/de/messages.po index 3e8281fc3..c36cab7a6 100644 --- a/view/lang/de/messages.po +++ b/view/lang/de/messages.po @@ -49,7 +49,7 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-08 12:31-0400\n" +"POT-Creation-Date: 2022-10-16 12:38-0400\n" "PO-Revision-Date: 2011-05-05 10:19+0000\n" "Last-Translator: Tobias Diekershoff , 2016-2022\n" "Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" @@ -86,8 +86,8 @@ msgstr "Der Zugriff zu diesem Profil wurde eingeschränkt." #: mod/cal.php:243 mod/events.php:374 src/Content/Nav.php:196 #: src/Content/Nav.php:260 src/Module/BaseProfile.php:84 -#: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:234 -#: view/theme/frio/theme.php:238 +#: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:240 +#: view/theme/frio/theme.php:244 msgid "Events" msgstr "Veranstaltungen" @@ -108,17 +108,17 @@ msgid "today" msgstr "Heute" #: mod/cal.php:250 mod/events.php:384 src/Model/Event.php:461 -#: src/Util/Temporal.php:334 +#: src/Util/Temporal.php:338 msgid "month" msgstr "Monat" #: mod/cal.php:251 mod/events.php:385 src/Model/Event.php:462 -#: src/Util/Temporal.php:335 +#: src/Util/Temporal.php:339 msgid "week" msgstr "Woche" #: mod/cal.php:252 mod/events.php:386 src/Model/Event.php:463 -#: src/Util/Temporal.php:336 +#: src/Util/Temporal.php:340 msgid "day" msgstr "Tag" @@ -160,7 +160,7 @@ msgid "The feed for this item is unavailable." msgstr "Der Feed für diesen Beitrag ist nicht verfügbar." #: mod/editpost.php:38 mod/events.php:217 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:181 mod/item.php:186 mod/item.php:870 mod/message.php:69 +#: mod/item.php:181 mod/item.php:186 mod/item.php:865 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:33 #: mod/photos.php:160 mod/photos.php:891 mod/repair_ostatus.php:31 #: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156 @@ -179,8 +179,8 @@ msgstr "Der Feed für diesen Beitrag ist nicht verfügbar." #: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56 #: src/Module/Register.php:77 src/Module/Register.php:90 #: src/Module/Register.php:206 src/Module/Register.php:245 -#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:49 -#: src/Module/Settings/Account.php:409 src/Module/Settings/Delegation.php:42 +#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50 +#: src/Module/Settings/Account.php:410 src/Module/Settings/Delegation.php:42 #: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42 #: src/Module/Settings/Display.php:120 #: src/Module/Settings/Profile/Photo/Crop.php:166 @@ -206,7 +206,7 @@ msgid "Save" msgstr "Speichern" #: mod/editpost.php:92 mod/photos.php:1338 src/Content/Conversation.php:338 -#: src/Module/Contact/Poke.php:176 src/Object/Post.php:993 +#: src/Object/Post.php:993 msgid "Loading..." msgstr "lädt..." @@ -253,7 +253,7 @@ msgid "audio link" msgstr "Audio-Link" #: mod/editpost.php:103 src/Content/Conversation.php:352 -#: src/Module/Item/Compose.php:173 +#: src/Module/Item/Compose.php:200 msgid "Set your location" msgstr "Deinen Standort festlegen" @@ -271,8 +271,8 @@ msgstr "Ort löschen" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1489 mod/wallmessage.php:142 -#: src/Content/Conversation.php:368 src/Content/Conversation.php:713 -#: src/Module/Item/Compose.php:177 src/Object/Post.php:538 +#: src/Content/Conversation.php:368 src/Content/Conversation.php:714 +#: src/Module/Item/Compose.php:204 src/Object/Post.php:538 msgid "Please wait" msgstr "Bitte warten" @@ -289,12 +289,12 @@ msgid "Public post" msgstr "Öffentlicher Beitrag" #: mod/editpost.php:120 src/Content/Conversation.php:357 -#: src/Module/Item/Compose.php:178 +#: src/Module/Item/Compose.php:205 msgid "Set title" msgstr "Titel setzen" #: mod/editpost.php:122 src/Content/Conversation.php:359 -#: src/Module/Item/Compose.php:179 +#: src/Module/Item/Compose.php:206 msgid "Categories (comma-separated list)" msgstr "Kategorien (kommasepariert)" @@ -304,11 +304,11 @@ msgstr "Z.B.: bob@example.com, mary@example.com" #: mod/editpost.php:128 mod/events.php:513 mod/photos.php:1337 #: mod/photos.php:1393 mod/photos.php:1467 src/Content/Conversation.php:383 -#: src/Module/Item/Compose.php:172 src/Object/Post.php:1003 +#: src/Module/Item/Compose.php:199 src/Object/Post.php:1003 msgid "Preview" msgstr "Vorschau" -#: mod/editpost.php:130 mod/fbrowser.php:118 mod/fbrowser.php:145 +#: mod/editpost.php:130 mod/fbrowser.php:119 mod/fbrowser.php:146 #: mod/follow.php:144 mod/photos.php:1004 mod/photos.php:1105 mod/tagrm.php:35 #: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:386 #: src/Module/Contact/Revoke.php:108 src/Module/RemoteFollow.php:127 @@ -317,37 +317,37 @@ msgid "Cancel" msgstr "Abbrechen" #: mod/editpost.php:134 src/Content/Conversation.php:343 -#: src/Module/Item/Compose.php:163 src/Object/Post.php:994 +#: src/Module/Item/Compose.php:190 src/Object/Post.php:994 msgid "Bold" msgstr "Fett" #: mod/editpost.php:135 src/Content/Conversation.php:344 -#: src/Module/Item/Compose.php:164 src/Object/Post.php:995 +#: src/Module/Item/Compose.php:191 src/Object/Post.php:995 msgid "Italic" msgstr "Kursiv" #: mod/editpost.php:136 src/Content/Conversation.php:345 -#: src/Module/Item/Compose.php:165 src/Object/Post.php:996 +#: src/Module/Item/Compose.php:192 src/Object/Post.php:996 msgid "Underline" msgstr "Unterstrichen" #: mod/editpost.php:137 src/Content/Conversation.php:346 -#: src/Module/Item/Compose.php:166 src/Object/Post.php:997 +#: src/Module/Item/Compose.php:193 src/Object/Post.php:997 msgid "Quote" msgstr "Zitat" #: mod/editpost.php:138 src/Content/Conversation.php:347 -#: src/Module/Item/Compose.php:167 src/Object/Post.php:998 +#: src/Module/Item/Compose.php:194 src/Object/Post.php:998 msgid "Code" msgstr "Code" #: mod/editpost.php:139 src/Content/Conversation.php:349 -#: src/Module/Item/Compose.php:169 src/Object/Post.php:1000 +#: src/Module/Item/Compose.php:196 src/Object/Post.php:1000 msgid "Link" msgstr "Link" #: mod/editpost.php:140 src/Content/Conversation.php:350 -#: src/Module/Item/Compose.php:170 src/Object/Post.php:1001 +#: src/Module/Item/Compose.php:197 src/Object/Post.php:1001 msgid "Link or Media" msgstr "Link oder Mediendatei" @@ -449,16 +449,16 @@ msgstr "Veranstaltung teilen" #: mod/photos.php:921 mod/photos.php:1025 mod/photos.php:1295 #: mod/photos.php:1336 mod/photos.php:1392 mod/photos.php:1466 #: src/Module/Admin/Item/Source.php:60 src/Module/Contact/Advanced.php:132 -#: src/Module/Contact/Poke.php:177 src/Module/Contact/Profile.php:327 +#: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 #: 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/Delegation.php:148 src/Module/FriendSuggest.php:144 #: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:331 src/Module/Invite.php:178 -#: src/Module/Item/Compose.php:162 src/Module/Profile/Profile.php:247 +#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:247 #: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:992 -#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 +#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:171 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 msgid "Submit" msgstr "Senden" @@ -467,7 +467,7 @@ msgstr "Senden" msgid "Basic" msgstr "Allgemein" -#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:474 +#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:477 #: src/Module/Profile/Profile.php:249 msgid "Advanced" msgstr "Erweitert" @@ -477,16 +477,16 @@ msgid "Failed to remove event" msgstr "Entfernen der Veranstaltung fehlgeschlagen" #: mod/fbrowser.php:61 src/Content/Nav.php:194 src/Module/BaseProfile.php:64 -#: view/theme/frio/theme.php:232 +#: view/theme/frio/theme.php:238 msgid "Photos" msgstr "Bilder" -#: mod/fbrowser.php:120 mod/fbrowser.php:147 +#: mod/fbrowser.php:121 mod/fbrowser.php:148 #: src/Module/Settings/Profile/Photo/Index.php:129 msgid "Upload" msgstr "Hochladen" -#: mod/fbrowser.php:142 +#: mod/fbrowser.php:143 msgid "Files" msgstr "Dateien" @@ -510,8 +510,8 @@ msgstr "Diaspora-Unterstützung ist nicht aktiviert. Der Kontakt kann nicht zuge msgid "OStatus support is disabled. Contact can't be added." msgstr "OStatus-Unterstützung ist nicht aktiviert. Der Kontakt kann nicht zugefügt werden." -#: mod/follow.php:138 src/Content/Item.php:459 src/Content/Widget.php:80 -#: src/Model/Contact.php:1114 src/Model/Contact.php:1126 +#: mod/follow.php:138 src/Content/Item.php:400 src/Content/Widget.php:80 +#: src/Model/Contact.php:1169 src/Model/Contact.php:1180 #: view/theme/vier/theme.php:181 msgid "Connect/Follow" msgstr "Verbinden/Folgen" @@ -548,7 +548,7 @@ msgid "Add a personal note:" msgstr "Eine persönliche Notiz beifügen:" #: mod/follow.php:163 mod/unfollow.php:109 src/Module/BaseProfile.php:59 -#: src/Module/Contact.php:444 +#: src/Module/Contact.php:447 msgid "Status Messages and Posts" msgstr "Statusnachrichten und Beiträge" @@ -564,19 +564,19 @@ msgstr "Konnte den Originalbeitrag nicht finden." msgid "Empty post discarded." msgstr "Leerer Beitrag wurde verworfen." -#: mod/item.php:682 +#: mod/item.php:677 msgid "Post updated." msgstr "Beitrag aktualisiert." -#: mod/item.php:692 mod/item.php:697 +#: mod/item.php:687 mod/item.php:692 msgid "Item wasn't stored." msgstr "Eintrag wurde nicht gespeichert" -#: mod/item.php:708 +#: mod/item.php:703 msgid "Item couldn't be fetched." msgstr "Eintrag konnte nicht geholt werden." -#: mod/item.php:848 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:843 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 #: src/Module/Debug/ItemBody.php:57 msgid "Item not found." @@ -754,7 +754,7 @@ msgstr "Konnte Nachrichten nicht abrufen." msgid "Discard" msgstr "Verwerfen" -#: mod/message.php:133 src/Content/Nav.php:285 view/theme/frio/theme.php:239 +#: mod/message.php:133 src/Content/Nav.php:285 view/theme/frio/theme.php:245 msgid "Messages" msgstr "Nachrichten" @@ -1108,7 +1108,7 @@ msgid "Rotate CCW (left)" msgstr "Drehen EUS (links)" #: mod/photos.php:1333 mod/photos.php:1389 mod/photos.php:1463 -#: src/Module/Contact.php:544 src/Module/Item/Compose.php:160 +#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:989 msgid "This is you" msgstr "Das bist du" @@ -1118,12 +1118,12 @@ msgstr "Das bist du" msgid "Comment" msgstr "Kommentar" -#: mod/photos.php:1424 src/Content/Conversation.php:629 +#: mod/photos.php:1424 src/Content/Conversation.php:630 #: src/Object/Post.php:256 msgid "Select" msgstr "Auswählen" -#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:630 +#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:631 #: src/Module/Admin/Users/Active.php:139 #: src/Module/Admin/Users/Blocked.php:140 src/Module/Admin/Users/Index.php:153 msgid "Delete" @@ -1170,7 +1170,7 @@ msgstr "Ungültige Anfrage." msgid "Contact not found." msgstr "Kontakt nicht gefunden." -#: mod/removeme.php:65 src/Navigation/Notifications/Repository/Notify.php:483 +#: mod/removeme.php:65 src/Navigation/Notifications/Repository/Notify.php:467 msgid "[Friendica System Notify]" msgstr "[Friendica-Systembenachrichtigung]" @@ -1247,8 +1247,8 @@ msgstr "Autorisierung entziehen" #: mod/settings.php:352 src/Module/Admin/Addons/Index.php:69 #: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:81 #: src/Module/Admin/Site.php:436 src/Module/Admin/Themes/Index.php:113 -#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:562 -#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:193 +#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:563 +#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:201 msgid "Save Settings" msgstr "Einstellungen speichern" @@ -1452,15 +1452,15 @@ msgstr "Keine Vorschläge verfügbar. Falls der Server frisch aufgesetzt wurde, msgid "Friend Suggestions" msgstr "Kontaktvorschläge" -#: mod/tagger.php:78 src/Content/Item.php:354 src/Model/Item.php:2769 +#: mod/tagger.php:78 src/Content/Item.php:300 src/Model/Item.php:2855 msgid "photo" msgstr "Foto" -#: mod/tagger.php:78 src/Content/Item.php:348 src/Content/Item.php:358 +#: mod/tagger.php:78 src/Content/Item.php:294 src/Content/Item.php:304 msgid "status" msgstr "Status" -#: mod/tagger.php:111 src/Content/Item.php:368 +#: mod/tagger.php:111 src/Content/Item.php:314 #, php-format msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "%1$s hat %2$ss %3$s mit %4$s getaggt" @@ -1598,17 +1598,17 @@ msgstr "Es wurde kein Konfigurationswert für das systemweite Theme gesetzt." msgid "Apologies but the website is unavailable at the moment." msgstr "Entschuldigung, aber die Webseite ist derzeit nicht erreichbar." -#: src/App/Page.php:276 +#: src/App/Page.php:281 msgid "Delete this item?" msgstr "Diesen Beitrag löschen?" -#: src/App/Page.php:277 +#: src/App/Page.php:282 msgid "" "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." msgstr "Soll dieser Autor geblockt werden? Sie werden nicht in der Lage sein, dir zu folgen oder deine öffentlichen Beiträge zu sehen. Außerdem wirst du nicht in der Lage sein ihre Beiträge und Benachrichtigungen zu lesen." -#: src/App/Page.php:347 +#: src/App/Page.php:352 msgid "toggle mobile" msgstr "mobile Ansicht umschalten" @@ -1636,18 +1636,18 @@ msgid "All contacts" msgstr "Alle Kontakte" #: src/BaseModule.php:424 src/Content/Widget.php:235 src/Core/ACL.php:194 -#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:122 +#: src/Module/Contact.php:370 src/Module/PermissionTooltip.php:122 #: src/Module/PermissionTooltip.php:144 msgid "Followers" msgstr "Folgende" #: src/BaseModule.php:429 src/Content/Widget.php:236 -#: src/Module/Contact.php:368 +#: src/Module/Contact.php:371 msgid "Following" msgstr "Gefolgte" #: src/BaseModule.php:434 src/Content/Widget.php:237 -#: src/Module/Contact.php:369 +#: src/Module/Contact.php:372 msgid "Mutual friends" msgstr "Beidseitige Freundschaft" @@ -1687,63 +1687,63 @@ msgstr "Für die URL (%s) konnte kein Kontakt gefunden werden" msgid "The contact has been blocked from the node" msgstr "Der Kontakt wurde von diesem Knoten geblockt" -#: src/Console/MergeContacts.php:74 +#: src/Console/MergeContacts.php:75 #, php-format msgid "%d %s, %d duplicates." msgstr "%d %s, Duplikat %d." -#: src/Console/MergeContacts.php:77 +#: src/Console/MergeContacts.php:78 #, php-format msgid "uri-id is empty for contact %s." msgstr "URI-ID ist leer für den Kontakt %s." -#: src/Console/MergeContacts.php:90 +#: src/Console/MergeContacts.php:91 #, php-format msgid "No valid first contact found for uri-id %d." msgstr "Kein gültiger erster Kontakt für die url-id %d gefunden." -#: src/Console/MergeContacts.php:101 +#: src/Console/MergeContacts.php:102 #, php-format msgid "Wrong duplicate found for uri-id %d in %d (url: %s != %s)." msgstr "Falsches Dublikat für die URI-ID %d in %d gefunden (URI: %s != %s)." -#: src/Console/MergeContacts.php:105 +#: src/Console/MergeContacts.php:106 #, php-format msgid "Wrong duplicate found for uri-id %d in %d (nurl: %s != %s)." msgstr "Falsches Dublikat für die URI-ID %d in %d (nurl: %s != %s)." -#: src/Console/MergeContacts.php:141 +#: src/Console/MergeContacts.php:142 #, php-format msgid "Deletion of id %d failed" msgstr "Löschung der ID %d fehlgeschlagen" -#: src/Console/MergeContacts.php:143 +#: src/Console/MergeContacts.php:144 #, php-format msgid "Deletion of id %d was successful" msgstr "Löschug der ID %d war erfolgreich" -#: src/Console/MergeContacts.php:149 +#: src/Console/MergeContacts.php:150 #, php-format msgid "Updating \"%s\" in \"%s\" from %d to %d" msgstr "Aktualisieren \"%s\" nach \"%s\" von %d nach %d" -#: src/Console/MergeContacts.php:151 +#: src/Console/MergeContacts.php:152 msgid " - found" msgstr "- gefunden" -#: src/Console/MergeContacts.php:158 +#: src/Console/MergeContacts.php:159 msgid " - failed" msgstr "- fehlgeschlagen" -#: src/Console/MergeContacts.php:160 +#: src/Console/MergeContacts.php:161 msgid " - success" msgstr "- Erfolg" -#: src/Console/MergeContacts.php:164 +#: src/Console/MergeContacts.php:165 msgid " - deleted" msgstr "- gelöscht" -#: src/Console/MergeContacts.php:167 +#: src/Console/MergeContacts.php:168 msgid " - done" msgstr "- erledigt" @@ -1806,12 +1806,12 @@ msgid "Enter new password: " msgstr "Neues Passwort eingeben:" #: src/Console/User.php:210 src/Module/Security/PasswordTooLong.php:65 -#: src/Module/Settings/Account.php:74 +#: src/Module/Settings/Account.php:75 msgid "Password update failed. Please try again." msgstr "Aktualisierung des Passworts gescheitert, bitte versuche es noch einmal." #: src/Console/User.php:213 src/Module/Security/PasswordTooLong.php:68 -#: src/Module/Settings/Account.php:77 +#: src/Module/Settings/Account.php:78 msgid "Password changed." msgstr "Passwort geändert." @@ -1990,7 +1990,7 @@ msgid "%s attends maybe." msgstr "%s nimmt eventuell teil." #: src/Content/Conversation.php:222 src/Content/Conversation.php:260 -#: src/Content/Conversation.php:873 +#: src/Content/Conversation.php:874 #, php-format msgid "%s reshared this." msgstr "%s hat dies geteilt" @@ -2063,7 +2063,7 @@ msgstr "%2$d Personen haben dies geteilt" msgid "Visible to everybody" msgstr "Für jedermann sichtbar" -#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:171 +#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:198 #: src/Object/Post.php:1002 msgid "Please enter a image/video/audio/webpage URL:" msgstr "Bitte gib eine Bild/Video/Audio/Webseiten-URL ein:" @@ -2084,7 +2084,7 @@ msgstr "Wo hältst du dich jetzt gerade auf?" msgid "Delete item(s)?" msgstr "Einträge löschen?" -#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:143 +#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:175 msgid "Created at" msgstr "Erstellt am" @@ -2096,7 +2096,7 @@ msgstr "Neuer Beitrag" msgid "Share" msgstr "Teilen" -#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:168 +#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:195 #: src/Object/Post.php:999 msgid "Image" msgstr "Bild" @@ -2105,119 +2105,119 @@ msgstr "Bild" msgid "Video" msgstr "Video" -#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:184 +#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:222 msgid "Scheduled at" msgstr "Geplant für" -#: src/Content/Conversation.php:657 src/Object/Post.php:244 +#: src/Content/Conversation.php:658 src/Object/Post.php:244 msgid "Pinned item" msgstr "Angehefteter Beitrag" -#: src/Content/Conversation.php:673 src/Object/Post.php:486 +#: src/Content/Conversation.php:674 src/Object/Post.php:486 #: src/Object/Post.php:487 #, php-format msgid "View %s's profile @ %s" msgstr "Das Profil von %s auf %s betrachten." -#: src/Content/Conversation.php:686 src/Object/Post.php:474 +#: src/Content/Conversation.php:687 src/Object/Post.php:474 msgid "Categories:" msgstr "Kategorien:" -#: src/Content/Conversation.php:687 src/Object/Post.php:475 +#: src/Content/Conversation.php:688 src/Object/Post.php:475 msgid "Filed under:" msgstr "Abgelegt unter:" -#: src/Content/Conversation.php:695 src/Object/Post.php:500 +#: src/Content/Conversation.php:696 src/Object/Post.php:500 #, php-format msgid "%s from %s" msgstr "%s von %s" -#: src/Content/Conversation.php:711 +#: src/Content/Conversation.php:712 msgid "View in context" msgstr "Im Zusammenhang betrachten" -#: src/Content/Conversation.php:776 +#: src/Content/Conversation.php:777 msgid "remove" msgstr "löschen" -#: src/Content/Conversation.php:780 +#: src/Content/Conversation.php:781 msgid "Delete Selected Items" msgstr "Lösche die markierten Beiträge" -#: src/Content/Conversation.php:845 src/Content/Conversation.php:848 -#: src/Content/Conversation.php:851 src/Content/Conversation.php:854 +#: src/Content/Conversation.php:846 src/Content/Conversation.php:849 +#: src/Content/Conversation.php:852 src/Content/Conversation.php:855 #, php-format msgid "You had been addressed (%s)." msgstr "Du wurdest angeschrieben (%s)." -#: src/Content/Conversation.php:857 +#: src/Content/Conversation.php:858 #, php-format msgid "You are following %s." msgstr "Du folgst %s." -#: src/Content/Conversation.php:860 +#: src/Content/Conversation.php:861 msgid "You subscribed to one or more tags in this post." msgstr "Du folgst einem oder mehreren Hashtags dieses Beitrags." -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 msgid "Reshared" msgstr "Geteilt" -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 #, php-format msgid "Reshared by %s <%s>" msgstr "Geteilt von %s <%s>" -#: src/Content/Conversation.php:878 +#: src/Content/Conversation.php:879 #, php-format msgid "%s is participating in this thread." msgstr "%s ist an der Unterhaltung beteiligt." -#: src/Content/Conversation.php:881 +#: src/Content/Conversation.php:882 msgid "Stored for general reasons" -msgstr "" +msgstr "Aus allgemeinen Gründen aufbewahrt" -#: src/Content/Conversation.php:884 +#: src/Content/Conversation.php:885 msgid "Global post" msgstr "Globaler Beitrag" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 msgid "Sent via an relay server" msgstr "Über einen Relay-Server gesendet" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 #, php-format msgid "Sent via the relay server %s <%s>" msgstr "Über den Relay-Server %s <%s> gesendet" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 msgid "Fetched" msgstr "Abgerufen" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 #, php-format msgid "Fetched because of %s <%s>" msgstr "Wegen %s <%s> abgerufen" -#: src/Content/Conversation.php:893 +#: src/Content/Conversation.php:894 msgid "Stored because of a child post to complete this thread." -msgstr "" +msgstr "Gespeichert wegen eines untergeordneten Beitrags zur Vervollständigung dieses Themas." -#: src/Content/Conversation.php:896 +#: src/Content/Conversation.php:897 msgid "Local delivery" msgstr "Lokale Zustellung" -#: src/Content/Conversation.php:899 +#: src/Content/Conversation.php:900 msgid "Stored because of your activity (like, comment, star, ...)" -msgstr "" +msgstr "Gespeichert aufgrund Ihrer Aktivität (Like, Kommentar, Stern, ...)" -#: src/Content/Conversation.php:902 +#: src/Content/Conversation.php:903 msgid "Distributed" -msgstr "" +msgstr "Verteilt" -#: src/Content/Conversation.php:905 +#: src/Content/Conversation.php:906 msgid "Pushed to us" -msgstr "" +msgstr "Zu uns gepusht" #: src/Content/Feature.php:96 msgid "General Features" @@ -2335,56 +2335,51 @@ msgstr "weniger anzeigen" msgid "show more" msgstr "mehr anzeigen" -#: src/Content/Item.php:306 -#, php-format -msgid "%1$s poked %2$s" -msgstr "%1$s stupste %2$s" - -#: src/Content/Item.php:345 src/Model/Item.php:2767 +#: src/Content/Item.php:291 src/Model/Item.php:2853 msgid "event" msgstr "Veranstaltung" -#: src/Content/Item.php:438 view/theme/frio/theme.php:260 +#: src/Content/Item.php:383 view/theme/frio/theme.php:266 msgid "Follow Thread" msgstr "Folge der Unterhaltung" -#: src/Content/Item.php:439 src/Model/Contact.php:1119 +#: src/Content/Item.php:384 src/Model/Contact.php:1174 msgid "View Status" msgstr "Status anschauen" -#: src/Content/Item.php:440 src/Content/Item.php:462 -#: src/Model/Contact.php:1053 src/Model/Contact.php:1111 -#: src/Model/Contact.php:1120 src/Module/Directory.php:158 +#: src/Content/Item.php:385 src/Content/Item.php:403 +#: src/Model/Contact.php:1112 src/Model/Contact.php:1166 +#: src/Model/Contact.php:1175 src/Module/Directory.php:158 #: src/Module/Settings/Profile/Index.php:225 msgid "View Profile" msgstr "Profil anschauen" -#: src/Content/Item.php:441 src/Model/Contact.php:1121 +#: src/Content/Item.php:386 src/Model/Contact.php:1176 msgid "View Photos" msgstr "Bilder anschauen" -#: src/Content/Item.php:442 src/Model/Contact.php:1112 -#: src/Model/Contact.php:1122 +#: src/Content/Item.php:387 src/Model/Contact.php:1167 +#: src/Model/Contact.php:1177 msgid "Network Posts" msgstr "Netzwerkbeiträge" -#: src/Content/Item.php:443 src/Model/Contact.php:1113 -#: src/Model/Contact.php:1123 +#: src/Content/Item.php:388 src/Model/Contact.php:1168 +#: src/Model/Contact.php:1178 msgid "View Contact" msgstr "Kontakt anzeigen" -#: src/Content/Item.php:444 src/Model/Contact.php:1124 +#: src/Content/Item.php:389 src/Model/Contact.php:1179 msgid "Send PM" msgstr "Private Nachricht senden" -#: src/Content/Item.php:445 src/Module/Admin/Blocklist/Contact.php:100 +#: src/Content/Item.php:390 src/Module/Admin/Blocklist/Contact.php:100 #: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154 -#: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Block" msgstr "Sperren" -#: src/Content/Item.php:446 src/Module/Contact.php:399 +#: src/Content/Item.php:391 src/Module/Contact.php:402 #: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457 #: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:204 @@ -2392,14 +2387,10 @@ msgstr "Sperren" msgid "Ignore" msgstr "Ignorieren" -#: src/Content/Item.php:450 src/Object/Post.php:455 +#: src/Content/Item.php:395 src/Object/Post.php:455 msgid "Languages" msgstr "Sprachen" -#: src/Content/Item.php:454 src/Model/Contact.php:1125 -msgid "Poke" -msgstr "Anstupsen" - #: src/Content/Nav.php:90 msgid "Nothing new here" msgstr "Keine Neuigkeiten" @@ -2434,42 +2425,42 @@ msgid "Sign in" msgstr "Anmelden" #: src/Content/Nav.php:192 src/Module/BaseProfile.php:56 -#: src/Module/Contact.php:433 src/Module/Contact/Profile.php:380 -#: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:230 +#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380 +#: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:236 msgid "Status" msgstr "Status" #: src/Content/Nav.php:192 src/Content/Nav.php:275 -#: view/theme/frio/theme.php:230 +#: view/theme/frio/theme.php:236 msgid "Your posts and conversations" msgstr "Deine Beiträge und Unterhaltungen" #: src/Content/Nav.php:193 src/Module/BaseProfile.php:48 -#: src/Module/BaseSettings.php:55 src/Module/Contact.php:457 +#: src/Module/BaseSettings.php:55 src/Module/Contact.php:460 #: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:241 -#: src/Module/Welcome.php:57 view/theme/frio/theme.php:231 +#: src/Module/Welcome.php:57 view/theme/frio/theme.php:237 msgid "Profile" msgstr "Profil" -#: src/Content/Nav.php:193 view/theme/frio/theme.php:231 +#: src/Content/Nav.php:193 view/theme/frio/theme.php:237 msgid "Your profile page" msgstr "Deine Profilseite" -#: src/Content/Nav.php:194 view/theme/frio/theme.php:232 +#: src/Content/Nav.php:194 view/theme/frio/theme.php:238 msgid "Your photos" msgstr "Deine Fotos" #: src/Content/Nav.php:195 src/Module/BaseProfile.php:72 -#: src/Module/BaseProfile.php:75 src/Module/Contact.php:449 -#: view/theme/frio/theme.php:233 +#: src/Module/BaseProfile.php:75 src/Module/Contact.php:452 +#: view/theme/frio/theme.php:239 msgid "Media" msgstr "Medien" -#: src/Content/Nav.php:195 view/theme/frio/theme.php:233 +#: src/Content/Nav.php:195 view/theme/frio/theme.php:239 msgid "Your postings with media" msgstr "Deine Beiträge die Medien beinhalten" -#: src/Content/Nav.php:196 view/theme/frio/theme.php:234 +#: src/Content/Nav.php:196 view/theme/frio/theme.php:240 msgid "Your events" msgstr "Deine Ereignisse" @@ -2534,8 +2525,8 @@ msgstr "Tags" #: src/Content/Nav.php:237 src/Content/Nav.php:296 #: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:125 -#: src/Module/BaseProfile.php:128 src/Module/Contact.php:370 -#: src/Module/Contact.php:464 view/theme/frio/theme.php:241 +#: src/Module/BaseProfile.php:128 src/Module/Contact.php:373 +#: src/Module/Contact.php:467 view/theme/frio/theme.php:247 msgid "Contacts" msgstr "Kontakte" @@ -2548,7 +2539,7 @@ msgid "Conversations on this and other servers" msgstr "Unterhaltungen auf diesem und anderen Servern" #: src/Content/Nav.php:260 src/Module/BaseProfile.php:87 -#: src/Module/BaseProfile.php:98 view/theme/frio/theme.php:238 +#: src/Module/BaseProfile.php:98 view/theme/frio/theme.php:244 msgid "Events and Calendar" msgstr "Ereignisse und Kalender" @@ -2578,11 +2569,11 @@ msgstr "Nutzungsbedingungen" msgid "Terms of Service of this Friendica instance" msgstr "Die Nutzungsbedingungen dieser Friendica-Instanz" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:237 +#: src/Content/Nav.php:273 view/theme/frio/theme.php:243 msgid "Network" msgstr "Netzwerk" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:237 +#: src/Content/Nav.php:273 view/theme/frio/theme.php:243 msgid "Conversations from your friends" msgstr "Unterhaltungen Deiner Kontakte" @@ -2607,7 +2598,7 @@ msgstr "Alle Benachrichtigungen anzeigen" msgid "Mark all system notifications as seen" msgstr "Markiere alle Systembenachrichtigungen als gelesen" -#: src/Content/Nav.php:285 view/theme/frio/theme.php:239 +#: src/Content/Nav.php:285 view/theme/frio/theme.php:245 msgid "Private mail" msgstr "Private E-Mail" @@ -2629,15 +2620,15 @@ msgstr "Andere Seiten verwalten" #: src/Content/Nav.php:294 src/Module/Admin/Addons/Details.php:114 #: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:122 -#: src/Module/Welcome.php:52 view/theme/frio/theme.php:240 +#: src/Module/Welcome.php:52 view/theme/frio/theme.php:246 msgid "Settings" msgstr "Einstellungen" -#: src/Content/Nav.php:294 view/theme/frio/theme.php:240 +#: src/Content/Nav.php:294 view/theme/frio/theme.php:246 msgid "Account settings" msgstr "Kontoeinstellungen" -#: src/Content/Nav.php:296 view/theme/frio/theme.php:241 +#: src/Content/Nav.php:296 view/theme/frio/theme.php:247 msgid "Manage/edit friends and contacts" msgstr "Freunde und Kontakte verwalten/bearbeiten" @@ -2681,38 +2672,38 @@ msgstr "nächste" msgid "last" msgstr "letzte" -#: src/Content/Text/BBCode.php:998 src/Content/Text/BBCode.php:1833 -#: src/Content/Text/BBCode.php:1834 +#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1883 +#: src/Content/Text/BBCode.php:1884 msgid "Image/photo" msgstr "Bild/Foto" -#: src/Content/Text/BBCode.php:1188 +#: src/Content/Text/BBCode.php:1238 #, php-format msgid "%2$s %3$s" msgstr "%2$s%3$s" -#: src/Content/Text/BBCode.php:1213 src/Model/Item.php:3343 -#: src/Model/Item.php:3349 src/Model/Item.php:3350 +#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3429 +#: src/Model/Item.php:3435 src/Model/Item.php:3436 msgid "Link to source" msgstr "Link zum Originalbeitrag" -#: src/Content/Text/BBCode.php:1751 src/Content/Text/HTML.php:940 +#: src/Content/Text/BBCode.php:1801 src/Content/Text/HTML.php:940 msgid "Click to open/close" msgstr "Zum Öffnen/Schließen klicken" -#: src/Content/Text/BBCode.php:1782 +#: src/Content/Text/BBCode.php:1832 msgid "$1 wrote:" msgstr "$1 hat geschrieben:" -#: src/Content/Text/BBCode.php:1838 src/Content/Text/BBCode.php:1839 +#: src/Content/Text/BBCode.php:1888 src/Content/Text/BBCode.php:1889 msgid "Encrypted content" msgstr "Verschlüsselter Inhalt" -#: src/Content/Text/BBCode.php:2057 +#: src/Content/Text/BBCode.php:2109 msgid "Invalid source protocol" msgstr "Ungültiges Quell-Protokoll" -#: src/Content/Text/BBCode.php:2072 +#: src/Content/Text/BBCode.php:2124 msgid "Invalid link protocol" msgstr "Ungültiges Link-Protokoll" @@ -2764,7 +2755,7 @@ msgstr "Name oder Interessen eingeben" msgid "Examples: Robert Morgenstein, Fishing" msgstr "Beispiel: Robert Morgenstein, Angeln" -#: src/Content/Widget.php:82 src/Module/Contact.php:391 +#: src/Content/Widget.php:82 src/Module/Contact.php:394 #: src/Module/Directory.php:97 view/theme/vier/theme.php:183 msgid "Find" msgstr "Finde" @@ -2791,7 +2782,7 @@ msgid "Local Directory" msgstr "Lokales Verzeichnis" #: src/Content/Widget.php:211 src/Model/Group.php:587 -#: src/Module/Contact.php:354 src/Module/Welcome.php:76 +#: src/Module/Contact.php:357 src/Module/Welcome.php:76 msgid "Groups" msgstr "Gruppen" @@ -2803,7 +2794,7 @@ msgstr "Jeder" msgid "Relationships" msgstr "Beziehungen" -#: src/Content/Widget.php:244 src/Module/Contact.php:306 +#: src/Content/Widget.php:244 src/Module/Contact.php:309 #: src/Module/Group.php:293 msgid "All Contacts" msgstr "Alle Kontakte" @@ -2847,11 +2838,11 @@ msgstr "Personen" msgid "Organisations" msgstr "Organisationen" -#: src/Content/Widget.php:523 src/Model/Contact.php:1547 +#: src/Content/Widget.php:523 src/Model/Contact.php:1605 msgid "News" msgstr "Nachrichten" -#: src/Content/Widget.php:527 src/Module/Settings/Account.php:455 +#: src/Content/Widget.php:527 src/Module/Settings/Account.php:456 msgid "Account Types" msgstr "Kontenarten" @@ -3291,32 +3282,37 @@ msgid "Could not connect to database." msgstr "Verbindung zur Datenbank gescheitert." #: src/Core/L10n.php:403 src/Model/Event.php:428 -#: src/Module/Settings/Display.php:182 +#: src/Module/Settings/Display.php:184 msgid "Monday" msgstr "Montag" #: src/Core/L10n.php:403 src/Model/Event.php:429 +#: src/Module/Settings/Display.php:185 msgid "Tuesday" msgstr "Dienstag" #: src/Core/L10n.php:403 src/Model/Event.php:430 +#: src/Module/Settings/Display.php:186 msgid "Wednesday" msgstr "Mittwoch" #: src/Core/L10n.php:403 src/Model/Event.php:431 +#: src/Module/Settings/Display.php:187 msgid "Thursday" msgstr "Donnerstag" #: src/Core/L10n.php:403 src/Model/Event.php:432 +#: src/Module/Settings/Display.php:188 msgid "Friday" msgstr "Freitag" #: src/Core/L10n.php:403 src/Model/Event.php:433 +#: src/Module/Settings/Display.php:189 msgid "Saturday" msgstr "Samstag" #: src/Core/L10n.php:403 src/Model/Event.php:427 -#: src/Module/Settings/Display.php:182 +#: src/Module/Settings/Display.php:183 msgid "Sunday" msgstr "Sonntag" @@ -3440,57 +3436,9 @@ msgstr "Nov" msgid "Dec" msgstr "Dez" -#: src/Core/L10n.php:445 -msgid "poke" -msgstr "anstupsen" - -#: src/Core/L10n.php:445 -msgid "poked" -msgstr "stupste" - -#: src/Core/L10n.php:446 -msgid "ping" -msgstr "anpingen" - -#: src/Core/L10n.php:446 -msgid "pinged" -msgstr "pingte" - -#: src/Core/L10n.php:447 -msgid "prod" -msgstr "knuffen" - -#: src/Core/L10n.php:447 -msgid "prodded" -msgstr "knuffte" - -#: src/Core/L10n.php:448 -msgid "slap" -msgstr "ohrfeigen" - -#: src/Core/L10n.php:448 -msgid "slapped" -msgstr "ohrfeigte" - -#: src/Core/L10n.php:449 -msgid "finger" -msgstr "befummeln" - -#: src/Core/L10n.php:449 -msgid "fingered" -msgstr "befummelte" - -#: src/Core/L10n.php:450 -msgid "rebuff" -msgstr "eine Abfuhr erteilen" - -#: src/Core/L10n.php:450 -msgid "rebuffed" -msgstr "abfuhrerteilte" - #: src/Core/Renderer.php:89 src/Core/Renderer.php:118 #: src/Core/Renderer.php:145 src/Core/Renderer.php:179 -#: src/Render/FriendicaSmartyEngine.php:57 +#: src/Render/FriendicaSmartyEngine.php:60 msgid "" "Friendica can't display this page at the moment, please contact the " "administrator." @@ -3683,81 +3631,81 @@ msgstr "Interner Serverfehler" msgid "Legacy module file not found: %s" msgstr "Legacy-Moduldatei nicht gefunden: %s" -#: src/Model/Contact.php:1115 src/Model/Contact.php:1127 +#: src/Model/Contact.php:1170 src/Model/Contact.php:1181 msgid "UnFollow" msgstr "Entfolgen" -#: src/Model/Contact.php:1133 src/Module/Admin/Users/Pending.php:107 +#: src/Model/Contact.php:1187 src/Module/Admin/Users/Pending.php:107 #: src/Module/Notifications/Introductions.php:130 #: src/Module/Notifications/Introductions.php:202 msgid "Approve" msgstr "Genehmigen" -#: src/Model/Contact.php:1543 +#: src/Model/Contact.php:1601 msgid "Organisation" msgstr "Organisation" -#: src/Model/Contact.php:1551 +#: src/Model/Contact.php:1609 msgid "Forum" msgstr "Forum" -#: src/Model/Contact.php:2640 +#: src/Model/Contact.php:2795 msgid "Disallowed profile URL." msgstr "Nicht erlaubte Profil-URL." -#: src/Model/Contact.php:2645 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2800 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "Blockierte Domain" -#: src/Model/Contact.php:2650 +#: src/Model/Contact.php:2805 msgid "Connect URL missing." msgstr "Connect-URL fehlt" -#: src/Model/Contact.php:2659 +#: src/Model/Contact.php:2814 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "Der Kontakt konnte nicht hinzugefügt werden. Bitte überprüfe die Einstellungen unter Einstellungen -> Soziale Netzwerke" -#: src/Model/Contact.php:2701 +#: src/Model/Contact.php:2856 msgid "The profile address specified does not provide adequate information." msgstr "Die angegebene Profiladresse liefert unzureichende Informationen." -#: src/Model/Contact.php:2703 +#: src/Model/Contact.php:2858 msgid "No compatible communication protocols or feeds were discovered." msgstr "Es wurden keine kompatiblen Kommunikationsprotokolle oder Feeds gefunden." -#: src/Model/Contact.php:2706 +#: src/Model/Contact.php:2861 msgid "An author or name was not found." msgstr "Es wurde kein Autor oder Name gefunden." -#: src/Model/Contact.php:2709 +#: src/Model/Contact.php:2864 msgid "No browser URL could be matched to this address." msgstr "Zu dieser Adresse konnte keine passende Browser-URL gefunden werden." -#: src/Model/Contact.php:2712 +#: src/Model/Contact.php:2867 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "Konnte die @-Adresse mit keinem der bekannten Protokolle oder Email-Kontakte abgleichen." -#: src/Model/Contact.php:2713 +#: src/Model/Contact.php:2868 msgid "Use mailto: in front of address to force email check." msgstr "Verwende mailto: vor der E-Mail-Adresse, um eine Überprüfung der E-Mail-Adresse zu erzwingen." -#: src/Model/Contact.php:2719 +#: src/Model/Contact.php:2874 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "Die Adresse dieses Profils gehört zu einem Netzwerk, mit dem die Kommunikation auf dieser Seite ausgeschaltet wurde." -#: src/Model/Contact.php:2724 +#: src/Model/Contact.php:2879 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "Eingeschränktes Profil. Diese Person wird keine direkten/privaten Nachrichten von dir erhalten können." -#: src/Model/Contact.php:2783 +#: src/Model/Contact.php:2938 msgid "Unable to retrieve contact information." msgstr "Konnte die Kontaktinformationen nicht empfangen." @@ -3877,66 +3825,66 @@ msgstr "Gruppenname:" msgid "Edit groups" msgstr "Gruppen bearbeiten" -#: src/Model/Item.php:1865 +#: src/Model/Item.php:1965 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "Erkannte Sprachen in diesem Beitrag:\\n%s" -#: src/Model/Item.php:2771 +#: src/Model/Item.php:2857 msgid "activity" msgstr "Aktivität" -#: src/Model/Item.php:2773 +#: src/Model/Item.php:2859 msgid "comment" msgstr "Kommentar" -#: src/Model/Item.php:2776 +#: src/Model/Item.php:2862 msgid "post" msgstr "Beitrag" -#: src/Model/Item.php:2892 +#: src/Model/Item.php:2978 #, php-format msgid "Content warning: %s" msgstr "Inhaltswarnung: %s" -#: src/Model/Item.php:3255 +#: src/Model/Item.php:3341 msgid "bytes" msgstr "Byte" -#: src/Model/Item.php:3286 +#: src/Model/Item.php:3372 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "%2$s (%3$d%%, %1$d Stimme)" msgstr[1] "%2$s (%3$d%%, %1$d Stimmen)" -#: src/Model/Item.php:3288 +#: src/Model/Item.php:3374 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "%2$s (%1$d Stimme)" msgstr[1] "%2$s (%1$d Stimmen)" -#: src/Model/Item.php:3293 +#: src/Model/Item.php:3379 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "%d Stimme, Abstimmung endet: %s" msgstr[1] "%d Stimmen, Abstimmung endet: %s" -#: src/Model/Item.php:3295 +#: src/Model/Item.php:3381 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "%d Stimme." msgstr[1] "%d Stimmen." -#: src/Model/Item.php:3297 +#: src/Model/Item.php:3383 #, php-format msgid "Poll end: %s" msgstr "Abstimmung endet: %s" -#: src/Model/Item.php:3331 src/Model/Item.php:3332 +#: src/Model/Item.php:3417 src/Model/Item.php:3418 msgid "View on separate page" msgstr "Auf separater Seite ansehen" @@ -4329,12 +4277,12 @@ msgid "" "\t\t\tThank you and welcome to %2$s." msgstr "\nDie Anmelde-Details sind die folgenden:\n\tAdresse der Seite:\t%3$s\n\tBenutzernamename:\t%1$s\n\tPasswort:\t%5$s\n\nDu kannst dein Passwort unter \"Einstellungen\" ändern, sobald du dich\nangemeldet hast.\n\nBitte nimm dir ein paar Minuten, um die anderen Einstellungen auf dieser\nSeite zu kontrollieren.\n\nEventuell magst du ja auch einige Informationen über dich in deinem\nProfil veröffentlichen, damit andere Leute dich einfacher finden können.\nBearbeite hierfür einfach dein Standard-Profil (über die Profil-Seite).\n\nWir empfehlen dir, deinen kompletten Namen anzugeben und ein zu dir\npassendes Profilbild zu wählen, damit dich alte Bekannte wiederfinden.\nAußerdem ist es nützlich, wenn du auf deinem Profil Schlüsselwörter\nangibst. Das erleichtert es, Leute zu finden, die deine Interessen teilen.\n\nWir respektieren deine Privatsphäre - keine dieser Angaben ist nötig.\nWenn du neu im Netzwerk bist und noch niemanden kennst, dann können sie\nallerdings dabei helfen, neue und interessante Kontakte zu knüpfen.\n\nSolltest du dein Nutzerkonto löschen wollen, kannst du dies unter %3$s/removeme jederzeit tun.\n\nDanke für deine Aufmerksamkeit und willkommen auf %2$s." -#: src/Moderation/DomainPatternBlocklist.php:218 +#: src/Moderation/DomainPatternBlocklist.php:228 #, php-format msgid "[%s] Notice of remote server domain pattern block list update" msgstr "[%s] Die Liste der blockierten Domain Muster wurde aktualisiert" -#: src/Moderation/DomainPatternBlocklist.php:220 +#: src/Moderation/DomainPatternBlocklist.php:230 #, php-format msgid "" "Dear %s,\n" @@ -4374,7 +4322,7 @@ msgstr "Einschalten" #: src/Module/Admin/Blocklist/Server/Add.php:121 #: src/Module/Admin/Blocklist/Server/Import.php:117 #: src/Module/Admin/Blocklist/Server/Index.php:93 -#: src/Module/Admin/Federation.php:200 src/Module/Admin/Item/Delete.php:64 +#: src/Module/Admin/Federation.php:201 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:84 #: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:433 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:233 @@ -4441,8 +4389,8 @@ msgstr "Aktive" msgid "List of active accounts" msgstr "Liste der aktiven Benutzerkonten" -#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:314 -#: src/Module/Contact.php:374 +#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:317 +#: src/Module/Contact.php:377 msgid "Pending" msgstr "Ausstehend" @@ -4450,8 +4398,8 @@ msgstr "Ausstehend" msgid "List of pending registrations" msgstr "Liste der anstehenden Benutzerkonten" -#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:322 -#: src/Module/Contact.php:375 +#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:325 +#: src/Module/Contact.php:378 msgid "Blocked" msgstr "Geblockt" @@ -4467,19 +4415,19 @@ msgstr "Gelöscht" msgid "List of pending user deletions" msgstr "Liste der auf Löschung wartenden Benutzer" -#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:493 +#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:494 msgid "Normal Account Page" msgstr "Normales Konto" -#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:500 +#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:501 msgid "Soapbox Page" msgstr "Marktschreier-Konto" -#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:507 +#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:508 msgid "Public Forum" msgstr "Öffentliches Forum" -#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:514 +#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:515 msgid "Automatic Friend Page" msgstr "Automatische Freunde-Seite" @@ -4487,19 +4435,19 @@ msgstr "Automatische Freunde-Seite" msgid "Private Forum" msgstr "Privates Forum" -#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:465 +#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:466 msgid "Personal Page" msgstr "Persönliche Seite" -#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:472 +#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:473 msgid "Organisation Page" msgstr "Organisationsseite" -#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:479 +#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:480 msgid "News Page" msgstr "Nachrichtenseite" -#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:486 +#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:487 msgid "Community Forum" msgstr "Gemeinschaftsforum" @@ -4545,7 +4493,7 @@ msgstr "Auswahl aufheben" #: src/Module/Admin/Blocklist/Contact.php:101 #: src/Module/Admin/Users/Blocked.php:142 src/Module/Admin/Users/Index.php:156 -#: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Unblock" msgstr "Entsperren" @@ -4699,83 +4647,83 @@ msgstr "Warum werden Server die diesem Domainmuster entsprechen geblockt? Die Be #: src/Module/Admin/Blocklist/Server/Import.php:75 #: src/Module/Admin/Blocklist/Server/Import.php:84 msgid "Error importing pattern file" -msgstr "" +msgstr "Fehler beim Import der Muster Datei" #: src/Module/Admin/Blocklist/Server/Import.php:90 msgid "Local blocklist replaced with the provided file." -msgstr "" +msgstr "Lokale Blockliste wurde durch die bereitgestellte Datei ersetzt." #: src/Module/Admin/Blocklist/Server/Import.php:94 #, php-format msgid "%d pattern was added to the local blocklist." msgid_plural "%d patterns were added to the local blocklist." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%d Muster wurde zur lokalen Blockliste hinzugefügt." +msgstr[1] "%d Muster wurden zur lokalen Blockliste hinzugefügt." #: src/Module/Admin/Blocklist/Server/Import.php:96 msgid "No pattern was added to the local blocklist." -msgstr "" +msgstr "Kein Muster wurde zur lokalen Blockliste hinzugefügt." #: src/Module/Admin/Blocklist/Server/Import.php:118 msgid "Import a Server Domain Pattern Blocklist" -msgstr "" +msgstr "Server Domain Muster Blockliste importieren" #: src/Module/Admin/Blocklist/Server/Import.php:119 msgid "" "

This file can be downloaded from the /friendica path of any " "Friendica server.

" -msgstr "" +msgstr "

Diese Datei kann vom /friendica Pfad auf jedem Friendica Server heruntergeladen werden.

" #: src/Module/Admin/Blocklist/Server/Import.php:120 #: src/Module/Admin/Blocklist/Server/Index.php:104 msgid "Upload file" -msgstr "" +msgstr "Datei hochladen" #: src/Module/Admin/Blocklist/Server/Import.php:121 msgid "Patterns to import" -msgstr "" +msgstr "Zu importierende Muster" #: src/Module/Admin/Blocklist/Server/Import.php:122 msgid "Domain Pattern" -msgstr "" +msgstr "Domain Muster" #: src/Module/Admin/Blocklist/Server/Import.php:124 msgid "Import Mode" -msgstr "" +msgstr "Importmodus" #: src/Module/Admin/Blocklist/Server/Import.php:125 msgid "Import Patterns" -msgstr "" +msgstr "Muster importieren" #: src/Module/Admin/Blocklist/Server/Import.php:126 #, php-format msgid "%d total pattern" msgid_plural "%d total patterns" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%dMuster gesamt" +msgstr[1] "%dMuster gesamt" #: src/Module/Admin/Blocklist/Server/Import.php:128 #: src/Module/Admin/Blocklist/Server/Index.php:113 msgid "Server domain pattern blocklist CSV file" -msgstr "" +msgstr "Server Domain Muster Blockliste CSV-Datei" #: src/Module/Admin/Blocklist/Server/Import.php:129 msgid "Append" -msgstr "" +msgstr "Anhängen" #: src/Module/Admin/Blocklist/Server/Import.php:129 msgid "" "Imports patterns from the file that weren't already existing in the current " "blocklist." -msgstr "" +msgstr "Importiert Muster aus der Datei, die nicht bereits in der aktuellen Blockliste vorhanden waren." #: src/Module/Admin/Blocklist/Server/Import.php:130 msgid "Replace" -msgstr "" +msgstr "Ersetzen" #: src/Module/Admin/Blocklist/Server/Import.php:130 msgid "Replaces the current blocklist by the imported patterns." -msgstr "" +msgstr "Ersetzt die aktuelle Blockliste durch die importierten Muster." #: src/Module/Admin/Blocklist/Server/Index.php:84 #: src/Module/Admin/Blocklist/Server/Index.php:108 @@ -4815,7 +4763,7 @@ msgstr "Die Liste der blockierten Domain Muster wird auf der Seite ." +msgstr "Wenn du magst, kannst du unter den Benutzerdefinierte Theme-Einstellungen einstellen, dass diese Seite immer geöffnet wird, wenn du den \"Neuer Beitrag\" Button verwendest." + #: src/Module/Item/Follow.php:52 msgid "Unable to follow this item." msgstr "Konnte dem Beitrag nicht folgen." @@ -8471,7 +8401,7 @@ msgid "" "class=\"btn btn-sm pull-right\">Cancel" msgstr "Du betrachtest dein Profil gerade als %s Abbrechen" -#: src/Module/Profile/Profile.php:144 src/Module/Settings/Account.php:578 +#: src/Module/Profile/Profile.php:144 src/Module/Settings/Account.php:579 msgid "Full Name:" msgstr "Kompletter Name:" @@ -8487,17 +8417,17 @@ msgstr "j F, Y" msgid "j F" msgstr "j F" -#: src/Module/Profile/Profile.php:164 src/Util/Temporal.php:163 +#: src/Module/Profile/Profile.php:164 src/Util/Temporal.php:166 msgid "Birthday:" msgstr "Geburtstag:" #: src/Module/Profile/Profile.php:167 -#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:165 +#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:168 msgid "Age: " msgstr "Alter: " #: src/Module/Profile/Profile.php:167 -#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:165 +#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:168 #, php-format msgid "%d year old" msgid_plural "%d years old" @@ -8602,7 +8532,7 @@ msgid "Please repeat your e-mail address:" msgstr "Bitte wiederhole deine E-Mail Adresse" #: src/Module/Register.php:162 src/Module/Security/PasswordTooLong.php:97 -#: src/Module/Settings/Account.php:569 +#: src/Module/Settings/Account.php:570 msgid "New Password:" msgstr "Neues Passwort:" @@ -8611,7 +8541,7 @@ msgid "Leave empty for an auto generated password." msgstr "Leer lassen, um das Passwort automatisch zu generieren." #: src/Module/Register.php:163 src/Module/Security/PasswordTooLong.php:98 -#: src/Module/Settings/Account.php:570 +#: src/Module/Settings/Account.php:571 msgid "Confirm:" msgstr "Bestätigen:" @@ -8732,6 +8662,10 @@ msgstr "Solltest du das freie Soziale Netzwerk noch nicht benutzen, kannst du local " @@ -9098,89 +9032,89 @@ msgid "" " system settings." msgstr "Dein Profil wird im lokalen Verzeichnis dieses Knotens veröffentlicht. Je nach Systemeinstellungen kann es öffentlich auffindbar sein." -#: src/Module/Settings/Account.php:546 +#: src/Module/Settings/Account.php:547 #, php-format msgid "" "Your profile will also be published in the global friendica directories " "(e.g. %s)." msgstr "Dein Profil wird auch in den globalen Friendica Verzeichnissen (z.B. %s) veröffentlicht werden." -#: src/Module/Settings/Account.php:559 +#: src/Module/Settings/Account.php:560 msgid "Account Settings" msgstr "Kontoeinstellungen" -#: src/Module/Settings/Account.php:560 +#: src/Module/Settings/Account.php:561 #, php-format msgid "Your Identity Address is '%s' or '%s'." msgstr "Die Adresse deines Profils lautet '%s' oder '%s'." -#: src/Module/Settings/Account.php:568 +#: src/Module/Settings/Account.php:569 msgid "Password Settings" msgstr "Passwort-Einstellungen" -#: src/Module/Settings/Account.php:570 +#: src/Module/Settings/Account.php:571 msgid "Leave password fields blank unless changing" msgstr "Lass die Passwort-Felder leer, außer du willst das Passwort ändern" -#: src/Module/Settings/Account.php:572 +#: src/Module/Settings/Account.php:573 msgid "Password:" msgstr "Passwort:" -#: src/Module/Settings/Account.php:572 +#: src/Module/Settings/Account.php:573 msgid "Your current password to confirm the changes of the email address" msgstr "Dein aktuelles Passwort um die Änderungen deiner E-Mail Adresse zu bestätigen" -#: src/Module/Settings/Account.php:575 +#: src/Module/Settings/Account.php:576 msgid "Delete OpenID URL" msgstr "OpenID URL löschen" -#: src/Module/Settings/Account.php:577 +#: src/Module/Settings/Account.php:578 msgid "Basic Settings" msgstr "Grundeinstellungen" -#: src/Module/Settings/Account.php:579 +#: src/Module/Settings/Account.php:580 msgid "Email Address:" msgstr "E-Mail-Adresse:" -#: src/Module/Settings/Account.php:580 +#: src/Module/Settings/Account.php:581 msgid "Your Timezone:" msgstr "Deine Zeitzone:" -#: src/Module/Settings/Account.php:581 +#: src/Module/Settings/Account.php:582 msgid "Your Language:" msgstr "Deine Sprache:" -#: src/Module/Settings/Account.php:581 +#: src/Module/Settings/Account.php:582 msgid "" "Set the language we use to show you friendica interface and to send you " "emails" msgstr "Wähle die Sprache, in der wir dir die Friendica-Oberfläche präsentieren sollen und dir E-Mail schicken" -#: src/Module/Settings/Account.php:582 +#: src/Module/Settings/Account.php:583 msgid "Default Post Location:" msgstr "Standardstandort:" -#: src/Module/Settings/Account.php:583 +#: src/Module/Settings/Account.php:584 msgid "Use Browser Location:" msgstr "Standort des Browsers verwenden:" -#: src/Module/Settings/Account.php:585 +#: src/Module/Settings/Account.php:586 msgid "Security and Privacy Settings" msgstr "Sicherheits- und Privatsphäre-Einstellungen" -#: src/Module/Settings/Account.php:587 +#: src/Module/Settings/Account.php:588 msgid "Maximum Friend Requests/Day:" msgstr "Maximale Anzahl von Kontaktanfragen/Tag:" -#: src/Module/Settings/Account.php:587 src/Module/Settings/Account.php:597 +#: src/Module/Settings/Account.php:588 src/Module/Settings/Account.php:598 msgid "(to prevent spam abuse)" msgstr "(um SPAM zu vermeiden)" -#: src/Module/Settings/Account.php:589 +#: src/Module/Settings/Account.php:590 msgid "Allow your profile to be searchable globally?" msgstr "Darf dein Profil bei Suchanfragen gefunden werden?" -#: src/Module/Settings/Account.php:589 +#: src/Module/Settings/Account.php:590 msgid "" "Activate this setting if you want others to easily find and follow you. Your" " profile will be searchable on remote systems. This setting also determines " @@ -9188,43 +9122,43 @@ msgid "" "indexed or not." msgstr "Aktiviere diese Einstellung, wenn du von anderen einfach gefunden und gefolgt werden möchtest. Dei Profil wird dann auf anderen Systemen leicht durchsuchbar. Außerdem regelt diese Einstellung ob Friendica Suchmaschinen mitteilen soll, ob dein Profil indiziert werden soll oder nicht." -#: src/Module/Settings/Account.php:590 +#: src/Module/Settings/Account.php:591 msgid "Hide your contact/friend list from viewers of your profile?" msgstr "Liste der Kontakte vor Betrachtern des Profil verbergen?" -#: src/Module/Settings/Account.php:590 +#: src/Module/Settings/Account.php:591 msgid "" "A list of your contacts is displayed on your profile page. Activate this " "option to disable the display of your contact list." msgstr "Auf deiner Profilseite wird eine Liste deiner Kontakte angezeigt. Aktiviere diese Option wenn du das nicht möchtest." -#: src/Module/Settings/Account.php:591 +#: src/Module/Settings/Account.php:592 msgid "Hide your profile details from anonymous viewers?" msgstr "Profil-Details vor unbekannten Betrachtern verbergen?" -#: src/Module/Settings/Account.php:591 +#: src/Module/Settings/Account.php:592 msgid "" "Anonymous visitors will only see your profile picture, your display name and" " the nickname you are using on your profile page. Your public posts and " "replies will still be accessible by other means." msgstr "Anonyme Besucher deines Profils werden ausschließlich dein Profilbild, deinen Namen sowie deinen Spitznamen sehen. Deine öffentlichen Beiträge und Kommentare werden weiterhin sichtbar sein." -#: src/Module/Settings/Account.php:592 +#: src/Module/Settings/Account.php:593 msgid "Make public posts unlisted" msgstr "Öffentliche Beiträge nicht listen" -#: src/Module/Settings/Account.php:592 +#: src/Module/Settings/Account.php:593 msgid "" "Your public posts will not appear on the community pages or in search " "results, nor be sent to relay servers. However they can still appear on " "public feeds on remote servers." msgstr "Deine öffentlichen Beiträge werden nicht auf der Gemeinschaftsseite oder in den Suchergebnissen erscheinen, außerdem werden sie nicht an Relay-Server geschickt. Sie werden aber weiterhin in allen öffentlichen Feeds, auch auf entfernten Servern, erscheinen." -#: src/Module/Settings/Account.php:593 +#: src/Module/Settings/Account.php:594 msgid "Make all posted pictures accessible" msgstr "Alle geposteten Bilder zugreifbar machen" -#: src/Module/Settings/Account.php:593 +#: src/Module/Settings/Account.php:594 msgid "" "This option makes every posted picture accessible via the direct link. This " "is a workaround for the problem that most other networks can't handle " @@ -9232,131 +9166,127 @@ msgid "" "public on your photo albums though." msgstr "Diese Option macht jedes veröffentlichte Bild über den direkten Link zugänglich. Dies ist eine Problemumgehung für das Problem, dass die meisten anderen Netzwerke keine Berechtigungen für Bilder verarbeiten können. Nicht öffentliche Bilder sind in Ihren Fotoalben jedoch immer noch nicht für die Öffentlichkeit sichtbar." -#: src/Module/Settings/Account.php:594 +#: src/Module/Settings/Account.php:595 msgid "Allow friends to post to your profile page?" msgstr "Dürfen deine Kontakte auf deine Pinnwand schreiben?" -#: src/Module/Settings/Account.php:594 +#: src/Module/Settings/Account.php:595 msgid "" "Your contacts may write posts on your profile wall. These posts will be " "distributed to your contacts" msgstr "Deine Kontakte können Beiträge auf deiner Pinnwand hinterlassen. Diese werden an deine Kontakte verteilt." -#: src/Module/Settings/Account.php:595 +#: src/Module/Settings/Account.php:596 msgid "Allow friends to tag your posts?" msgstr "Dürfen deine Kontakte deine Beiträge mit Schlagwörtern versehen?" -#: src/Module/Settings/Account.php:595 +#: src/Module/Settings/Account.php:596 msgid "Your contacts can add additional tags to your posts." msgstr "Deine Kontakte dürfen deine Beiträge mit zusätzlichen Schlagworten versehen." -#: src/Module/Settings/Account.php:596 +#: src/Module/Settings/Account.php:597 msgid "Permit unknown people to send you private mail?" msgstr "Dürfen dir Unbekannte private Nachrichten schicken?" -#: src/Module/Settings/Account.php:596 +#: src/Module/Settings/Account.php:597 msgid "" "Friendica network users may send you private messages even if they are not " "in your contact list." msgstr "Nutzer des Friendica Netzwerks können dir private Nachrichten senden, selbst wenn sie nicht in deine Kontaktliste sind." -#: src/Module/Settings/Account.php:597 +#: src/Module/Settings/Account.php:598 msgid "Maximum private messages per day from unknown people:" msgstr "Maximale Anzahl privater Nachrichten von Unbekannten pro Tag:" -#: src/Module/Settings/Account.php:599 +#: src/Module/Settings/Account.php:600 msgid "Default Post Permissions" msgstr "Standard-Zugriffsrechte für Beiträge" -#: src/Module/Settings/Account.php:603 +#: src/Module/Settings/Account.php:604 msgid "Expiration settings" msgstr "Verfalls-Einstellungen" -#: src/Module/Settings/Account.php:604 +#: src/Module/Settings/Account.php:605 msgid "Automatically expire posts after this many days:" msgstr "Beiträge verfallen automatisch nach dieser Anzahl von Tagen:" -#: src/Module/Settings/Account.php:604 +#: src/Module/Settings/Account.php:605 msgid "If empty, posts will not expire. Expired posts will be deleted" msgstr "Wenn leer, verfallen Beiträge nie automatisch. Verfallene Beiträge werden gelöscht." -#: src/Module/Settings/Account.php:605 +#: src/Module/Settings/Account.php:606 msgid "Expire posts" msgstr "Beiträge verfallen lassen" -#: src/Module/Settings/Account.php:605 +#: src/Module/Settings/Account.php:606 msgid "When activated, posts and comments will be expired." msgstr "Ist dies aktiviert, werden Beiträge und Kommentare verfallen." -#: src/Module/Settings/Account.php:606 +#: src/Module/Settings/Account.php:607 msgid "Expire personal notes" msgstr "Persönliche Notizen verfallen lassen" -#: src/Module/Settings/Account.php:606 +#: src/Module/Settings/Account.php:607 msgid "" "When activated, the personal notes on your profile page will be expired." msgstr "Ist dies aktiviert, werden persönliche Notizen auf deiner Pinnwand verfallen." -#: src/Module/Settings/Account.php:607 +#: src/Module/Settings/Account.php:608 msgid "Expire starred posts" msgstr "Markierte Beiträge verfallen lassen" -#: src/Module/Settings/Account.php:607 +#: src/Module/Settings/Account.php:608 msgid "" "Starring posts keeps them from being expired. That behaviour is overwritten " "by this setting." msgstr "Markierte Beiträge verfallen eigentlich nicht. Mit dieser Option kannst du sie verfallen lassen." -#: src/Module/Settings/Account.php:608 +#: src/Module/Settings/Account.php:609 msgid "Only expire posts by others" msgstr "Nur Beiträge anderer verfallen lassen." -#: src/Module/Settings/Account.php:608 +#: src/Module/Settings/Account.php:609 msgid "" "When activated, your own posts never expire. Then the settings above are " "only valid for posts you received." msgstr "Wenn aktiviert werden deine eigenen Beiträge niemals verfallen. Die obigen Einstellungen betreffen dann ausschließlich die Beiträge von anderen Accounts." -#: src/Module/Settings/Account.php:611 +#: src/Module/Settings/Account.php:612 msgid "Notification Settings" msgstr "Benachrichtigungseinstellungen" -#: src/Module/Settings/Account.php:612 +#: src/Module/Settings/Account.php:613 msgid "Send a notification email when:" msgstr "Benachrichtigungs-E-Mail senden, wenn:" -#: src/Module/Settings/Account.php:613 +#: src/Module/Settings/Account.php:614 msgid "You receive an introduction" msgstr "– du eine Kontaktanfrage erhältst" -#: src/Module/Settings/Account.php:614 +#: src/Module/Settings/Account.php:615 msgid "Your introductions are confirmed" msgstr "– eine Deiner Kontaktanfragen akzeptiert wurde" -#: src/Module/Settings/Account.php:615 +#: src/Module/Settings/Account.php:616 msgid "Someone writes on your profile wall" msgstr "– jemand etwas auf Deine Pinnwand schreibt" -#: src/Module/Settings/Account.php:616 +#: src/Module/Settings/Account.php:617 msgid "Someone writes a followup comment" msgstr "– jemand auch einen Kommentar verfasst" -#: src/Module/Settings/Account.php:617 +#: src/Module/Settings/Account.php:618 msgid "You receive a private message" msgstr "– du eine private Nachricht erhältst" -#: src/Module/Settings/Account.php:618 +#: src/Module/Settings/Account.php:619 msgid "You receive a friend suggestion" msgstr "– du eine Empfehlung erhältst" -#: src/Module/Settings/Account.php:619 +#: src/Module/Settings/Account.php:620 msgid "You are tagged in a post" msgstr "– du in einem Beitrag erwähnt wirst" -#: src/Module/Settings/Account.php:620 -msgid "You are poked/prodded/etc. in a post" -msgstr "– du von jemandem angestupst oder sonstwie behandelt wirst" - #: src/Module/Settings/Account.php:622 msgid "Create a desktop notification when:" msgstr "Benachrichtigungen anzeigen wenn:" @@ -9553,121 +9483,121 @@ msgstr "Das gewählte Theme ist nicht verfügbar" msgid "%s - (Unsupported)" msgstr "%s - (Nicht unterstützt)" -#: src/Module/Settings/Display.php:192 +#: src/Module/Settings/Display.php:200 msgid "Display Settings" msgstr "Anzeige-Einstellungen" -#: src/Module/Settings/Display.php:194 +#: src/Module/Settings/Display.php:202 msgid "General Theme Settings" msgstr "Allgemeine Theme-Einstellungen" -#: src/Module/Settings/Display.php:195 +#: src/Module/Settings/Display.php:203 msgid "Custom Theme Settings" msgstr "Benutzerdefinierte Theme-Einstellungen" -#: src/Module/Settings/Display.php:196 +#: src/Module/Settings/Display.php:204 msgid "Content Settings" msgstr "Einstellungen zum Inhalt" -#: src/Module/Settings/Display.php:197 view/theme/duepuntozero/config.php:70 -#: view/theme/frio/config.php:161 view/theme/quattro/config.php:72 +#: src/Module/Settings/Display.php:205 view/theme/duepuntozero/config.php:70 +#: view/theme/frio/config.php:172 view/theme/quattro/config.php:72 #: view/theme/vier/config.php:120 msgid "Theme settings" msgstr "Theme-Einstellungen" -#: src/Module/Settings/Display.php:198 +#: src/Module/Settings/Display.php:206 msgid "Calendar" msgstr "Kalender" -#: src/Module/Settings/Display.php:204 +#: src/Module/Settings/Display.php:212 msgid "Display Theme:" msgstr "Theme:" -#: src/Module/Settings/Display.php:205 +#: src/Module/Settings/Display.php:213 msgid "Mobile Theme:" msgstr "Mobiles Theme" -#: src/Module/Settings/Display.php:208 +#: src/Module/Settings/Display.php:216 msgid "Number of items to display per page:" msgstr "Zahl der Beiträge, die pro Netzwerkseite angezeigt werden sollen: " -#: src/Module/Settings/Display.php:208 src/Module/Settings/Display.php:209 +#: src/Module/Settings/Display.php:216 src/Module/Settings/Display.php:217 msgid "Maximum of 100 items" msgstr "Maximal 100 Beiträge" -#: src/Module/Settings/Display.php:209 +#: src/Module/Settings/Display.php:217 msgid "Number of items to display per page when viewed from mobile device:" msgstr "Zahl der Beiträge, die pro Netzwerkseite auf mobilen Geräten angezeigt werden sollen:" -#: src/Module/Settings/Display.php:210 +#: src/Module/Settings/Display.php:218 msgid "Update browser every xx seconds" msgstr "Browser alle xx Sekunden aktualisieren" -#: src/Module/Settings/Display.php:210 +#: src/Module/Settings/Display.php:218 msgid "Minimum of 10 seconds. Enter -1 to disable it." msgstr "Minimum sind 10 Sekunden. Gib -1 ein, um abzuschalten." -#: src/Module/Settings/Display.php:211 +#: src/Module/Settings/Display.php:219 msgid "Automatic updates only at the top of the post stream pages" msgstr "Automatische Updates nur, wenn du oben auf den Beitragsstream-Seiten bist." -#: src/Module/Settings/Display.php:211 +#: src/Module/Settings/Display.php:219 msgid "" "Auto update may add new posts at the top of the post stream pages, which can" " affect the scroll position and perturb normal reading if it happens " "anywhere else the top of the page." msgstr "Das automatische Aktualisieren des Streams kann neue Beiträge am Anfang des Stream einfügen. Dies kann die angezeigte Position im Stream beeinflussen, wenn du gerade nicht den Anfang des Streams betrachtest." -#: src/Module/Settings/Display.php:212 +#: src/Module/Settings/Display.php:220 msgid "Display emoticons" msgstr "Zeige Emoticons" -#: src/Module/Settings/Display.php:212 +#: src/Module/Settings/Display.php:220 msgid "When enabled, emoticons are replaced with matching symbols." msgstr "Wenn dies aktiviert ist, werden Text-Emoticons in Beiträgen durch Symbole ersetzt." -#: src/Module/Settings/Display.php:213 +#: src/Module/Settings/Display.php:221 msgid "Infinite scroll" msgstr "Endloses Scrollen" -#: src/Module/Settings/Display.php:213 +#: src/Module/Settings/Display.php:221 msgid "Automatic fetch new items when reaching the page end." msgstr "Automatisch neue Beiträge laden, wenn das Ende der Seite erreicht ist." -#: src/Module/Settings/Display.php:214 +#: src/Module/Settings/Display.php:222 msgid "Enable Smart Threading" msgstr "Intelligentes Threading aktivieren" -#: src/Module/Settings/Display.php:214 +#: src/Module/Settings/Display.php:222 msgid "Enable the automatic suppression of extraneous thread indentation." msgstr "Schaltet das automatische Unterdrücken von überflüssigen Thread-Einrückungen ein." -#: src/Module/Settings/Display.php:215 +#: src/Module/Settings/Display.php:223 msgid "Display the Dislike feature" msgstr "Das \"Nicht-mögen\" Feature anzeigen" -#: src/Module/Settings/Display.php:215 +#: src/Module/Settings/Display.php:223 msgid "" "Display the Dislike button and dislike reactions on posts and comments." msgstr "Einen \"Ich mag das nicht\" Button und die dislike Reaktion auf Beiträge und Kommentare anzeigen." -#: src/Module/Settings/Display.php:216 +#: src/Module/Settings/Display.php:224 msgid "Display the resharer" msgstr "Teilenden anzeigen" -#: src/Module/Settings/Display.php:216 +#: src/Module/Settings/Display.php:224 msgid "Display the first resharer as icon and text on a reshared item." msgstr "Zeige das Profilbild des ersten Kontakts von dem ein Beitrag geteilt wurde." -#: src/Module/Settings/Display.php:217 +#: src/Module/Settings/Display.php:225 msgid "Stay local" msgstr "Bleib lokal" -#: src/Module/Settings/Display.php:217 +#: src/Module/Settings/Display.php:225 msgid "Don't go to a remote system when following a contact link." msgstr "Gehe nicht zu einem Remote-System, wenn einem Kontaktlink gefolgt wird" -#: src/Module/Settings/Display.php:219 +#: src/Module/Settings/Display.php:227 msgid "Beginning of week:" msgstr "Wochenbeginn:" @@ -9723,8 +9653,8 @@ msgstr "Profilbild" msgid "Location" msgstr "Wohnort" -#: src/Module/Settings/Profile/Index.php:230 src/Util/Temporal.php:93 -#: src/Util/Temporal.php:95 +#: src/Module/Settings/Profile/Index.php:230 src/Util/Temporal.php:95 +#: src/Util/Temporal.php:97 msgid "Miscellaneous" msgstr "Verschiedenes" @@ -10594,206 +10524,190 @@ msgstr "%1$s hat in der Unterhaltung von %3$s kommentiert" msgid "%1$s commented on your thread %2$s" msgstr "%1$s hat in deiner Unterhaltung %2$s kommentiert" -#: src/Navigation/Notifications/Repository/Notify.php:222 -#: src/Navigation/Notifications/Repository/Notify.php:736 +#: src/Navigation/Notifications/Repository/Notify.php:225 +#: src/Navigation/Notifications/Repository/Notify.php:721 msgid "[Friendica:Notify]" msgstr "[Friendica Meldung]" -#: src/Navigation/Notifications/Repository/Notify.php:286 +#: src/Navigation/Notifications/Repository/Notify.php:289 #, php-format msgid "%s New mail received at %s" msgstr "%sNeue Nachricht auf %s empfangen" -#: src/Navigation/Notifications/Repository/Notify.php:288 +#: src/Navigation/Notifications/Repository/Notify.php:291 #, php-format msgid "%1$s sent you a new private message at %2$s." msgstr "%1$s hat dir eine neue, private Nachricht auf %2$s geschickt." -#: src/Navigation/Notifications/Repository/Notify.php:289 +#: src/Navigation/Notifications/Repository/Notify.php:292 msgid "a private message" msgstr "eine private Nachricht" -#: src/Navigation/Notifications/Repository/Notify.php:289 +#: src/Navigation/Notifications/Repository/Notify.php:292 #, php-format msgid "%1$s sent you %2$s." msgstr "%1$s schickte dir %2$s." -#: src/Navigation/Notifications/Repository/Notify.php:291 +#: src/Navigation/Notifications/Repository/Notify.php:294 #, php-format msgid "Please visit %s to view and/or reply to your private messages." msgstr "Bitte besuche %s, um Deine privaten Nachrichten anzusehen und/oder zu beantworten." -#: src/Navigation/Notifications/Repository/Notify.php:321 +#: src/Navigation/Notifications/Repository/Notify.php:324 #, php-format msgid "%1$s commented on %2$s's %3$s %4$s" msgstr "%1$s kommentierte %2$s's %3$s%4$s" -#: src/Navigation/Notifications/Repository/Notify.php:326 +#: src/Navigation/Notifications/Repository/Notify.php:329 #, php-format msgid "%1$s commented on your %2$s %3$s" msgstr "%1$s kommentierte auf (%2$s) %3$s" -#: src/Navigation/Notifications/Repository/Notify.php:330 +#: src/Navigation/Notifications/Repository/Notify.php:333 #, php-format msgid "%1$s commented on their %2$s %3$s" msgstr "%1$s hat den eigenen %2$s %3$s kommentiert" -#: src/Navigation/Notifications/Repository/Notify.php:334 -#: src/Navigation/Notifications/Repository/Notify.php:770 +#: src/Navigation/Notifications/Repository/Notify.php:337 +#: src/Navigation/Notifications/Repository/Notify.php:755 #, php-format msgid "%1$s Comment to conversation #%2$d by %3$s" msgstr "%1$sKommentar von %3$s auf Unterhaltung %2$d" -#: src/Navigation/Notifications/Repository/Notify.php:336 +#: src/Navigation/Notifications/Repository/Notify.php:339 #, php-format msgid "%s commented on an item/conversation you have been following." msgstr "%s hat einen Beitrag kommentiert, dem du folgst." -#: src/Navigation/Notifications/Repository/Notify.php:340 -#: src/Navigation/Notifications/Repository/Notify.php:355 -#: src/Navigation/Notifications/Repository/Notify.php:374 -#: src/Navigation/Notifications/Repository/Notify.php:785 +#: src/Navigation/Notifications/Repository/Notify.php:343 +#: src/Navigation/Notifications/Repository/Notify.php:358 +#: src/Navigation/Notifications/Repository/Notify.php:770 #, php-format msgid "Please visit %s to view and/or reply to the conversation." msgstr "Bitte besuche %s, um die Konversation anzusehen und/oder zu kommentieren." -#: src/Navigation/Notifications/Repository/Notify.php:347 +#: src/Navigation/Notifications/Repository/Notify.php:350 #, php-format msgid "%s %s posted to your profile wall" msgstr "%s%s hat auf deine Pinnwand gepostet" -#: src/Navigation/Notifications/Repository/Notify.php:349 +#: src/Navigation/Notifications/Repository/Notify.php:352 #, php-format msgid "%1$s posted to your profile wall at %2$s" msgstr "%1$s schrieb um %2$s auf Deine Pinnwand" -#: src/Navigation/Notifications/Repository/Notify.php:350 +#: src/Navigation/Notifications/Repository/Notify.php:353 #, php-format msgid "%1$s posted to [url=%2$s]your wall[/url]" msgstr "%1$s hat etwas auf [url=%2$s]Deiner Pinnwand[/url] gepostet" -#: src/Navigation/Notifications/Repository/Notify.php:362 -#, php-format -msgid "%1$s %2$s poked you" -msgstr "%1$s%2$shat dich angestubst" - -#: src/Navigation/Notifications/Repository/Notify.php:364 -#, php-format -msgid "%1$s poked you at %2$s" -msgstr "%1$s hat dich auf %2$s angestupst" - -#: src/Navigation/Notifications/Repository/Notify.php:365 -#, php-format -msgid "%1$s [url=%2$s]poked you[/url]." -msgstr "%1$s [url=%2$s]hat dich angestupst[/url]." - -#: src/Navigation/Notifications/Repository/Notify.php:382 +#: src/Navigation/Notifications/Repository/Notify.php:366 #, php-format msgid "%s Introduction received" msgstr "%sVorstellung erhalten" -#: src/Navigation/Notifications/Repository/Notify.php:384 +#: src/Navigation/Notifications/Repository/Notify.php:368 #, php-format msgid "You've received an introduction from '%1$s' at %2$s" msgstr "Du hast eine Kontaktanfrage von '%1$s' auf %2$s erhalten" -#: src/Navigation/Notifications/Repository/Notify.php:385 +#: src/Navigation/Notifications/Repository/Notify.php:369 #, php-format msgid "You've received [url=%1$s]an introduction[/url] from %2$s." msgstr "Du hast eine [url=%1$s]Kontaktanfrage[/url] von %2$s erhalten." -#: src/Navigation/Notifications/Repository/Notify.php:390 -#: src/Navigation/Notifications/Repository/Notify.php:436 +#: src/Navigation/Notifications/Repository/Notify.php:374 +#: src/Navigation/Notifications/Repository/Notify.php:420 #, php-format msgid "You may visit their profile at %s" msgstr "Hier kannst du das Profil betrachten: %s" -#: src/Navigation/Notifications/Repository/Notify.php:392 +#: src/Navigation/Notifications/Repository/Notify.php:376 #, php-format msgid "Please visit %s to approve or reject the introduction." msgstr "Bitte besuche %s, um die Kontaktanfrage anzunehmen oder abzulehnen." -#: src/Navigation/Notifications/Repository/Notify.php:399 +#: src/Navigation/Notifications/Repository/Notify.php:383 #, php-format msgid "%s A new person is sharing with you" msgstr "%sEine neue Person teilt nun mit dir" -#: src/Navigation/Notifications/Repository/Notify.php:401 -#: src/Navigation/Notifications/Repository/Notify.php:402 +#: src/Navigation/Notifications/Repository/Notify.php:385 +#: src/Navigation/Notifications/Repository/Notify.php:386 #, php-format msgid "%1$s is sharing with you at %2$s" msgstr "%1$s teilt mit dir auf %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:409 +#: src/Navigation/Notifications/Repository/Notify.php:393 #, php-format msgid "%s You have a new follower" msgstr "%sDu hast einen neuen Kontakt" -#: src/Navigation/Notifications/Repository/Notify.php:411 -#: src/Navigation/Notifications/Repository/Notify.php:412 +#: src/Navigation/Notifications/Repository/Notify.php:395 +#: src/Navigation/Notifications/Repository/Notify.php:396 #, php-format msgid "You have a new follower at %2$s : %1$s" msgstr "Du hast einen neuen Kontakt auf %2$s: %1$s" -#: src/Navigation/Notifications/Repository/Notify.php:425 +#: src/Navigation/Notifications/Repository/Notify.php:409 #, php-format msgid "%s Friend suggestion received" msgstr "%sKontaktvorschlag erhalten" -#: src/Navigation/Notifications/Repository/Notify.php:427 +#: src/Navigation/Notifications/Repository/Notify.php:411 #, php-format msgid "You've received a friend suggestion from '%1$s' at %2$s" msgstr "Du hast einen Kontakt-Vorschlag von '%1$s' auf %2$s erhalten" -#: src/Navigation/Notifications/Repository/Notify.php:428 +#: src/Navigation/Notifications/Repository/Notify.php:412 #, php-format msgid "" "You've received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s." msgstr "Du hast einen [url=%1$s]Kontakt-Vorschlag[/url] %2$s von %3$s erhalten." -#: src/Navigation/Notifications/Repository/Notify.php:434 +#: src/Navigation/Notifications/Repository/Notify.php:418 msgid "Name:" msgstr "Name:" -#: src/Navigation/Notifications/Repository/Notify.php:435 +#: src/Navigation/Notifications/Repository/Notify.php:419 msgid "Photo:" msgstr "Foto:" -#: src/Navigation/Notifications/Repository/Notify.php:438 +#: src/Navigation/Notifications/Repository/Notify.php:422 #, php-format msgid "Please visit %s to approve or reject the suggestion." msgstr "Bitte besuche %s, um den Vorschlag zu akzeptieren oder abzulehnen." -#: src/Navigation/Notifications/Repository/Notify.php:446 -#: src/Navigation/Notifications/Repository/Notify.php:461 +#: src/Navigation/Notifications/Repository/Notify.php:430 +#: src/Navigation/Notifications/Repository/Notify.php:445 #, php-format msgid "%s Connection accepted" msgstr "%sKontaktanfrage bestätigt" -#: src/Navigation/Notifications/Repository/Notify.php:448 -#: src/Navigation/Notifications/Repository/Notify.php:463 +#: src/Navigation/Notifications/Repository/Notify.php:432 +#: src/Navigation/Notifications/Repository/Notify.php:447 #, php-format msgid "'%1$s' has accepted your connection request at %2$s" msgstr "'%1$s' hat Deine Kontaktanfrage auf %2$s bestätigt" -#: src/Navigation/Notifications/Repository/Notify.php:449 -#: src/Navigation/Notifications/Repository/Notify.php:464 +#: src/Navigation/Notifications/Repository/Notify.php:433 +#: src/Navigation/Notifications/Repository/Notify.php:448 #, php-format msgid "%2$s has accepted your [url=%1$s]connection request[/url]." msgstr "%2$s hat Deine [url=%1$s]Kontaktanfrage[/url] akzeptiert." -#: src/Navigation/Notifications/Repository/Notify.php:454 +#: src/Navigation/Notifications/Repository/Notify.php:438 msgid "" "You are now mutual friends and may exchange status updates, photos, and " "email without restriction." msgstr "Ihr seid nun beidseitige Kontakte und könnt Statusmitteilungen, Bilder und E-Mails ohne Einschränkungen austauschen." -#: src/Navigation/Notifications/Repository/Notify.php:456 +#: src/Navigation/Notifications/Repository/Notify.php:440 #, php-format msgid "Please visit %s if you wish to make any changes to this relationship." msgstr "Bitte besuche %s, wenn du Änderungen an eurer Beziehung vornehmen willst." -#: src/Navigation/Notifications/Repository/Notify.php:469 +#: src/Navigation/Notifications/Repository/Notify.php:453 #, php-format msgid "" "'%1$s' has chosen to accept you a fan, which restricts some forms of " @@ -10802,33 +10716,33 @@ msgid "" "automatically." msgstr "'%1$s' hat sich entschieden dich als Fan zu akzeptieren, dies schränkt einige Kommunikationswege - wie private Nachrichten und einige Interaktionsmöglichkeiten auf der Profilseite - ein. Wenn dies eine Berühmtheiten- oder Gemeinschaftsseite ist, werden diese Einstellungen automatisch vorgenommen." -#: src/Navigation/Notifications/Repository/Notify.php:471 +#: src/Navigation/Notifications/Repository/Notify.php:455 #, php-format msgid "" "'%1$s' may choose to extend this into a two-way or more permissive " "relationship in the future." msgstr "'%1$s' kann den Kontaktstatus zu einem späteren Zeitpunkt erweitern und diese Einschränkungen aufheben. " -#: src/Navigation/Notifications/Repository/Notify.php:473 +#: src/Navigation/Notifications/Repository/Notify.php:457 #, php-format msgid "Please visit %s if you wish to make any changes to this relationship." msgstr "Bitte besuche %s, wenn du Änderungen an eurer Beziehung vornehmen willst." -#: src/Navigation/Notifications/Repository/Notify.php:483 +#: src/Navigation/Notifications/Repository/Notify.php:467 msgid "registration request" msgstr "Registrierungsanfrage" -#: src/Navigation/Notifications/Repository/Notify.php:485 +#: src/Navigation/Notifications/Repository/Notify.php:469 #, php-format msgid "You've received a registration request from '%1$s' at %2$s" msgstr "Du hast eine Registrierungsanfrage von %2$s auf '%1$s' erhalten" -#: src/Navigation/Notifications/Repository/Notify.php:486 +#: src/Navigation/Notifications/Repository/Notify.php:470 #, php-format msgid "You've received a [url=%1$s]registration request[/url] from %2$s." msgstr "Du hast eine [url=%1$s]Registrierungsanfrage[/url] von %2$s erhalten." -#: src/Navigation/Notifications/Repository/Notify.php:491 +#: src/Navigation/Notifications/Repository/Notify.php:475 #, php-format msgid "" "Full Name:\t%s\n" @@ -10836,17 +10750,17 @@ msgid "" "Login Name:\t%s (%s)" msgstr "Kompletter Name: %s\nURL der Seite: %s\nLogin Name: %s(%s)" -#: src/Navigation/Notifications/Repository/Notify.php:497 +#: src/Navigation/Notifications/Repository/Notify.php:481 #, php-format msgid "Please visit %s to approve or reject the request." msgstr "Bitte besuche %s, um die Anfrage zu bearbeiten." -#: src/Navigation/Notifications/Repository/Notify.php:764 +#: src/Navigation/Notifications/Repository/Notify.php:749 #, php-format msgid "%s %s tagged you" msgstr "%s %s hat dich erwähnt" -#: src/Navigation/Notifications/Repository/Notify.php:767 +#: src/Navigation/Notifications/Repository/Notify.php:752 #, php-format msgid "%s %s shared a new post" msgstr "%s%shat einen Beitrag geteilt" @@ -11076,28 +10990,28 @@ msgstr "Zeige mehr" msgid "Show fewer" msgstr "Zeige weniger" -#: src/Protocol/OStatus.php:1475 +#: src/Protocol/OStatus.php:1471 #, php-format msgid "%s is now following %s." msgstr "%s folgt nun %s" -#: src/Protocol/OStatus.php:1476 +#: src/Protocol/OStatus.php:1472 msgid "following" msgstr "folgen" -#: src/Protocol/OStatus.php:1479 +#: src/Protocol/OStatus.php:1475 #, php-format msgid "%s stopped following %s." msgstr "%s hat aufgehört %s, zu folgen" -#: src/Protocol/OStatus.php:1480 +#: src/Protocol/OStatus.php:1476 msgid "stopped following" msgstr "wird nicht mehr gefolgt" -#: src/Render/FriendicaSmartyEngine.php:53 +#: src/Render/FriendicaSmartyEngine.php:56 #, php-format msgid "The folder %s must be writable by webserver." -msgstr "" +msgstr "Das Verzeichnis %s muss für den Web-Server beschreibbar sein." #: src/Security/Authentication.php:226 msgid "Login failed." @@ -11139,86 +11053,86 @@ msgstr "der Administrator von %s" msgid "thanks" msgstr "danke" -#: src/Util/Temporal.php:167 +#: src/Util/Temporal.php:170 msgid "YYYY-MM-DD or MM-DD" msgstr "YYYY-MM-DD oder MM-DD" -#: src/Util/Temporal.php:275 +#: src/Util/Temporal.php:278 #, php-format msgid "Time zone: %s Change in Settings" msgstr "Zeitzone: %s Änderbar in den Einstellungen" -#: src/Util/Temporal.php:318 +#: src/Util/Temporal.php:321 msgid "never" msgstr "nie" -#: src/Util/Temporal.php:325 +#: src/Util/Temporal.php:328 msgid "less than a second ago" msgstr "vor weniger als einer Sekunde" -#: src/Util/Temporal.php:333 +#: src/Util/Temporal.php:337 msgid "year" msgstr "Jahr" -#: src/Util/Temporal.php:333 +#: src/Util/Temporal.php:337 msgid "years" msgstr "Jahre" -#: src/Util/Temporal.php:334 +#: src/Util/Temporal.php:338 msgid "months" msgstr "Monate" -#: src/Util/Temporal.php:335 +#: src/Util/Temporal.php:339 msgid "weeks" msgstr "Wochen" -#: src/Util/Temporal.php:336 +#: src/Util/Temporal.php:340 msgid "days" msgstr "Tage" -#: src/Util/Temporal.php:337 +#: src/Util/Temporal.php:341 msgid "hour" msgstr "Stunde" -#: src/Util/Temporal.php:337 +#: src/Util/Temporal.php:341 msgid "hours" msgstr "Stunden" -#: src/Util/Temporal.php:338 +#: src/Util/Temporal.php:342 msgid "minute" msgstr "Minute" -#: src/Util/Temporal.php:338 +#: src/Util/Temporal.php:342 msgid "minutes" msgstr "Minuten" -#: src/Util/Temporal.php:339 +#: src/Util/Temporal.php:343 msgid "second" msgstr "Sekunde" -#: src/Util/Temporal.php:339 +#: src/Util/Temporal.php:343 msgid "seconds" msgstr "Sekunden" -#: src/Util/Temporal.php:349 +#: src/Util/Temporal.php:353 #, php-format msgid "in %1$d %2$s" msgstr "in %1$d %2$s" -#: src/Util/Temporal.php:352 +#: src/Util/Temporal.php:356 #, php-format msgid "%1$d %2$s ago" msgstr "%1$d %2$s her" -#: src/Worker/Delivery.php:525 +#: src/Worker/Delivery.php:524 msgid "(no subject)" msgstr "(kein Betreff)" -#: src/Worker/PushSubscription.php:111 +#: src/Worker/PushSubscription.php:110 msgid "Notification from Friendica" msgstr "Benachrichtigung von Friendica" -#: src/Worker/PushSubscription.php:112 +#: src/Worker/PushSubscription.php:111 msgid "Empty Post" msgstr "Leerer Beitrag" @@ -11254,113 +11168,124 @@ msgstr "slackr" msgid "Variations" msgstr "Variationen" -#: view/theme/frio/config.php:142 +#: view/theme/frio/config.php:153 msgid "Light (Accented)" msgstr "Hell (Akzentuiert)" -#: view/theme/frio/config.php:143 +#: view/theme/frio/config.php:154 msgid "Dark (Accented)" msgstr "Dunkel (Akzentuiert)" -#: view/theme/frio/config.php:144 +#: view/theme/frio/config.php:155 msgid "Black (Accented)" msgstr "Schwarz (Akzentuiert)" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Note" msgstr "Hinweis" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Check image permissions if all users are allowed to see the image" msgstr "Überprüfe, dass alle Benutzer die Berechtigung haben dieses Bild anzusehen" -#: view/theme/frio/config.php:162 +#: view/theme/frio/config.php:173 msgid "Custom" msgstr "Benutzerdefiniert" -#: view/theme/frio/config.php:163 +#: view/theme/frio/config.php:174 msgid "Legacy" msgstr "Vermächtnis" -#: view/theme/frio/config.php:164 +#: view/theme/frio/config.php:175 msgid "Accented" msgstr "Akzentuiert" -#: view/theme/frio/config.php:165 +#: view/theme/frio/config.php:176 msgid "Select color scheme" msgstr "Farbschema auswählen" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Select scheme accent" msgstr "Wähle einen Akzent für das Thema" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Blue" msgstr "Blau" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Red" msgstr "Rot" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Purple" msgstr "Violett" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Green" msgstr "Grün" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Pink" msgstr "Rosa" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "Copy or paste schemestring" msgstr "Farbschema kopieren oder einfügen" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "" "You can copy this string to share your theme with others. Pasting here " "applies the schemestring" msgstr "Du kannst den String mit den Farbschema Informationen mit anderen Teilen. Wenn du einen neuen Farbschema-String hier einfügst wird er für deine Einstellungen übernommen." -#: view/theme/frio/config.php:168 +#: view/theme/frio/config.php:179 msgid "Navigation bar background color" msgstr "Hintergrundfarbe der Navigationsleiste" -#: view/theme/frio/config.php:169 +#: view/theme/frio/config.php:180 msgid "Navigation bar icon color " msgstr "Icon Farbe in der Navigationsleiste" -#: view/theme/frio/config.php:170 +#: view/theme/frio/config.php:181 msgid "Link color" msgstr "Linkfarbe" -#: view/theme/frio/config.php:171 +#: view/theme/frio/config.php:182 msgid "Set the background color" msgstr "Hintergrundfarbe festlegen" -#: view/theme/frio/config.php:172 +#: view/theme/frio/config.php:183 msgid "Content background opacity" msgstr "Opazität des Hintergrunds von Beiträgen" -#: view/theme/frio/config.php:173 +#: view/theme/frio/config.php:184 msgid "Set the background image" msgstr "Hintergrundbild festlegen" -#: view/theme/frio/config.php:174 +#: view/theme/frio/config.php:185 msgid "Background image style" msgstr "Stil des Hintergrundbildes" -#: view/theme/frio/config.php:179 +#: view/theme/frio/config.php:188 +msgid "Always open Compose page" +msgstr "Immer die Composer Seite öffnen" + +#: view/theme/frio/config.php:188 +msgid "" +"The New Post button always open the Compose page " +"instead of the modal form. When this is disabled, the Compose page can be " +"accessed with a middle click on the link or from the modal." +msgstr "Neue Beiträge werden immer in der Composer Seite anstelle des Dialoges bearbeitet. Ist diese Option deaktiviert, kann die Composer Seite durch einen Klick mit der mittleren Maustaste geöffnet werden." + +#: view/theme/frio/config.php:192 msgid "Login page background image" msgstr "Hintergrundbild der Login-Seite" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Login page background color" msgstr "Hintergrundfarbe der Login-Seite" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Leave background image and color empty for theme defaults" msgstr "Wenn die Theme-Vorgaben verwendet werden sollen, lass bitte die Felder für die Hintergrundfarbe und das Hintergrundbild leer." @@ -11408,11 +11333,11 @@ msgstr "Zum Inhalt der Seite gehen" msgid "Back to top" msgstr "Zurück nach Oben" -#: view/theme/frio/theme.php:212 +#: view/theme/frio/theme.php:218 msgid "Guest" msgstr "Gast" -#: view/theme/frio/theme.php:215 +#: view/theme/frio/theme.php:221 msgid "Visitor" msgstr "Besucher" diff --git a/view/lang/de/strings.php b/view/lang/de/strings.php index 8375f7b03..69508c34e 100644 --- a/view/lang/de/strings.php +++ b/view/lang/de/strings.php @@ -521,12 +521,17 @@ $a->strings['You subscribed to one or more tags in this post.'] = 'Du folgst ein $a->strings['Reshared'] = 'Geteilt'; $a->strings['Reshared by %s <%s>'] = 'Geteilt von %s <%s>'; $a->strings['%s is participating in this thread.'] = '%s ist an der Unterhaltung beteiligt.'; +$a->strings['Stored for general reasons'] = 'Aus allgemeinen Gründen aufbewahrt'; $a->strings['Global post'] = 'Globaler Beitrag'; $a->strings['Sent via an relay server'] = 'Über einen Relay-Server gesendet'; $a->strings['Sent via the relay server %s <%s>'] = 'Über den Relay-Server %s <%s> gesendet'; $a->strings['Fetched'] = 'Abgerufen'; $a->strings['Fetched because of %s <%s>'] = 'Wegen %s <%s> abgerufen'; +$a->strings['Stored because of a child post to complete this thread.'] = 'Gespeichert wegen eines untergeordneten Beitrags zur Vervollständigung dieses Themas.'; $a->strings['Local delivery'] = 'Lokale Zustellung'; +$a->strings['Stored because of your activity (like, comment, star, ...)'] = 'Gespeichert aufgrund Ihrer Aktivität (Like, Kommentar, Stern, ...)'; +$a->strings['Distributed'] = 'Verteilt'; +$a->strings['Pushed to us'] = 'Zu uns gepusht'; $a->strings['General Features'] = 'Allgemeine Features'; $a->strings['Photo Location'] = 'Aufnahmeort'; $a->strings['Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'] = 'Die Foto-Metadaten werden ausgelesen. Dadurch kann der Aufnahmeort (wenn vorhanden) in einer Karte angezeigt werden.'; @@ -553,7 +558,6 @@ $a->strings['Forums'] = 'Foren'; $a->strings['External link to forum'] = 'Externer Link zum Forum'; $a->strings['show less'] = 'weniger anzeigen'; $a->strings['show more'] = 'mehr anzeigen'; -$a->strings['%1$s poked %2$s'] = '%1$s stupste %2$s'; $a->strings['event'] = 'Veranstaltung'; $a->strings['Follow Thread'] = 'Folge der Unterhaltung'; $a->strings['View Status'] = 'Status anschauen'; @@ -565,7 +569,6 @@ $a->strings['Send PM'] = 'Private Nachricht senden'; $a->strings['Block'] = 'Sperren'; $a->strings['Ignore'] = 'Ignorieren'; $a->strings['Languages'] = 'Sprachen'; -$a->strings['Poke'] = 'Anstupsen'; $a->strings['Nothing new here'] = 'Keine Neuigkeiten'; $a->strings['Go back'] = 'Geh zurück'; $a->strings['Clear notifications'] = 'Bereinige Benachrichtigungen'; @@ -812,18 +815,6 @@ $a->strings['Sep'] = 'Sep'; $a->strings['Oct'] = 'Okt'; $a->strings['Nov'] = 'Nov'; $a->strings['Dec'] = 'Dez'; -$a->strings['poke'] = 'anstupsen'; -$a->strings['poked'] = 'stupste'; -$a->strings['ping'] = 'anpingen'; -$a->strings['pinged'] = 'pingte'; -$a->strings['prod'] = 'knuffen'; -$a->strings['prodded'] = 'knuffte'; -$a->strings['slap'] = 'ohrfeigen'; -$a->strings['slapped'] = 'ohrfeigte'; -$a->strings['finger'] = 'befummeln'; -$a->strings['fingered'] = 'befummelte'; -$a->strings['rebuff'] = 'eine Abfuhr erteilen'; -$a->strings['rebuffed'] = 'abfuhrerteilte'; $a->strings['Friendica can\'t display this page at the moment, please contact the administrator.'] = 'Friendica kann die Seite im Moment nicht darstellen. Bitte kontaktiere das Administratoren Team.'; $a->strings['template engine cannot be registered without a name.'] = 'Die Template Engine kann nicht ohne einen Namen registriert werden.'; $a->strings['template engine is not registered!'] = 'Template Engine wurde nicht registriert!'; @@ -1247,6 +1238,29 @@ $a->strings['Also purges all the locally stored content authored by the known co ]; $a->strings['Block reason'] = 'Begründung der Blockierung'; $a->strings['The reason why you blocked this server domain pattern. This reason will be shown publicly in the server information page.'] = 'Warum werden Server die diesem Domainmuster entsprechen geblockt? Die Begründung wird öffentlich auf der Server-Informationsseite sichtbar sein.'; +$a->strings['Error importing pattern file'] = 'Fehler beim Import der Muster Datei'; +$a->strings['Local blocklist replaced with the provided file.'] = 'Lokale Blockliste wurde durch die bereitgestellte Datei ersetzt.'; +$a->strings['%d pattern was added to the local blocklist.'] = [ + 0 => '%d Muster wurde zur lokalen Blockliste hinzugefügt.', + 1 => '%d Muster wurden zur lokalen Blockliste hinzugefügt.', +]; +$a->strings['No pattern was added to the local blocklist.'] = 'Kein Muster wurde zur lokalen Blockliste hinzugefügt.'; +$a->strings['Import a Server Domain Pattern Blocklist'] = 'Server Domain Muster Blockliste importieren'; +$a->strings['

This file can be downloaded from the /friendica path of any Friendica server.

'] = '

Diese Datei kann vom /friendica Pfad auf jedem Friendica Server heruntergeladen werden.

'; +$a->strings['Upload file'] = 'Datei hochladen'; +$a->strings['Patterns to import'] = 'Zu importierende Muster'; +$a->strings['Domain Pattern'] = 'Domain Muster'; +$a->strings['Import Mode'] = 'Importmodus'; +$a->strings['Import Patterns'] = 'Muster importieren'; +$a->strings['%d total pattern'] = [ + 0 => '%dMuster gesamt', + 1 => '%dMuster gesamt', +]; +$a->strings['Server domain pattern blocklist CSV file'] = 'Server Domain Muster Blockliste CSV-Datei'; +$a->strings['Append'] = 'Anhängen'; +$a->strings['Imports patterns from the file that weren\'t already existing in the current blocklist.'] = 'Importiert Muster aus der Datei, die nicht bereits in der aktuellen Blockliste vorhanden waren.'; +$a->strings['Replace'] = 'Ersetzen'; +$a->strings['Replaces the current blocklist by the imported patterns.'] = 'Ersetzt die aktuelle Blockliste durch die importierten Muster.'; $a->strings['Blocked server domain pattern'] = 'Blockierte Server Domain Muster'; $a->strings['Reason for the block'] = 'Begründung für die Blockierung'; $a->strings['Delete server domain pattern'] = 'Server Domain Muster löschen'; @@ -1254,6 +1268,7 @@ $a->strings['Check to delete this entry from the blocklist'] = 'Markieren, um di $a->strings['Server Domain Pattern Blocklist'] = 'Server Domain Muster Blockliste'; $a->strings['This page can be used to define a blocklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'] = 'Auf dieser Seite kannst du Muster definieren mit denen Server Domains aus dem föderierten Netzwerk daran gehindert werden mit deiner Instanz zu interagieren. Es ist ratsam für jedes Muster anzugeben, warum du es zur Blockliste hinzugefügt hast.'; $a->strings['The list of blocked server domain patterns will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'] = 'Die Liste der blockierten Domain Muster wird auf der Seite /friendica öffentlich einsehbar gemacht, damit deine Nutzer und Personen, die Kommunikationsprobleme erkunden, die Ursachen einfach finden können.'; +$a->strings['Import server domain pattern blocklist'] = 'Server Domain Muster Blockliste importieren'; $a->strings['Add new entry to the blocklist'] = 'Neuen Eintrag in die Blockliste'; $a->strings['Save changes to the blocklist'] = 'Änderungen der Blockliste speichern'; $a->strings['Current Entries in the Blocklist'] = 'Aktuelle Einträge der Blockliste'; @@ -1276,8 +1291,40 @@ $a->strings['Lock feature %s'] = 'Feature festlegen: %s'; $a->strings['Manage Additional Features'] = 'Zusätzliche Features Verwalten'; $a->strings['Other'] = 'Andere'; $a->strings['unknown'] = 'Unbekannt'; +$a->strings['%2$s total system'] = [ + 0 => '%2$sServer gesamt', + 1 => '%2$s Server gesamt', +]; +$a->strings['%2$s active user last month'] = [ + 0 => '%2$s aktiver Nutzer im letzten Monat', + 1 => '%2$s aktive Nutzer im letzten Monat', +]; +$a->strings['%2$s active user last six months'] = [ + 0 => '%2$s aktive Nutzer im letzten halben Jahr', + 1 => '%2$s aktive Nutzer im letzten halben Jahr', +]; +$a->strings['%2$s registered user'] = [ + 0 => '%2$sregistrierter Nutzer', + 1 => '%2$s registrierte Nutzer', +]; +$a->strings['%2$s locally created post or comment'] = [ + 0 => '%2$slokal erstellter Beitrag oder Kommentar', + 1 => '%2$slokal erstellte Beiträge und Kommentare', +]; +$a->strings['%2$s post per user'] = [ + 0 => '%2$sBeitrag pro Nutzer', + 1 => '%2$sBeiträge pro Nutzer', +]; +$a->strings['%2$s user per system'] = [ + 0 => '%2$sNutzer pro System', + 1 => '%2$sNutzer pro System', +]; $a->strings['This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.'] = 'Diese Seite präsentiert einige Zahlen zu dem bekannten Teil des föderalen sozialen Netzwerks, von dem deine Friendica Installation ein Teil ist. Diese Zahlen sind nicht absolut und reflektieren nur den Teil des Netzwerks, den dein Knoten kennt.'; $a->strings['Federation Statistics'] = 'Föderation Statistik'; +$a->strings['Currently this node is aware of %2$s node (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:'] = [ + 0 => 'Derzeit kennt dieser Knoten %2$s andere Knoten (mit %3$s aktiven Nutzern im letzten Monat, %4$s aktiven Nutzern im letzten halben Jahr, %5$s registrierten Nutzern insgesamt) von den folgenden Plattformen:', + 1 => 'Derzeit kennt dieser Knoten %2$s andere Knoten (mit %3$s aktiven Nutzern im letzten Monat, %4$s aktiven Nutzern im letzten halben Jahr, %5$s registrierten Nutzern insgesamt) von den folgenden Plattformen:', +]; $a->strings['Item marked for deletion.'] = 'Eintrag wurden zur Löschung markiert'; $a->strings['Delete Item'] = 'Eintrag löschen'; $a->strings['Delete this Item'] = 'Diesen Eintrag löschen'; @@ -1509,6 +1556,8 @@ $a->strings['Temp path'] = 'Temp-Pfad'; $a->strings['If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.'] = 'Solltest du ein eingeschränktes System haben, auf dem der Webserver nicht auf das temp-Verzeichnis des Systems zugreifen kann, setze hier einen anderen Pfad.'; $a->strings['Only search in tags'] = 'Nur in Tags suchen'; $a->strings['On large systems the text search can slow down the system extremely.'] = 'Auf großen Knoten kann die Volltext-Suche das System ausbremsen.'; +$a->strings['Generate counts per contact group when calculating network count'] = 'Erstelle Zählungen je Kontaktgruppe bei der Berechnung der Netzwerkanzahl'; +$a->strings['On systems with users that heavily use contact groups the query can be very expensive.'] = 'Auf Systemen mit Benutzern, die häufig Kontaktgruppen verwenden, kann die Abfrage sehr aufwändig sein.'; $a->strings['Maximum number of parallel workers'] = 'Maximale Anzahl parallel laufender Worker'; $a->strings['On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.'] = 'Wenn dein Knoten bei einem Shared Hoster ist, setze diesen Wert auf %d. Auf größeren Systemen funktioniert ein Wert von %d recht gut. Standardeinstellung sind %d.'; $a->strings['Enable fastlane'] = 'Aktiviere Fastlane'; @@ -1680,6 +1729,10 @@ $a->strings['Weekly posting limit of %d post reached. The post was rejected.'] = 0 => 'Das wöchentliche Limit von %d Beitrag wurde erreicht. Die Nachricht wurde verworfen.', 1 => 'Das wöchentliche Limit von %d Beiträgen wurde erreicht. Der Beitrag wurde verworfen.', ]; +$a->strings['Monthly posting limit of %d post reached. The post was rejected.'] = [ + 0 => 'Das monatliche Limit von %d Beitrag wurde erreicht. Der Beitrag wurde verworfen.', + 1 => 'Das monatliche Limit von %d Beiträgen wurde erreicht. Der Beitrag wurde verworfen.', +]; $a->strings['Profile Details'] = 'Profildetails'; $a->strings['Only You Can See This'] = 'Nur du kannst das sehen'; $a->strings['Scheduled Posts'] = 'Geplante Beiträge'; @@ -1757,12 +1810,6 @@ $a->strings['Contact (%s)'] = [ 0 => 'Kontakt (%s)', 1 => 'Kontakte (%s)', ]; -$a->strings['Error while sending poke, please retry.'] = 'Beim Versenden des Stupsers ist ein Fehler aufgetreten. Bitte erneut versuchen.'; -$a->strings['You must be logged in to use this module.'] = 'Du musst eingeloggt sein, um dieses Modul benutzen zu können.'; -$a->strings['Poke/Prod'] = 'Anstupsen'; -$a->strings['poke, prod or do other things to somebody'] = 'Stupse Leute an oder mache anderes mit ihnen'; -$a->strings['Choose what you wish to do to recipient'] = 'Was willst du mit dem Empfänger machen:'; -$a->strings['Make this post private'] = 'Diesen Beitrag privat machen'; $a->strings['Failed to update contact record.'] = 'Aktualisierung der Kontaktdaten fehlgeschlagen.'; $a->strings['Contact has been unblocked'] = 'Kontakt wurde wieder freigegeben'; $a->strings['Contact has been blocked'] = 'Kontakt wurde blockiert'; @@ -1822,6 +1869,7 @@ $a->strings['Contact is being deleted.'] = 'Kontakt wurde gelöscht.'; $a->strings['Follow was successfully revoked.'] = 'Folgen wurde erfolgreich widerrufen.'; $a->strings['Do you really want to revoke this contact\'s follow? This cannot be undone and they will have to manually follow you back again.'] = 'Willst du das Folgen dieses Kontakt wirklich widerrufen? Dies kann nicht rückgängig gemacht werden und der Kontakt muss Ihnen manuell wieder folgen.'; $a->strings['Yes'] = 'Ja'; +$a->strings['This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.'] = 'Diese Gemeinschaftsseite zeigt alle öffentlichen Beiträge, die auf diesem Knoten eingegangen sind. Der Inhalt entspricht nicht zwingend der Meinung der Nutzer dieses Servers.'; $a->strings['Local Community'] = 'Lokale Gemeinschaft'; $a->strings['Posts from local users on this server'] = 'Beiträge von Nutzern dieses Servers'; $a->strings['Global Community'] = 'Globale Gemeinschaft'; @@ -1830,7 +1878,6 @@ $a->strings['Own Contacts'] = 'Eigene Kontakte'; $a->strings['Include'] = 'Einschließen'; $a->strings['Hide'] = 'Verbergen'; $a->strings['No results.'] = 'Keine Ergebnisse.'; -$a->strings['This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.'] = 'Diese Gemeinschaftsseite zeigt alle öffentlichen Beiträge, die auf diesem Knoten eingegangen sind. Der Inhalt entspricht nicht zwingend der Meinung der Nutzer dieses Servers.'; $a->strings['Community option not available.'] = 'Optionen für die Gemeinschaftsseite nicht verfügbar.'; $a->strings['Not available.'] = 'Nicht verfügbar.'; $a->strings['No such group'] = 'Es gibt keine solche Gruppe'; @@ -1919,8 +1966,8 @@ $a->strings['No entries (some entries may be hidden).'] = 'Keine Einträge (eini $a->strings['Find on this site'] = 'Auf diesem Server suchen'; $a->strings['Results for:'] = 'Ergebnisse für:'; $a->strings['Site Directory'] = 'Verzeichnis'; -$a->strings['Item was not removed'] = 'Item wurde nicht entfernt'; $a->strings['Item was not deleted'] = 'Item wurde nicht gelöscht'; +$a->strings['Item was not removed'] = 'Item wurde nicht entfernt'; $a->strings['- select -'] = '- auswählen -'; $a->strings['Suggested contact not found.'] = 'Vorgeschlagener Kontakt wurde nicht gefunden.'; $a->strings['Friend suggestion sent.'] = 'Kontaktvorschlag gesendet.'; @@ -1930,6 +1977,7 @@ $a->strings['Installed addons/apps:'] = 'Installierte Apps und Addons'; $a->strings['No installed addons/apps'] = 'Es sind keine Addons oder Apps installiert'; $a->strings['Read about the Terms of Service of this node.'] = 'Erfahre mehr über die Nutzungsbedingungen dieses Knotens.'; $a->strings['On this server the following remote servers are blocked.'] = 'Auf diesem Server werden die folgenden, entfernten Server blockiert.'; +$a->strings['Download this list in CSV format'] = 'Liste im CSV-Format herunterladen'; $a->strings['This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.'] = 'Diese Friendica-Instanz verwendet die Version %s, sie ist unter der folgenden Adresse im Web zu finden %s. Die Datenbankversion ist %s und die Post-Update-Version %s.'; $a->strings['Please visit Friendi.ca to learn more about the Friendica project.'] = 'Bitte besuche Friendi.ca, um mehr über das Friendica-Projekt zu erfahren.'; $a->strings['Bug reports and issues: please visit'] = 'Probleme oder Fehler gefunden? Bitte besuche'; @@ -2022,6 +2070,7 @@ $a->strings['Visibility'] = 'Sichtbarkeit'; $a->strings['Clear the location'] = 'Ort löschen'; $a->strings['Location services are unavailable on your device'] = 'Ortungsdienste sind auf Ihrem Gerät nicht verfügbar'; $a->strings['Location services are disabled. Please check the website\'s permissions on your device'] = 'Ortungsdienste sind deaktiviert. Bitte überprüfe die Berechtigungen der Website auf deinem Gerät'; +$a->strings['You can make this page always open when you use the New Post button in the Theme Customization settings.'] = 'Wenn du magst, kannst du unter den Benutzerdefinierte Theme-Einstellungen einstellen, dass diese Seite immer geöffnet wird, wenn du den "Neuer Beitrag" Button verwendest.'; $a->strings['Unable to follow this item.'] = 'Konnte dem Beitrag nicht folgen.'; $a->strings['System down for maintenance'] = 'System zur Wartung abgeschaltet'; $a->strings['This Friendica node is currently in maintenance mode, either automatically because it is self-updating or manually by the node administrator. This condition should be temporary, please come back in a few minutes.'] = 'Diese Friendica Instanz befindet sich derzeit im Wartungsmodus, entweder aufgrund von automatischen Updateprozessen oder weil die Administratoren der Instanz den Wartungsmodus aktiviert haben. Dies sollte ein vorübergehender Zustand sein. Bitte versuche es in ein paar Minuten erneut.'; @@ -2135,6 +2184,7 @@ $a->strings['Friend/Connection Request'] = 'Kontaktanfrage'; $a->strings['Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system, you have to subscribe to %s or %s directly on your system.'] = 'Gib entweder deine Webfinger- (user@domain.tld) oder die Profil-Adresse an. Wenn dies von deinem System nicht unterstützt wird, folge bitte %s oder %s direkt von deinem System. '; $a->strings['If you are not yet a member of the free social web, follow this link to find a public Friendica node and join us today.'] = 'Solltest du das freie Soziale Netzwerk noch nicht benutzen, kannst du diesem Link folgen um eine öffentliche Friendica Instanz zu finden um noch heute dem Netzwerk beizutreten.'; $a->strings['Your Webfinger address or profile URL:'] = 'Deine Webfinger Adresse oder Profil-URL'; +$a->strings['You must be logged in to use this module.'] = 'Du musst eingeloggt sein, um dieses Modul benutzen zu können.'; $a->strings['Only logged in users are permitted to perform a search.'] = 'Nur eingeloggten Benutzern ist das Suchen gestattet.'; $a->strings['Only one search per minute is permitted for not logged in users.'] = 'Es ist nur eine Suchanfrage pro Minute für nicht eingeloggte Benutzer gestattet.'; $a->strings['Items tagged with: %s'] = 'Beiträge, die mit %s getaggt sind'; @@ -2157,8 +2207,10 @@ $a->strings['OpenID protocol error. No ID returned'] = 'OpenID Protokollfehler. $a->strings['Account not found. Please login to your existing account to add the OpenID to it.'] = 'Nutzerkonto nicht gefunden. Bitte melde dich an und füge die OpenID zu deinem Konto hinzu.'; $a->strings['Account not found. Please register a new account or login to your existing account to add the OpenID to it.'] = 'Nutzerkonto nicht gefunden. Bitte registriere ein neues Konto oder melde dich mit einem existierendem Konto an um diene OpenID hinzuzufügen.'; $a->strings['Passwords do not match.'] = 'Die Passwörter stimmen nicht überein.'; +$a->strings['Password does not need changing.'] = 'Passwort muss nicht geändert werden.'; $a->strings['Password unchanged.'] = 'Passwort unverändert.'; $a->strings['Password Too Long'] = 'Passwort ist zu lang'; +$a->strings['Since version 2022.09, we\'ve realized that any password longer than 72 characters is truncated during hashing. To prevent any confusion about this behavior, please update your password to be fewer or equal to 72 characters.'] = 'Mit der Version 2022.09 haben wir festgestellt, dass jedes Passwort, das länger als 72 Zeichen ist, beim Hashing abgeschnitten wird. Um Verwirrung über dieses Verhalten zu vermeiden, aktualisieren Sie Ihr Passwort bitte so, dass es höchstens 72 Zeichen hat.'; $a->strings['Update Password'] = 'Passwort aktualisieren'; $a->strings['Current Password:'] = 'Aktuelles Passwort:'; $a->strings['Your current password to confirm the changes'] = 'Dein aktuelles Passwort um die Änderungen zu bestätigen'; @@ -2267,7 +2319,6 @@ $a->strings['Someone writes a followup comment'] = '– jemand auch einen Kommen $a->strings['You receive a private message'] = '– du eine private Nachricht erhältst'; $a->strings['You receive a friend suggestion'] = '– du eine Empfehlung erhältst'; $a->strings['You are tagged in a post'] = '– du in einem Beitrag erwähnt wirst'; -$a->strings['You are poked/prodded/etc. in a post'] = '– du von jemandem angestupst oder sonstwie behandelt wirst'; $a->strings['Create a desktop notification when:'] = 'Benachrichtigungen anzeigen wenn:'; $a->strings['Someone tagged you'] = 'Dich jemand erwähnt'; $a->strings['Someone directly commented on your post'] = 'Jemand einen Beitrag von dir kommentiert hat'; @@ -2580,9 +2631,6 @@ $a->strings['Please visit %s to view and/or reply to the conversation.'] = 'Bitt $a->strings['%s %s posted to your profile wall'] = '%s%s hat auf deine Pinnwand gepostet'; $a->strings['%1$s posted to your profile wall at %2$s'] = '%1$s schrieb um %2$s auf Deine Pinnwand'; $a->strings['%1$s posted to [url=%2$s]your wall[/url]'] = '%1$s hat etwas auf [url=%2$s]Deiner Pinnwand[/url] gepostet'; -$a->strings['%1$s %2$s poked you'] = '%1$s%2$shat dich angestubst'; -$a->strings['%1$s poked you at %2$s'] = '%1$s hat dich auf %2$s angestupst'; -$a->strings['%1$s [url=%2$s]poked you[/url].'] = '%1$s [url=%2$s]hat dich angestupst[/url].'; $a->strings['%s Introduction received'] = '%sVorstellung erhalten'; $a->strings['You\'ve received an introduction from \'%1$s\' at %2$s'] = 'Du hast eine Kontaktanfrage von \'%1$s\' auf %2$s erhalten'; $a->strings['You\'ve received [url=%1$s]an introduction[/url] from %2$s.'] = 'Du hast eine [url=%1$s]Kontaktanfrage[/url] von %2$s erhalten.'; @@ -2677,6 +2725,7 @@ $a->strings['%s is now following %s.'] = '%s folgt nun %s'; $a->strings['following'] = 'folgen'; $a->strings['%s stopped following %s.'] = '%s hat aufgehört %s, zu folgen'; $a->strings['stopped following'] = 'wird nicht mehr gefolgt'; +$a->strings['The folder %s must be writable by webserver.'] = 'Das Verzeichnis %s muss für den Web-Server beschreibbar sein.'; $a->strings['Login failed.'] = 'Anmeldung fehlgeschlagen.'; $a->strings['Login failed. Please check your credentials.'] = 'Anmeldung fehlgeschlagen. Bitte überprüfe deine Angaben.'; $a->strings['Welcome %s'] = 'Willkommen %s'; @@ -2737,6 +2786,8 @@ $a->strings['Set the background color'] = 'Hintergrundfarbe festlegen'; $a->strings['Content background opacity'] = 'Opazität des Hintergrunds von Beiträgen'; $a->strings['Set the background image'] = 'Hintergrundbild festlegen'; $a->strings['Background image style'] = 'Stil des Hintergrundbildes'; +$a->strings['Always open Compose page'] = 'Immer die Composer Seite öffnen'; +$a->strings['The New Post button always open the Compose page instead of the modal form. When this is disabled, the Compose page can be accessed with a middle click on the link or from the modal.'] = 'Neue Beiträge werden immer in der Composer Seite anstelle des Dialoges bearbeitet. Ist diese Option deaktiviert, kann die Composer Seite durch einen Klick mit der mittleren Maustaste geöffnet werden.'; $a->strings['Login page background image'] = 'Hintergrundbild der Login-Seite'; $a->strings['Login page background color'] = 'Hintergrundfarbe der Login-Seite'; $a->strings['Leave background image and color empty for theme defaults'] = 'Wenn die Theme-Vorgaben verwendet werden sollen, lass bitte die Felder für die Hintergrundfarbe und das Hintergrundbild leer.'; From 9bac8153aef970c76d1720e4fda629ef95e02b68 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 09:24:32 +0000 Subject: [PATCH 041/641] Some more constants are moved to their specific classes --- boot.php | 17 ----------- src/Content/Nav.php | 5 ++-- src/Core/Update.php | 8 +++-- src/Module/Admin/Site.php | 14 ++++----- src/Module/Api/GNUSocial/GNUSocial/Config.php | 1 - src/Module/Conversation/Community.php | 29 ++++++++++++++----- 6 files changed, 36 insertions(+), 38 deletions(-) diff --git a/boot.php b/boot.php index b90c1fb2e..6b078f7c9 100644 --- a/boot.php +++ b/boot.php @@ -32,8 +32,6 @@ use Friendica\Model\Contact; define('FRIENDICA_PLATFORM', 'Friendica'); define('FRIENDICA_CODENAME', 'Giant Rhubarb'); define('FRIENDICA_VERSION', '2022.12-dev'); -define('DFRN_PROTOCOL_VERSION', '2.23'); -define('NEW_TABLE_STRUCTURE_VERSION', 1288); /** * Constant with a HTML line break. @@ -44,21 +42,6 @@ define('NEW_TABLE_STRUCTURE_VERSION', 1288); */ define('EOL', "
\r\n"); -/** - * @name CP - * - * Type of the community page - * @{ - */ -define('CP_NO_INTERNAL_COMMUNITY', -2); -define('CP_NO_COMMUNITY_PAGE', -1); -define('CP_USERS_ON_SERVER', 0); -define('CP_GLOBAL_COMMUNITY', 1); -define('CP_USERS_AND_GLOBAL', 2); -/** - * @} - */ - /** * @name Gravity * diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 77f068863..6861d69e8 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -30,6 +30,7 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Profile; use Friendica\Model\User; +use Friendica\Module\Conversation\Community; class Nav { @@ -251,8 +252,8 @@ class Nav } } - if ((local_user() || DI::config()->get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) && - !(DI::config()->get('system', 'community_page_style') == CP_NO_INTERNAL_COMMUNITY)) { + if ((local_user() || DI::config()->get('system', 'community_page_style') != Community::DISABLED_VISITOR) && + !(DI::config()->get('system', 'community_page_style') == Community::DISABLED)) { $nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')]; } diff --git a/src/Core/Update.php b/src/Core/Update.php index ad5b31760..5f4251720 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -35,6 +35,8 @@ class Update const SUCCESS = 0; const FAILED = 1; + const NEW_TABLE_STRUCTURE_VERSION = 1288; + /** * Function to check if the Database structure needs an update. * @@ -63,7 +65,7 @@ class Update } // We don't support upgrading from very old versions anymore - if ($build < NEW_TABLE_STRUCTURE_VERSION) { + if ($build < self::NEW_TABLE_STRUCTURE_VERSION) { $error = DI::l10n()->t('Updates from version %s are not supported. Please update at least to version 2021.01 and wait until the postupdate finished version 1383.', $build); if (DI::mode()->getExecutor() == Mode::INDEX) { die($error); @@ -73,8 +75,8 @@ class Update } // The postupdate has to completed version 1288 for the new post views to take over - $postupdate = DI::config()->get('system', 'post_update_version', NEW_TABLE_STRUCTURE_VERSION); - if ($postupdate < NEW_TABLE_STRUCTURE_VERSION) { + $postupdate = DI::config()->get('system', 'post_update_version', self::NEW_TABLE_STRUCTURE_VERSION); + if ($postupdate < self::NEW_TABLE_STRUCTURE_VERSION) { $error = DI::l10n()->t('Updates from postupdate version %s are not supported. Please update at least to version 2021.01 and wait until the postupdate finished version 1383.', $postupdate); if (DI::mode()->getExecutor() == Mode::INDEX) { die($error); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 37d8ed040..011e3c411 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -22,7 +22,6 @@ namespace Friendica\Module\Admin; use Friendica\App; -use Friendica\Core\Relocate; use Friendica\Core\Renderer; use Friendica\Core\Search; use Friendica\Core\System; @@ -33,12 +32,11 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\User; use Friendica\Module\BaseAdmin; +use Friendica\Module\Conversation\Community; use Friendica\Module\Register; use Friendica\Protocol\Relay; use Friendica\Util\BasePath; use Friendica\Util\EMailer\MailBuilder; -use Friendica\Util\Strings; -use Friendica\Worker\Delivery; require_once __DIR__ . '/../../../boot.php'; @@ -364,11 +362,11 @@ class Site extends BaseAdmin /* Community page style */ $community_page_style_choices = [ - CP_NO_INTERNAL_COMMUNITY => DI::l10n()->t('No community page for local users'), - CP_NO_COMMUNITY_PAGE => DI::l10n()->t('No community page'), - CP_USERS_ON_SERVER => DI::l10n()->t('Public postings from users of this site'), - CP_GLOBAL_COMMUNITY => DI::l10n()->t('Public postings from the federated network'), - CP_USERS_AND_GLOBAL => DI::l10n()->t('Public postings from local users and the federated network') + Community::DISABLED => DI::l10n()->t('No community page'), + Community::DISABLED_VISITOR => DI::l10n()->t('No community page for visitors'), + Community::LOCAL => DI::l10n()->t('Public postings from users of this site'), + Community::GLOBAL => DI::l10n()->t('Public postings from the federated network'), + Community::LOCAL_AND_GLOBAL => DI::l10n()->t('Public postings from local users and the federated network') ]; /* get user names to make the install a personal install of X */ diff --git a/src/Module/Api/GNUSocial/GNUSocial/Config.php b/src/Module/Api/GNUSocial/GNUSocial/Config.php index b0325f47a..75c70ce06 100644 --- a/src/Module/Api/GNUSocial/GNUSocial/Config.php +++ b/src/Module/Api/GNUSocial/GNUSocial/Config.php @@ -55,7 +55,6 @@ class Config extends BaseApi 'friendica' => [ 'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM, 'FRIENDICA_VERSION' => FRIENDICA_VERSION, - 'DFRN_PROTOCOL_VERSION' => DFRN_PROTOCOL_VERSION, 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION, ] ], diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php index 8d73f825f..3ba95e1ef 100644 --- a/src/Module/Conversation/Community.php +++ b/src/Module/Conversation/Community.php @@ -40,6 +40,21 @@ use Friendica\Network\HTTPException; class Community extends BaseModule { + /** + * @name CP + * + * Type of the community page + * @{ + */ + const DISABLED = -2; + const DISABLED_VISITOR = -1; + const LOCAL = 0; + const GLOBAL = 1; + const LOCAL_AND_GLOBAL = 2; + /** + * @} + */ + protected static $page_style; protected static $content; protected static $accountTypeString; @@ -69,7 +84,7 @@ class Community extends BaseModule if (empty($_GET['mode']) || ($_GET['mode'] != 'raw')) { $tabs = []; - if ((Session::isAuthenticated() || in_array(self::$page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(DI::config()->get('system', 'singleuser'))) { + if ((Session::isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::LOCAL])) && empty(DI::config()->get('system', 'singleuser'))) { $tabs[] = [ 'label' => DI::l10n()->t('Local Community'), 'url' => 'community/local', @@ -80,7 +95,7 @@ class Community extends BaseModule ]; } - if (Session::isAuthenticated() || in_array(self::$page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) { + if (Session::isAuthenticated() || in_array(self::$page_style, [self::LOCAL_AND_GLOBAL, self::GLOBAL])) { $tabs[] = [ 'label' => DI::l10n()->t('Global Community'), 'url' => 'community/global', @@ -177,7 +192,7 @@ class Community extends BaseModule self::$page_style = DI::config()->get('system', 'community_page_style'); - if (self::$page_style == CP_NO_INTERNAL_COMMUNITY) { + if (self::$page_style == self::DISABLED) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.')); } @@ -191,7 +206,7 @@ class Community extends BaseModule self::$content = 'global'; } else { // When only the global community is allowed, we use this as default - self::$content = self::$page_style == CP_GLOBAL_COMMUNITY ? 'global' : 'local'; + self::$content = self::$page_style == self::GLOBAL ? 'global' : 'local'; } } @@ -201,14 +216,14 @@ class Community extends BaseModule // Check if we are allowed to display the content to visitors if (!Session::isAuthenticated()) { - $available = self::$page_style == CP_USERS_AND_GLOBAL; + $available = self::$page_style == self::LOCAL_AND_GLOBAL; if (!$available) { - $available = (self::$page_style == CP_USERS_ON_SERVER) && (self::$content == 'local'); + $available = (self::$page_style == self::LOCAL) && (self::$content == 'local'); } if (!$available) { - $available = (self::$page_style == CP_GLOBAL_COMMUNITY) && (self::$content == 'global'); + $available = (self::$page_style == self::GLOBAL) && (self::$content == 'global'); } if (!$available) { From b1de40cb423660fefc08b541dd8bc6930158f697 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 09:33:29 +0000 Subject: [PATCH 042/641] Updated messages.po --- view/lang/C/messages.po | 620 ++++++++++++++++++++-------------------- 1 file changed, 310 insertions(+), 310 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index eed528689..33b83ca21 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-16 12:38-0400\n" +"POT-Creation-Date: 2022-10-17 09:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" #: mod/cal.php:46 mod/cal.php:50 mod/follow.php:39 mod/redir.php:36 -#: mod/redir.php:177 src/Module/Conversation/Community.php:181 +#: mod/redir.php:177 src/Module/Conversation/Community.php:196 #: src/Module/Debug/ItemBody.php:38 src/Module/Diaspora/Receive.php:57 #: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:41 #: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57 @@ -43,8 +43,8 @@ msgstr "" msgid "Access to this profile has been restricted." msgstr "" -#: mod/cal.php:243 mod/events.php:374 src/Content/Nav.php:196 -#: src/Content/Nav.php:260 src/Module/BaseProfile.php:84 +#: mod/cal.php:243 mod/events.php:374 src/Content/Nav.php:197 +#: src/Content/Nav.php:261 src/Module/BaseProfile.php:84 #: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:240 #: view/theme/frio/theme.php:244 msgid "Events" @@ -105,7 +105,7 @@ msgid "calendar" msgstr "" #: mod/display.php:143 mod/photos.php:802 -#: src/Module/Conversation/Community.php:175 src/Module/Directory.php:49 +#: src/Module/Conversation/Community.php:190 src/Module/Directory.php:49 #: src/Module/Search/Index.php:65 msgid "Public access denied." msgstr "" @@ -119,7 +119,7 @@ msgid "The feed for this item is unavailable." msgstr "" #: mod/editpost.php:38 mod/events.php:217 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:181 mod/item.php:186 mod/item.php:865 mod/message.php:69 +#: mod/item.php:182 mod/item.php:187 mod/item.php:866 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:33 #: mod/photos.php:160 mod/photos.php:891 mod/repair_ostatus.php:31 #: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156 @@ -426,7 +426,7 @@ msgstr "" msgid "Basic" msgstr "" -#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:477 +#: mod/events.php:517 src/Module/Admin/Site.php:439 src/Module/Contact.php:477 #: src/Module/Profile/Profile.php:249 msgid "Advanced" msgstr "" @@ -435,7 +435,7 @@ msgstr "" msgid "Failed to remove event" msgstr "" -#: mod/fbrowser.php:61 src/Content/Nav.php:194 src/Module/BaseProfile.php:64 +#: mod/fbrowser.php:61 src/Content/Nav.php:195 src/Module/BaseProfile.php:64 #: view/theme/frio/theme.php:238 msgid "Photos" msgstr "" @@ -515,27 +515,27 @@ msgstr "" msgid "The contact could not be added." msgstr "" -#: mod/item.php:131 mod/item.php:135 +#: mod/item.php:132 mod/item.php:136 msgid "Unable to locate original post." msgstr "" -#: mod/item.php:337 mod/item.php:342 +#: mod/item.php:338 mod/item.php:343 msgid "Empty post discarded." msgstr "" -#: mod/item.php:677 +#: mod/item.php:678 msgid "Post updated." msgstr "" -#: mod/item.php:687 mod/item.php:692 +#: mod/item.php:688 mod/item.php:693 msgid "Item wasn't stored." msgstr "" -#: mod/item.php:703 +#: mod/item.php:704 msgid "Item couldn't be fetched." msgstr "" -#: mod/item.php:843 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:844 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 #: src/Module/Debug/ItemBody.php:57 msgid "Item not found." @@ -691,7 +691,7 @@ msgstr "" msgid "Profile Match" msgstr "" -#: mod/message.php:46 mod/message.php:126 src/Content/Nav.php:288 +#: mod/message.php:46 mod/message.php:126 src/Content/Nav.php:289 msgid "New Message" msgstr "" @@ -717,7 +717,7 @@ msgstr "" msgid "Discard" msgstr "" -#: mod/message.php:133 src/Content/Nav.php:285 view/theme/frio/theme.php:245 +#: mod/message.php:133 src/Content/Nav.php:286 view/theme/frio/theme.php:245 msgid "Messages" msgstr "" @@ -1191,7 +1191,7 @@ msgstr "" msgid "Name" msgstr "" -#: mod/settings.php:177 src/Content/Nav.php:214 +#: mod/settings.php:177 src/Content/Nav.php:215 msgid "Home Page" msgstr "" @@ -1206,7 +1206,7 @@ msgstr "" #: mod/settings.php:205 mod/settings.php:237 mod/settings.php:268 #: mod/settings.php:352 src/Module/Admin/Addons/Index.php:69 #: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:81 -#: src/Module/Admin/Site.php:436 src/Module/Admin/Themes/Index.php:113 +#: src/Module/Admin/Site.php:434 src/Module/Admin/Themes/Index.php:113 #: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:563 #: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:201 msgid "Save Settings" @@ -1389,7 +1389,7 @@ msgstr "" msgid "Action after import:" msgstr "" -#: mod/settings.php:350 src/Content/Nav.php:282 +#: mod/settings.php:350 src/Content/Nav.php:283 msgid "Mark as seen" msgstr "" @@ -2274,7 +2274,7 @@ msgstr "" msgid "Display membership date in profile" msgstr "" -#: src/Content/ForumManager.php:151 src/Content/Nav.php:241 +#: src/Content/ForumManager.php:151 src/Content/Nav.php:242 #: src/Content/Text/HTML.php:903 src/Content/Widget.php:524 msgid "Forums" msgstr "" @@ -2347,101 +2347,101 @@ msgstr "" msgid "Languages" msgstr "" -#: src/Content/Nav.php:90 +#: src/Content/Nav.php:91 msgid "Nothing new here" msgstr "" -#: src/Content/Nav.php:94 src/Module/Special/HTTPException.php:50 +#: src/Content/Nav.php:95 src/Module/Special/HTTPException.php:50 msgid "Go back" msgstr "" -#: src/Content/Nav.php:95 +#: src/Content/Nav.php:96 msgid "Clear notifications" msgstr "" -#: src/Content/Nav.php:96 src/Content/Text/HTML.php:890 +#: src/Content/Nav.php:97 src/Content/Text/HTML.php:890 msgid "@name, !forum, #tags, content" msgstr "" -#: src/Content/Nav.php:185 src/Module/Security/Login.php:158 +#: src/Content/Nav.php:186 src/Module/Security/Login.php:158 msgid "Logout" msgstr "" -#: src/Content/Nav.php:185 +#: src/Content/Nav.php:186 msgid "End this session" msgstr "" -#: src/Content/Nav.php:187 src/Module/Bookmarklet.php:44 +#: src/Content/Nav.php:188 src/Module/Bookmarklet.php:44 #: src/Module/Security/Login.php:159 msgid "Login" msgstr "" -#: src/Content/Nav.php:187 +#: src/Content/Nav.php:188 msgid "Sign in" msgstr "" -#: src/Content/Nav.php:192 src/Module/BaseProfile.php:56 +#: src/Content/Nav.php:193 src/Module/BaseProfile.php:56 #: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380 #: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:236 msgid "Status" msgstr "" -#: src/Content/Nav.php:192 src/Content/Nav.php:275 +#: src/Content/Nav.php:193 src/Content/Nav.php:276 #: view/theme/frio/theme.php:236 msgid "Your posts and conversations" msgstr "" -#: src/Content/Nav.php:193 src/Module/BaseProfile.php:48 +#: src/Content/Nav.php:194 src/Module/BaseProfile.php:48 #: src/Module/BaseSettings.php:55 src/Module/Contact.php:460 #: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:241 #: src/Module/Welcome.php:57 view/theme/frio/theme.php:237 msgid "Profile" msgstr "" -#: src/Content/Nav.php:193 view/theme/frio/theme.php:237 +#: src/Content/Nav.php:194 view/theme/frio/theme.php:237 msgid "Your profile page" msgstr "" -#: src/Content/Nav.php:194 view/theme/frio/theme.php:238 +#: src/Content/Nav.php:195 view/theme/frio/theme.php:238 msgid "Your photos" msgstr "" -#: src/Content/Nav.php:195 src/Module/BaseProfile.php:72 +#: src/Content/Nav.php:196 src/Module/BaseProfile.php:72 #: src/Module/BaseProfile.php:75 src/Module/Contact.php:452 #: view/theme/frio/theme.php:239 msgid "Media" msgstr "" -#: src/Content/Nav.php:195 view/theme/frio/theme.php:239 +#: src/Content/Nav.php:196 view/theme/frio/theme.php:239 msgid "Your postings with media" msgstr "" -#: src/Content/Nav.php:196 view/theme/frio/theme.php:240 +#: src/Content/Nav.php:197 view/theme/frio/theme.php:240 msgid "Your events" msgstr "" -#: src/Content/Nav.php:197 +#: src/Content/Nav.php:198 msgid "Personal notes" msgstr "" -#: src/Content/Nav.php:197 +#: src/Content/Nav.php:198 msgid "Your personal notes" msgstr "" -#: src/Content/Nav.php:214 src/Content/Nav.php:275 +#: src/Content/Nav.php:215 src/Content/Nav.php:276 msgid "Home" msgstr "" -#: src/Content/Nav.php:218 src/Module/Register.php:168 +#: src/Content/Nav.php:219 src/Module/Register.php:168 #: src/Module/Security/Login.php:124 msgid "Register" msgstr "" -#: src/Content/Nav.php:218 +#: src/Content/Nav.php:219 msgid "Create an account" msgstr "" -#: src/Content/Nav.php:224 src/Module/Help.php:67 +#: src/Content/Nav.php:225 src/Module/Help.php:67 #: src/Module/Settings/TwoFactor/AppSpecific.php:127 #: src/Module/Settings/TwoFactor/Index.php:119 #: src/Module/Settings/TwoFactor/Recovery.php:105 @@ -2449,158 +2449,158 @@ msgstr "" msgid "Help" msgstr "" -#: src/Content/Nav.php:224 +#: src/Content/Nav.php:225 msgid "Help and documentation" msgstr "" -#: src/Content/Nav.php:228 +#: src/Content/Nav.php:229 msgid "Apps" msgstr "" -#: src/Content/Nav.php:228 +#: src/Content/Nav.php:229 msgid "Addon applications, utilities, games" msgstr "" -#: src/Content/Nav.php:232 src/Content/Text/HTML.php:888 +#: src/Content/Nav.php:233 src/Content/Text/HTML.php:888 #: src/Module/Admin/Logs/View.php:87 src/Module/Search/Index.php:112 msgid "Search" msgstr "" -#: src/Content/Nav.php:232 +#: src/Content/Nav.php:233 msgid "Search site content" msgstr "" -#: src/Content/Nav.php:235 src/Content/Text/HTML.php:897 +#: src/Content/Nav.php:236 src/Content/Text/HTML.php:897 msgid "Full Text" msgstr "" -#: src/Content/Nav.php:236 src/Content/Text/HTML.php:898 +#: src/Content/Nav.php:237 src/Content/Text/HTML.php:898 #: src/Content/Widget/TagCloud.php:68 msgid "Tags" msgstr "" -#: src/Content/Nav.php:237 src/Content/Nav.php:296 +#: src/Content/Nav.php:238 src/Content/Nav.php:297 #: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:125 #: src/Module/BaseProfile.php:128 src/Module/Contact.php:373 #: src/Module/Contact.php:467 view/theme/frio/theme.php:247 msgid "Contacts" msgstr "" -#: src/Content/Nav.php:256 +#: src/Content/Nav.php:257 msgid "Community" msgstr "" -#: src/Content/Nav.php:256 +#: src/Content/Nav.php:257 msgid "Conversations on this and other servers" msgstr "" -#: src/Content/Nav.php:260 src/Module/BaseProfile.php:87 +#: src/Content/Nav.php:261 src/Module/BaseProfile.php:87 #: src/Module/BaseProfile.php:98 view/theme/frio/theme.php:244 msgid "Events and Calendar" msgstr "" -#: src/Content/Nav.php:263 +#: src/Content/Nav.php:264 msgid "Directory" msgstr "" -#: src/Content/Nav.php:263 +#: src/Content/Nav.php:264 msgid "People directory" msgstr "" -#: src/Content/Nav.php:265 src/Module/BaseAdmin.php:88 +#: src/Content/Nav.php:266 src/Module/BaseAdmin.php:88 msgid "Information" msgstr "" -#: src/Content/Nav.php:265 +#: src/Content/Nav.php:266 msgid "Information about this friendica instance" msgstr "" -#: src/Content/Nav.php:268 src/Module/Admin/Tos.php:76 +#: src/Content/Nav.php:269 src/Module/Admin/Tos.php:76 #: src/Module/BaseAdmin.php:99 src/Module/Register.php:176 #: src/Module/Tos.php:87 msgid "Terms of Service" msgstr "" -#: src/Content/Nav.php:268 +#: src/Content/Nav.php:269 msgid "Terms of Service of this Friendica instance" msgstr "" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:243 +#: src/Content/Nav.php:274 view/theme/frio/theme.php:243 msgid "Network" msgstr "" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:243 +#: src/Content/Nav.php:274 view/theme/frio/theme.php:243 msgid "Conversations from your friends" msgstr "" -#: src/Content/Nav.php:279 +#: src/Content/Nav.php:280 msgid "Introductions" msgstr "" -#: src/Content/Nav.php:279 +#: src/Content/Nav.php:280 msgid "Friend Requests" msgstr "" -#: src/Content/Nav.php:280 src/Module/BaseNotifications.php:148 +#: src/Content/Nav.php:281 src/Module/BaseNotifications.php:148 #: src/Module/Notifications/Introductions.php:73 msgid "Notifications" msgstr "" -#: src/Content/Nav.php:281 +#: src/Content/Nav.php:282 msgid "See all notifications" msgstr "" -#: src/Content/Nav.php:282 +#: src/Content/Nav.php:283 msgid "Mark all system notifications as seen" msgstr "" -#: src/Content/Nav.php:285 view/theme/frio/theme.php:245 +#: src/Content/Nav.php:286 view/theme/frio/theme.php:245 msgid "Private mail" msgstr "" -#: src/Content/Nav.php:286 +#: src/Content/Nav.php:287 msgid "Inbox" msgstr "" -#: src/Content/Nav.php:287 +#: src/Content/Nav.php:288 msgid "Outbox" msgstr "" -#: src/Content/Nav.php:291 +#: src/Content/Nav.php:292 msgid "Accounts" msgstr "" -#: src/Content/Nav.php:291 +#: src/Content/Nav.php:292 msgid "Manage other pages" msgstr "" -#: src/Content/Nav.php:294 src/Module/Admin/Addons/Details.php:114 +#: src/Content/Nav.php:295 src/Module/Admin/Addons/Details.php:114 #: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:122 #: src/Module/Welcome.php:52 view/theme/frio/theme.php:246 msgid "Settings" msgstr "" -#: src/Content/Nav.php:294 view/theme/frio/theme.php:246 +#: src/Content/Nav.php:295 view/theme/frio/theme.php:246 msgid "Account settings" msgstr "" -#: src/Content/Nav.php:296 view/theme/frio/theme.php:247 +#: src/Content/Nav.php:297 view/theme/frio/theme.php:247 msgid "Manage/edit friends and contacts" msgstr "" -#: src/Content/Nav.php:301 src/Module/BaseAdmin.php:129 +#: src/Content/Nav.php:302 src/Module/BaseAdmin.php:129 msgid "Admin" msgstr "" -#: src/Content/Nav.php:301 +#: src/Content/Nav.php:302 msgid "Site setup and configuration" msgstr "" -#: src/Content/Nav.php:304 +#: src/Content/Nav.php:305 msgid "Navigation" msgstr "" -#: src/Content/Nav.php:304 +#: src/Content/Nav.php:305 msgid "Site map" msgstr "" @@ -2639,8 +2639,8 @@ msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3429 -#: src/Model/Item.php:3435 src/Model/Item.php:3436 +#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3456 +#: src/Model/Item.php:3462 src/Model/Item.php:3463 msgid "Link to source" msgstr "" @@ -3421,36 +3421,36 @@ msgstr "" msgid "Enter a valid existing folder" msgstr "" -#: src/Core/Update.php:67 +#: src/Core/Update.php:69 #, php-format msgid "" "Updates from version %s are not supported. Please update at least to version " "2021.01 and wait until the postupdate finished version 1383." msgstr "" -#: src/Core/Update.php:78 +#: src/Core/Update.php:80 #, php-format msgid "" "Updates from postupdate version %s are not supported. Please update at least " "to version 2021.01 and wait until the postupdate finished version 1383." msgstr "" -#: src/Core/Update.php:153 +#: src/Core/Update.php:155 #, php-format msgid "%s: executing pre update %d" msgstr "" -#: src/Core/Update.php:191 +#: src/Core/Update.php:193 #, php-format msgid "%s: executing post update %d" msgstr "" -#: src/Core/Update.php:261 +#: src/Core/Update.php:263 #, php-format msgid "Update %s failed. See error logs." msgstr "" -#: src/Core/Update.php:315 +#: src/Core/Update.php:317 #, php-format msgid "" "\n" @@ -3462,16 +3462,16 @@ msgid "" "might be invalid." msgstr "" -#: src/Core/Update.php:321 +#: src/Core/Update.php:323 #, php-format msgid "The error message is\\n[pre]%s[/pre]" msgstr "" -#: src/Core/Update.php:325 src/Core/Update.php:367 +#: src/Core/Update.php:327 src/Core/Update.php:369 msgid "[Friendica Notify] Database update" msgstr "" -#: src/Core/Update.php:361 +#: src/Core/Update.php:363 #, php-format msgid "" "\n" @@ -3799,49 +3799,49 @@ msgstr "" msgid "post" msgstr "" -#: src/Model/Item.php:2978 +#: src/Model/Item.php:3005 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3341 +#: src/Model/Item.php:3368 msgid "bytes" msgstr "" -#: src/Model/Item.php:3372 +#: src/Model/Item.php:3399 #, 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:3374 +#: src/Model/Item.php:3401 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3379 +#: src/Model/Item.php:3406 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3381 +#: src/Model/Item.php:3408 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3383 +#: src/Model/Item.php:3410 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3417 src/Model/Item.php:3418 +#: src/Model/Item.php:3444 src/Model/Item.php:3445 msgid "View on separate page" msgstr "" @@ -4294,7 +4294,7 @@ msgstr "" #: src/Module/Admin/Blocklist/Server/Index.php:93 #: src/Module/Admin/Federation.php:201 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:84 -#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:433 +#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:431 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:233 #: src/Module/Admin/Themes/Details.php:90 src/Module/Admin/Themes/Index.php:111 #: src/Module/Admin/Tos.php:75 src/Module/Admin/Users/Active.php:136 @@ -5153,470 +5153,470 @@ msgstr "" msgid "Priority" msgstr "" -#: src/Module/Admin/Site.php:338 src/Module/Settings/Display.php:138 +#: src/Module/Admin/Site.php:336 src/Module/Settings/Display.php:138 msgid "No special theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:355 src/Module/Settings/Display.php:148 +#: src/Module/Admin/Site.php:353 src/Module/Settings/Display.php:148 #, php-format msgid "%s - (Experimental)" msgstr "" -#: src/Module/Admin/Site.php:367 -msgid "No community page for local users" -msgstr "" - -#: src/Module/Admin/Site.php:368 +#: src/Module/Admin/Site.php:365 msgid "No community page" msgstr "" -#: src/Module/Admin/Site.php:369 +#: src/Module/Admin/Site.php:366 +msgid "No community page for visitors" +msgstr "" + +#: src/Module/Admin/Site.php:367 msgid "Public postings from users of this site" msgstr "" -#: src/Module/Admin/Site.php:370 +#: src/Module/Admin/Site.php:368 msgid "Public postings from the federated network" msgstr "" -#: src/Module/Admin/Site.php:371 +#: src/Module/Admin/Site.php:369 msgid "Public postings from local users and the federated network" msgstr "" -#: src/Module/Admin/Site.php:377 +#: src/Module/Admin/Site.php:375 msgid "Multi user instance" msgstr "" -#: src/Module/Admin/Site.php:404 +#: src/Module/Admin/Site.php:402 msgid "Closed" msgstr "" -#: src/Module/Admin/Site.php:405 +#: src/Module/Admin/Site.php:403 msgid "Requires approval" msgstr "" -#: src/Module/Admin/Site.php:406 +#: src/Module/Admin/Site.php:404 msgid "Open" msgstr "" -#: src/Module/Admin/Site.php:410 src/Module/Install.php:222 +#: src/Module/Admin/Site.php:408 src/Module/Install.php:222 msgid "No SSL policy, links will track page SSL state" msgstr "" -#: src/Module/Admin/Site.php:411 src/Module/Install.php:223 +#: src/Module/Admin/Site.php:409 src/Module/Install.php:223 msgid "Force all links to use SSL" msgstr "" -#: src/Module/Admin/Site.php:412 src/Module/Install.php:224 +#: src/Module/Admin/Site.php:410 src/Module/Install.php:224 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "" -#: src/Module/Admin/Site.php:416 +#: src/Module/Admin/Site.php:414 msgid "Don't check" msgstr "" -#: src/Module/Admin/Site.php:417 +#: src/Module/Admin/Site.php:415 msgid "check the stable version" msgstr "" -#: src/Module/Admin/Site.php:418 +#: src/Module/Admin/Site.php:416 msgid "check the development version" msgstr "" -#: src/Module/Admin/Site.php:422 +#: src/Module/Admin/Site.php:420 msgid "none" msgstr "" -#: src/Module/Admin/Site.php:423 +#: src/Module/Admin/Site.php:421 msgid "Local contacts" msgstr "" -#: src/Module/Admin/Site.php:424 +#: src/Module/Admin/Site.php:422 msgid "Interactors" msgstr "" -#: src/Module/Admin/Site.php:434 src/Module/BaseAdmin.php:93 +#: src/Module/Admin/Site.php:432 src/Module/BaseAdmin.php:93 msgid "Site" msgstr "" -#: src/Module/Admin/Site.php:435 +#: src/Module/Admin/Site.php:433 msgid "General Information" msgstr "" -#: src/Module/Admin/Site.php:437 +#: src/Module/Admin/Site.php:435 msgid "Republish users to directory" msgstr "" -#: src/Module/Admin/Site.php:438 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:436 src/Module/Register.php:152 msgid "Registration" msgstr "" -#: src/Module/Admin/Site.php:439 +#: src/Module/Admin/Site.php:437 msgid "File upload" msgstr "" -#: src/Module/Admin/Site.php:440 +#: src/Module/Admin/Site.php:438 msgid "Policies" msgstr "" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:440 msgid "Auto Discovered Contact Directory" msgstr "" -#: src/Module/Admin/Site.php:443 +#: src/Module/Admin/Site.php:441 msgid "Performance" msgstr "" -#: src/Module/Admin/Site.php:444 +#: src/Module/Admin/Site.php:442 msgid "Worker" msgstr "" -#: src/Module/Admin/Site.php:445 +#: src/Module/Admin/Site.php:443 msgid "Message Relay" msgstr "" -#: src/Module/Admin/Site.php:446 +#: src/Module/Admin/Site.php:444 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "" -#: src/Module/Admin/Site.php:447 +#: src/Module/Admin/Site.php:445 msgid "The system is not subscribed to any relays at the moment." msgstr "" -#: src/Module/Admin/Site.php:448 +#: src/Module/Admin/Site.php:446 msgid "The system is currently subscribed to the following relays:" msgstr "" -#: src/Module/Admin/Site.php:450 +#: src/Module/Admin/Site.php:448 msgid "Relocate Node" msgstr "" -#: src/Module/Admin/Site.php:451 +#: src/Module/Admin/Site.php:449 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "" -#: src/Module/Admin/Site.php:452 +#: src/Module/Admin/Site.php:450 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:454 msgid "Site name" msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:455 msgid "Sender Email" msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:455 msgid "" "The email address your server shall use to send notification emails from." msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:456 msgid "Name of the system actor" msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:456 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "" -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:457 msgid "Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:458 msgid "Email Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:459 msgid "Shortcut icon" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:459 msgid "Link to an icon that will be used for browsers." msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:460 msgid "Touch icon" msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:460 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:461 msgid "Additional Info" msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:461 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:462 msgid "System language" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:463 msgid "System theme" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:463 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:464 msgid "Mobile system theme" msgstr "" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:464 msgid "Theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:467 src/Module/Install.php:232 +#: src/Module/Admin/Site.php:465 src/Module/Install.php:232 msgid "SSL link policy" msgstr "" -#: src/Module/Admin/Site.php:467 src/Module/Install.php:234 +#: src/Module/Admin/Site.php:465 src/Module/Install.php:234 msgid "Determines whether generated links should be forced to use SSL" msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:466 msgid "Force SSL" msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:466 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead " "to endless loops." msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:467 msgid "Show help entry from navigation menu" msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:467 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:468 msgid "Single user instance" msgstr "" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:468 msgid "Make this instance multi-user or single-user for the named user" msgstr "" -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:470 msgid "Maximum image size" msgstr "" -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:470 msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " "limits." msgstr "" -#: src/Module/Admin/Site.php:473 +#: src/Module/Admin/Site.php:471 msgid "Maximum image length" msgstr "" -#: src/Module/Admin/Site.php:473 +#: src/Module/Admin/Site.php:471 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "" -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:472 msgid "JPEG image quality" msgstr "" -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:472 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:474 msgid "Register policy" msgstr "" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:475 msgid "Maximum Daily Registrations" msgstr "" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:475 msgid "" "If registration is permitted above, this sets the maximum number of new user " "registrations to accept per day. If register is set to closed, this setting " "has no effect." msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:476 msgid "Register text" msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:476 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:477 msgid "Forbidden Nicknames" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:477 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:478 msgid "Accounts abandoned after x days" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:478 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:479 msgid "Allowed friend domains" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:479 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:480 msgid "Allowed email domains" msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:480 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:481 msgid "No OEmbed rich content" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:481 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:482 msgid "Trusted third-party domains" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:482 msgid "" "Comma separated list of domains from which content is allowed to be embedded " "in posts like with OEmbed. All sub-domains of the listed domains are allowed " "as well." msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:483 msgid "Block public" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:483 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "Force publish" msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:485 msgid "Global directory URL" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:485 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:486 msgid "Private posts by default for new users" msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:486 msgid "" "Set default post permissions for all new members to the default privacy " "group rather than public." msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:487 msgid "Don't include post content in email notifications" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:487 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:488 msgid "Disallow public access to addons listed in the apps menu." msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:488 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:489 msgid "Don't embed private images in posts" msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:489 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " "photos will have to authenticate and load each image, which may take a while." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:490 msgid "Explicit Content" msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:490 msgid "" "Set this to announce that your node is used mostly for explicit content that " "might not be suited for minors. This information will be published in the " @@ -5625,257 +5625,257 @@ msgid "" "will be shown at the user registration page." msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:491 msgid "Proxify external content" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:491 msgid "" "Route external content via the proxy functionality. This is used for example " "for some OEmbed accesses and in some other rare cases." msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:492 msgid "Cache contact avatars" msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:492 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:493 msgid "Allow Users to set remote_self" msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:493 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:494 msgid "Enable multiple registrations" msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:494 msgid "Enable users to register additional accounts for use as pages." msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:495 msgid "Enable OpenID" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:495 msgid "Enable OpenID support for registration and logins." msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:496 msgid "Enable Fullname check" msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:496 msgid "" "Enable check to only allow users to register with a space between the first " "name and the last name in their full name." msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:497 msgid "Community pages for visitors" msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:497 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:498 msgid "Posts per user on community page" msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:498 msgid "" "The maximum number of posts per user on the community page. (Not valid for " "\"Global Community\")" msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:500 msgid "Enable Mail support" msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:500 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:501 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "" -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:502 msgid "Enable OStatus support" msgstr "" -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:502 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:504 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub " "directory." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:505 msgid "Enable Diaspora support" msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:505 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:506 msgid "Verify SSL" msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:506 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:507 msgid "Proxy user" msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:507 msgid "User name for the proxy server." msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:508 msgid "Proxy URL" msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:508 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:509 msgid "Network timeout" msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:509 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:510 msgid "Maximum Load Average" msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:510 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:511 msgid "Minimal Memory" msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:511 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:512 msgid "Periodically optimize tables" msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:512 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:514 msgid "Discover followers/followings from contacts" msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:514 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:515 msgid "None - deactivated" msgstr "" -#: src/Module/Admin/Site.php:518 +#: src/Module/Admin/Site.php:516 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:517 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:519 msgid "Synchronize the contacts with the directory server" msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:519 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:521 msgid "Days between requery" msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:521 msgid "Number of days after which a server is requeried for his contacts." msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:522 msgid "Discover contacts from other servers" msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:522 msgid "" "Periodically query other servers for contacts. The system queries Friendica, " "Mastodon and Hubzilla servers." msgstr "" -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:523 msgid "Search the local directory" msgstr "" -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:523 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:525 msgid "Publish server information" msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:525 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -5883,50 +5883,50 @@ msgid "" "href=\"http://the-federation.info/\">the-federation.info for details." msgstr "" -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:527 msgid "Check upstream version" msgstr "" -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:527 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:528 msgid "Suppress Tags" msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:528 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:529 msgid "Clean database" msgstr "" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:529 msgid "" "Remove old remote items, orphaned database records and old content from some " "other helper tables." msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:530 msgid "Lifespan of remote items" msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:530 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:531 msgid "Lifespan of unclaimed items" msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:531 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -5934,144 +5934,144 @@ msgid "" "items if set to 0." msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:532 msgid "Lifespan of raw conversation data" msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:532 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:533 msgid "Maximum numbers of comments per post" msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:533 msgid "How much comments should be shown for each post? Default value is 100." msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:534 msgid "Maximum numbers of comments per post on the display page" msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:534 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:535 msgid "Temp path" msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:535 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:536 msgid "Only search in tags" msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:536 msgid "On large systems the text search can slow down the system extremely." msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:537 msgid "Generate counts per contact group when calculating network count" msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:537 msgid "" "On systems with users that heavily use contact groups the query can be very " "expensive." msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:539 msgid "Maximum number of parallel workers" msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:539 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great. " "Default value is %d." msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:540 msgid "Enable fastlane" msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:540 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes " "with higher priority are blocked by processes of lower priority." msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:542 msgid "Direct relay transfer" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:542 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "Relay scope" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "" -#: src/Module/Admin/Site.php:545 src/Module/Contact/Profile.php:273 +#: src/Module/Admin/Site.php:543 src/Module/Contact/Profile.php:273 #: src/Module/Settings/TwoFactor/Index.php:126 msgid "Disabled" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "all" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "tags" msgstr "" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:544 msgid "Server tags" msgstr "" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:544 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:545 msgid "Deny Server tags" msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:545 msgid "Comma separated list of tags that are rejected." msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:546 msgid "Allow user tags" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:546 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "" -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:549 msgid "Start Relocation" msgstr "" @@ -7256,50 +7256,50 @@ msgstr "" msgid "Yes" msgstr "" -#: src/Module/Conversation/Community.php:61 +#: src/Module/Conversation/Community.php:76 msgid "" "This community stream shows all public posts received by this node. They may " "not reflect the opinions of this node’s users." msgstr "" -#: src/Module/Conversation/Community.php:74 +#: src/Module/Conversation/Community.php:89 msgid "Local Community" msgstr "" -#: src/Module/Conversation/Community.php:77 +#: src/Module/Conversation/Community.php:92 msgid "Posts from local users on this server" msgstr "" -#: src/Module/Conversation/Community.php:85 +#: src/Module/Conversation/Community.php:100 msgid "Global Community" msgstr "" -#: src/Module/Conversation/Community.php:88 +#: src/Module/Conversation/Community.php:103 msgid "Posts from users of the whole federated network" msgstr "" -#: src/Module/Conversation/Community.php:121 +#: src/Module/Conversation/Community.php:136 msgid "Own Contacts" msgstr "" -#: src/Module/Conversation/Community.php:125 +#: src/Module/Conversation/Community.php:140 msgid "Include" msgstr "" -#: src/Module/Conversation/Community.php:126 +#: src/Module/Conversation/Community.php:141 msgid "Hide" msgstr "" -#: src/Module/Conversation/Community.php:143 src/Module/Search/Index.php:152 +#: src/Module/Conversation/Community.php:158 src/Module/Search/Index.php:152 #: src/Module/Search/Index.php:194 msgid "No results." msgstr "" -#: src/Module/Conversation/Community.php:199 +#: src/Module/Conversation/Community.php:214 msgid "Community option not available." msgstr "" -#: src/Module/Conversation/Community.php:215 +#: src/Module/Conversation/Community.php:230 msgid "Not available." msgstr "" @@ -8410,19 +8410,19 @@ msgstr "" #: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329 #: src/Module/Profile/Status.php:66 src/Module/Profile/Status.php:69 -#: src/Protocol/Feed.php:1025 src/Protocol/OStatus.php:1046 +#: src/Protocol/Feed.php:1026 src/Protocol/OStatus.php:1046 #, php-format msgid "%s's timeline" msgstr "" #: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:67 -#: src/Protocol/Feed.php:1029 src/Protocol/OStatus.php:1051 +#: src/Protocol/Feed.php:1030 src/Protocol/OStatus.php:1051 #, php-format msgid "%s's posts" msgstr "" #: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:68 -#: src/Protocol/Feed.php:1032 src/Protocol/OStatus.php:1055 +#: src/Protocol/Feed.php:1033 src/Protocol/OStatus.php:1055 #, php-format msgid "%s's comments" msgstr "" From 62a0d55fc8db61630b52bc74edaae6d49513c397 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 10:37:48 +0000 Subject: [PATCH 043/641] The friendica constants have been moved to the app class --- boot.php | 4 ---- src/App.php | 4 ++++ src/App/Page.php | 8 ++++---- src/Core/Console.php | 3 ++- src/Module/Admin/Federation.php | 3 ++- src/Module/Admin/Summary.php | 11 ++++++----- src/Module/Api/GNUSocial/GNUSocial/Config.php | 6 +++--- src/Module/Friendica.php | 7 ++++--- src/Module/NodeInfo110.php | 2 +- src/Module/NodeInfo120.php | 2 +- src/Module/NodeInfo210.php | 2 +- src/Module/Settings/UserExport.php | 4 ++-- src/Module/Statistics.php | 4 ++-- src/Network/HTTPClient/Factory/HttpClient.php | 6 +++--- src/Object/Api/Mastodon/Instance.php | 4 ++-- src/Protocol/ActivityPub/Transmitter.php | 3 ++- src/Protocol/DFRN.php | 5 +++-- src/Protocol/Feed.php | 5 +++-- src/Protocol/OStatus.php | 5 +++-- src/Util/EMailer/MailBuilder.php | 7 ++++--- src/Util/Writer/DbaDefinitionSqlWriter.php | 3 ++- tests/src/Module/NodeInfoTest.php | 8 ++++---- 22 files changed, 58 insertions(+), 48 deletions(-) diff --git a/boot.php b/boot.php index 6b078f7c9..6336c2e41 100644 --- a/boot.php +++ b/boot.php @@ -29,10 +29,6 @@ use Friendica\Model\Contact; -define('FRIENDICA_PLATFORM', 'Friendica'); -define('FRIENDICA_CODENAME', 'Giant Rhubarb'); -define('FRIENDICA_VERSION', '2022.12-dev'); - /** * Constant with a HTML line break. * diff --git a/src/App.php b/src/App.php index a141adf49..d46f69843 100644 --- a/src/App.php +++ b/src/App.php @@ -58,6 +58,10 @@ use Psr\Log\LoggerInterface; */ class App { + const PLATFORM = 'Friendica'; + const CODENAME = 'Giant Rhubarb'; + const VERSION = '2022.12-dev'; + // Allow themes to control internal parameters // by changing App values in theme.php private $theme_info = [ diff --git a/src/App/Page.php b/src/App/Page.php index 633145611..dcd2e8832 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -202,7 +202,7 @@ class Page implements ArrayAccess */ public function registerStylesheet(string $path, string $media = 'screen') { - $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); + $path = Network::appendQueryParam($path, ['v' => App::VERSION]); if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) { $path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR)); @@ -277,7 +277,7 @@ class Page implements ArrayAccess */ $this->page['htmlhead'] = Renderer::replaceMacros($tpl, [ '$local_user' => local_user(), - '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, + '$generator' => 'Friendica' . ' ' . App::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, @@ -395,7 +395,7 @@ class Page implements ArrayAccess */ public function registerFooterScript($path) { - $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); + $path = Network::appendQueryParam($path, ['v' => App::VERSION]); $url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path); @@ -543,7 +543,7 @@ class Page implements ArrayAccess $page = $this->page; - header("X-Friendica-Version: " . FRIENDICA_VERSION); + header("X-Friendica-Version: " . App::VERSION); header("Content-type: text/html; charset=utf-8"); if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) { diff --git a/src/Core/Console.php b/src/Core/Console.php index 2521e21be..f51e33bd5 100644 --- a/src/Core/Console.php +++ b/src/Core/Console.php @@ -23,6 +23,7 @@ namespace Friendica\Core; use Dice\Dice; use Friendica; +use Friendica\App; /** * Description of Console @@ -133,7 +134,7 @@ HELP; $command = null; if ($this->getOption('version')) { - $this->out('Friendica Console version ' . FRIENDICA_VERSION); + $this->out('Friendica Console version ' . App::VERSION); return 0; } elseif ((count($this->options) === 0 || $this->getOption($this->customHelpOptions) === true || $this->getOption($this->customHelpOptions) === 1) && count($this->args) === 0 diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 5144b1e76..0fae254dd 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -21,6 +21,7 @@ namespace Friendica\Module\Admin; +use Friendica\App; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Database\DBA; @@ -202,7 +203,7 @@ class Federation extends BaseAdmin '$page' => DI::l10n()->t('Federation Statistics'), '$intro' => $intro, '$counts' => $counts, - '$version' => FRIENDICA_VERSION, + '$version' => App::VERSION, '$legendtext' => DI::l10n()->tt('Currently this node is aware of %2$s node (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', 'Currently this node is aware of %2$s nodes (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', $total, number_format($total), number_format($month), number_format($halfyear), number_format($users)), ]); } diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 667b32242..8eb4978b6 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -21,6 +21,7 @@ namespace Friendica\Module\Admin; +use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Logger; @@ -79,8 +80,8 @@ class Summary extends BaseAdmin // the local version of Friendica. Check is opt-in, source may be stable or develop branch if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') { $gitversion = DI::config()->get('system', 'git_friendica_version'); - if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) { - $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion); + if (version_compare(App::VERSION, $gitversion) < 0) { + $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', App::VERSION, $gitversion); } } @@ -236,9 +237,9 @@ class Summary extends BaseAdmin '$users' => [DI::l10n()->t('Registered users'), $users], '$accounts' => $accounts, '$pending' => [DI::l10n()->t('Pending registrations'), $pending], - '$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION], - '$platform' => FRIENDICA_PLATFORM, - '$codename' => FRIENDICA_CODENAME, + '$version' => [DI::l10n()->t('Version'), App::VERSION], + '$platform' => App::PLATFORM, + '$codename' => App::CODENAME, '$build' => DI::config()->get('system', 'build'), '$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()], '$serversettings' => $server_settings, diff --git a/src/Module/Api/GNUSocial/GNUSocial/Config.php b/src/Module/Api/GNUSocial/GNUSocial/Config.php index 75c70ce06..6e9a6e9f4 100644 --- a/src/Module/Api/GNUSocial/GNUSocial/Config.php +++ b/src/Module/Api/GNUSocial/GNUSocial/Config.php @@ -53,9 +53,9 @@ class Config extends BaseApi 'sslserver' => null, 'ssl' => DI::config()->get('system', 'ssl_policy') == App\BaseURL::SSL_POLICY_FULL ? 'always' : '0', 'friendica' => [ - 'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM, - 'FRIENDICA_VERSION' => FRIENDICA_VERSION, - 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION, + 'FRIENDICA_PLATFORM' => App::PLATFORM, + 'FRIENDICA_VERSION' => App::VERSION, + 'DB_UPDATE_VERSION' => App::VERSION, ] ], ]; diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 012f65ef6..37bd69da4 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -21,6 +21,7 @@ namespace Friendica\Module; +use Friendica\App; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Hook; @@ -96,7 +97,7 @@ class Friendica extends BaseModule return Renderer::replaceMacros($tpl, [ 'about' => DI::l10n()->t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.', - '' . FRIENDICA_VERSION . '', + '' . App::VERSION . '', DI::baseUrl()->get(), '' . $config->get('system', 'build') . '/' . DB_UPDATE_VERSION . '', '' . $config->get('system', 'post_update_version') . '/' . PostUpdate::VERSION . ''), @@ -169,7 +170,7 @@ class Friendica extends BaseModule } $data = [ - 'version' => FRIENDICA_VERSION, + 'version' => App::VERSION, 'url' => DI::baseUrl()->get(), 'addons' => $visible_addons, 'locked_features' => $locked_features, @@ -178,7 +179,7 @@ class Friendica extends BaseModule 'register_policy' => $register_policy, 'admin' => $admin, 'site_name' => $config->get('config', 'sitename'), - 'platform' => strtolower(FRIENDICA_PLATFORM), + 'platform' => strtolower(App::PLATFORM), 'info' => $config->get('config', 'info'), 'no_scrape_url' => DI::baseUrl()->get() . '/noscrape', ]; diff --git a/src/Module/NodeInfo110.php b/src/Module/NodeInfo110.php index a308f8e6f..2f7042f10 100644 --- a/src/Module/NodeInfo110.php +++ b/src/Module/NodeInfo110.php @@ -53,7 +53,7 @@ class NodeInfo110 extends BaseModule 'version' => '1.0', 'software' => [ 'name' => 'friendica', - 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'version' => App::VERSION . '-' . DB_UPDATE_VERSION, ], 'protocols' => [ 'inbound' => [ diff --git a/src/Module/NodeInfo120.php b/src/Module/NodeInfo120.php index 3e6a69b74..34880c4e3 100644 --- a/src/Module/NodeInfo120.php +++ b/src/Module/NodeInfo120.php @@ -53,7 +53,7 @@ class NodeInfo120 extends BaseModule 'version' => '2.0', 'software' => [ 'name' => 'friendica', - 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'version' => App::VERSION . '-' . DB_UPDATE_VERSION, ], 'protocols' => ['dfrn', 'activitypub'], 'services' => Nodeinfo::getServices(), diff --git a/src/Module/NodeInfo210.php b/src/Module/NodeInfo210.php index 723736a61..f12ce52cb 100644 --- a/src/Module/NodeInfo210.php +++ b/src/Module/NodeInfo210.php @@ -55,7 +55,7 @@ class NodeInfo210 extends BaseModule 'baseUrl' => $this->baseUrl->get(), 'name' => $this->config->get('config', 'sitename'), 'software' => 'friendica', - 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'version' => App::VERSION . '-' . DB_UPDATE_VERSION, ], 'organization' => Nodeinfo::getOrganization($this->config), 'protocols' => ['dfrn', 'activitypub'], diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index 4dfbdb99e..ccfd08b52 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -21,11 +21,11 @@ namespace Friendica\Module\Settings; +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; -use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\Post; @@ -253,7 +253,7 @@ class UserExport extends BaseSettings ); $output = [ - 'version' => FRIENDICA_VERSION, + 'version' => App::VERSION, 'schema' => DB_UPDATE_VERSION, 'baseurl' => DI::baseUrl(), 'user' => $user, diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index db145bd43..e06fc6405 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -69,8 +69,8 @@ class Statistics extends BaseModule $statistics = array_merge([ 'name' => $this->config->get('config', 'sitename'), - 'network' => FRIENDICA_PLATFORM, - 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'network' => App::PLATFORM, + 'version' => App::VERSION . '-' . DB_UPDATE_VERSION, 'registrations_open' => $registration_open, 'total_users' => $this->config->get('nodeinfo', 'total_users'), 'active_users_halfyear' => $this->config->get('nodeinfo', 'active_users_halfyear'), diff --git a/src/Network/HTTPClient/Factory/HttpClient.php b/src/Network/HTTPClient/Factory/HttpClient.php index 29ef3c09e..713933222 100644 --- a/src/Network/HTTPClient/Factory/HttpClient.php +++ b/src/Network/HTTPClient/Factory/HttpClient.php @@ -86,9 +86,9 @@ class HttpClient extends BaseFactory $logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri, 'method' => $request->getMethod()]); }; - $userAgent = FRIENDICA_PLATFORM . " '" . - FRIENDICA_CODENAME . "' " . - FRIENDICA_VERSION . '-' . + $userAgent = App::PLATFORM . " '" . + App::CODENAME . "' " . + App::VERSION . '-' . DB_UPDATE_VERSION . '; ' . $this->baseUrl->get(); diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 0ae96c972..45fc4bf89 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -21,11 +21,11 @@ namespace Friendica\Object\Api\Mastodon; +use Friendica\App; use Friendica\App\BaseURL; use Friendica\BaseDataTransferObject; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Database\Database; -use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\User; use Friendica\Module\Register; @@ -87,7 +87,7 @@ class Instance extends BaseDataTransferObject $this->title = $config->get('config', 'sitename'); $this->short_description = $this->description = $config->get('config', 'info'); $this->email = $config->get('config', 'admin_email'); - $this->version = '2.8.0 (compatible; Friendica ' . FRIENDICA_VERSION . ')'; + $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); $this->thumbnail = $baseUrl->get() . ($config->get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 8b9571e55..11a64504b 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -21,6 +21,7 @@ namespace Friendica\Protocol\ActivityPub; +use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\Text\BBCode; use Friendica\Core\Cache\Enum\Duration; @@ -416,7 +417,7 @@ class Transmitter { return [ 'type' => 'Service', - 'name' => FRIENDICA_PLATFORM . " '" . FRIENDICA_CODENAME . "' " . FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'name' => App::PLATFORM . " '" . App::CODENAME . "' " . App::VERSION . '-' . DB_UPDATE_VERSION, 'url' => DI::baseUrl()->get() ]; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 47637bc2e..7e92f1292 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -25,6 +25,7 @@ use DOMDocument; use DOMElement; use DOMNode; use DOMXPath; +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Logger; use Friendica\Core\Protocol; @@ -369,8 +370,8 @@ class DFRN XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'title', $owner['name']); - $attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION]; - XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); + $attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION]; + XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes); $attributes = ['rel' => 'license', 'href' => 'http://creativecommons.org/licenses/by/3.0/']; XML::addElement($doc, $root, 'link', '', $attributes); diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index f1521ac2d..907dfd8b9 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -24,6 +24,7 @@ namespace Friendica\Protocol; use DOMDocument; use DOMElement; use DOMXPath; +use Friendica\App; use Friendica\Content\PageInfo; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; @@ -1035,8 +1036,8 @@ class Feed break; } - $attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION]; - XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); + $attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION]; + XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes); XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'title', $title); XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename'))); diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index bd6002392..d01f467ad 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -24,6 +24,7 @@ namespace Friendica\Protocol; use DOMDocument; use DOMElement; use DOMXPath; +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Cache\Enum\Duration; @@ -1061,9 +1062,9 @@ class OStatus $attributes = [ 'uri' => 'https://friendi.ca', - 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, + 'version' => App::VERSION . '-' . DB_UPDATE_VERSION, ]; - XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); + XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes); XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'title', $title); XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename'))); diff --git a/src/Util/EMailer/MailBuilder.php b/src/Util/EMailer/MailBuilder.php index 321bdc9e6..2aadf955a 100644 --- a/src/Util/EMailer/MailBuilder.php +++ b/src/Util/EMailer/MailBuilder.php @@ -22,6 +22,7 @@ namespace Friendica\Util\EMailer; use Exception; +use Friendica\App; use Friendica\App\BaseURL; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; @@ -79,8 +80,8 @@ abstract class MailBuilder $this->headers = [ 'Precedence' => ['list'], 'X-Friendica-Host' => [$hostname], - 'X-Friendica-Platform' => [FRIENDICA_PLATFORM], - 'X-Friendica-Version' => [FRIENDICA_VERSION], + 'X-Friendica-Platform' => [App::PLATFORM], + 'X-Friendica-Version' => [App::VERSION], 'List-ID' => [''], 'List-Archive' => ['<' . $baseUrl->get() . '/notifications/system>'], ]; @@ -257,7 +258,7 @@ abstract class MailBuilder $tpl = Renderer::getMarkupTemplate('email/html.tpl'); $msgHtml = Renderer::replaceMacros($tpl, [ '$title' => $this->l10n->t('Friendica Notification'), - '$product' => FRIENDICA_PLATFORM, + '$product' => App::PLATFORM, '$htmlversion' => $msgHtml, '$sitename' => $this->config->get('config', 'sitename'), '$banner' => $this->config->get('system', 'email_banner', diff --git a/src/Util/Writer/DbaDefinitionSqlWriter.php b/src/Util/Writer/DbaDefinitionSqlWriter.php index f5e41847f..9f6d4701b 100644 --- a/src/Util/Writer/DbaDefinitionSqlWriter.php +++ b/src/Util/Writer/DbaDefinitionSqlWriter.php @@ -22,6 +22,7 @@ namespace Friendica\Util\Writer; use Exception; +use Friendica\App; use Friendica\Database\Definition\DbaDefinition; /** @@ -41,7 +42,7 @@ class DbaDefinitionSqlWriter public static function create(DbaDefinition $definition): string { $sqlString = "-- ------------------------------------------\n"; - $sqlString .= "-- " . FRIENDICA_PLATFORM . " " . FRIENDICA_VERSION . " (" . FRIENDICA_CODENAME . ")\n"; + $sqlString .= "-- " . App::PLATFORM . " " . App::VERSION . " (" . App::CODENAME . ")\n"; $sqlString .= "-- DB_UPDATE_VERSION " . DB_UPDATE_VERSION . "\n"; $sqlString .= "-- ------------------------------------------\n\n\n"; diff --git a/tests/src/Module/NodeInfoTest.php b/tests/src/Module/NodeInfoTest.php index ac3916faf..a7766d247 100644 --- a/tests/src/Module/NodeInfoTest.php +++ b/tests/src/Module/NodeInfoTest.php @@ -21,12 +21,12 @@ namespace Friendica\Test\src\Module; +use Friendica\App; use Friendica\Capabilities\ICanCreateResponses; use Friendica\DI; use Friendica\Module\NodeInfo110; use Friendica\Module\NodeInfo120; use Friendica\Module\NodeInfo210; -use Friendica\Module\Response; use Friendica\Test\FixtureTest; class NodeInfoTest extends FixtureTest @@ -44,7 +44,7 @@ class NodeInfoTest extends FixtureTest self::assertEquals('1.0', $json->version); self::assertEquals('friendica', $json->software->name); - self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); + self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); self::assertIsArray($json->protocols->inbound); self::assertIsArray($json->protocols->outbound); @@ -65,7 +65,7 @@ class NodeInfoTest extends FixtureTest self::assertEquals('2.0', $json->version); self::assertEquals('friendica', $json->software->name); - self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); + self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); self::assertIsArray($json->protocols); self::assertIsArray($json->services->inbound); @@ -85,7 +85,7 @@ class NodeInfoTest extends FixtureTest self::assertEquals('1.0', $json->version); self::assertEquals('friendica', $json->server->software); - self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->server->version); + self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->server->version); self::assertIsArray($json->protocols); self::assertIsArray($json->services->inbound); From 4ff7c37f85cdedb3f033bec92228c8ef22def574 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 11:27:32 +0000 Subject: [PATCH 044/641] Replace "notice" calls --- mod/cal.php | 8 ++++---- mod/editpost.php | 6 +++--- mod/events.php | 8 ++++---- mod/follow.php | 16 ++++++++-------- mod/item.php | 12 ++++++------ mod/lostpass.php | 6 +++--- mod/match.php | 2 +- mod/message.php | 22 +++++++++++----------- mod/notes.php | 2 +- src/Module/Delegation.php | 2 +- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/mod/cal.php b/mod/cal.php index 3f249da0a..ec6df1f16 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -119,7 +119,7 @@ function cal_content(App $a) $is_owner = local_user() == $owner['uid']; if ($owner['hidewall'] && !$is_owner && !$remote_contact) { - notice(DI::l10n()->t('Access to this profile has been restricted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.')); return; } @@ -262,7 +262,7 @@ function cal_content(App $a) if ($mode == 'export') { if (!$owner_uid) { - notice(DI::l10n()->t('User not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found')); return; } @@ -271,9 +271,9 @@ function cal_content(App $a) if (!$evexport["success"]) { if ($evexport["content"]) { - notice(DI::l10n()->t('This calendar format is not supported')); + DI::sysmsg()->addNotice(DI::l10n()->t('This calendar format is not supported')); } else { - notice(DI::l10n()->t('No exportable data found')); + DI::sysmsg()->addNotice(DI::l10n()->t('No exportable data found')); } // If it the own calendar return to the events page diff --git a/mod/editpost.php b/mod/editpost.php index 3fb8c80ec..8d2160fde 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -35,14 +35,14 @@ function editpost_content(App $a) $o = ''; if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); if (!$post_id) { - notice(DI::l10n()->t('Item not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('Item not found')); return; } @@ -52,7 +52,7 @@ function editpost_content(App $a) $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]); if (!DBA::isResult($item)) { - notice(DI::l10n()->t('Item not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('Item not found')); return; } diff --git a/mod/events.php b/mod/events.php index eead66c01..f1d8a7ca6 100644 --- a/mod/events.php +++ b/mod/events.php @@ -121,7 +121,7 @@ function events_post(App $a) $onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986); if (strcmp($finish, $start) < 0 && !$nofinish) { - notice(DI::l10n()->t('Event can not end before it has started.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Event can not end before it has started.')); if (intval($_REQUEST['preview'])) { System::httpExit(DI::l10n()->t('Event can not end before it has started.')); } @@ -129,7 +129,7 @@ function events_post(App $a) } if (!$summary || ($start === DBA::NULL_DATETIME)) { - notice(DI::l10n()->t('Event title and start time are required.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Event title and start time are required.')); if (intval($_REQUEST['preview'])) { System::httpExit(DI::l10n()->t('Event title and start time are required.')); } @@ -214,7 +214,7 @@ function events_post(App $a) function events_content(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -531,7 +531,7 @@ function events_content(App $a) } if (Post::exists(['id' => $ev[0]['itemid']])) { - notice(DI::l10n()->t('Failed to remove event')); + DI::sysmsg()->addNotice(DI::l10n()->t('Failed to remove event')); } DI::baseUrl()->redirect('events'); diff --git a/mod/follow.php b/mod/follow.php index 818a1ae5e..b6ffe2ef0 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -53,7 +53,7 @@ function follow_content(App $a) $return_path = 'contact'; if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect($return_path); // NOTREACHED } @@ -81,7 +81,7 @@ function follow_content(App $a) if (DBA::isResult($user_contact)) { if ($user_contact['pending']) { - notice(DI::l10n()->t('You already added this contact.')); + DI::sysmsg()->addNotice(DI::l10n()->t('You already added this contact.')); $submit = ''; } } @@ -97,7 +97,7 @@ function follow_content(App $a) // Possibly it is a remote item and not an account follow_remote_item($url); - notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added.")); + DI::sysmsg()->addNotice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added.")); $submit = ''; $contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => '']; } @@ -105,12 +105,12 @@ function follow_content(App $a) $protocol = Contact::getProtocol($contact['url'], $contact['network']); if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) { - notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added.")); + DI::sysmsg()->addNotice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added.")); $submit = ''; } if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) { - notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added.")); + DI::sysmsg()->addNotice(DI::l10n()->t("OStatus support is disabled. Contact can't be added.")); $submit = ''; } @@ -127,7 +127,7 @@ function follow_content(App $a) $owner = User::getOwnerDataById($uid); if (empty($owner)) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect($return_path); // NOTREACHED } @@ -181,14 +181,14 @@ function follow_process(App $a, string $url) follow_remote_item($url); if ($result['message']) { - notice($result['message']); + DI::sysmsg()->addNotice($result['message']); } DI::baseUrl()->redirect($return_path); } elseif ($result['cid']) { DI::baseUrl()->redirect('contact/' . $result['cid']); } - notice(DI::l10n()->t('The contact could not be added.')); + DI::sysmsg()->addNotice(DI::l10n()->t('The contact could not be added.')); DI::baseUrl()->redirect($return_path); } diff --git a/mod/item.php b/mod/item.php index 8f4494ca7..cc8e95385 100644 --- a/mod/item.php +++ b/mod/item.php @@ -129,7 +129,7 @@ function item_post(App $a) { } if (!DBA::isResult($toplevel_item)) { - notice(DI::l10n()->t('Unable to locate original post.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate original post.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -179,7 +179,7 @@ function item_post(App $a) { // Now check that valid personal details have been provided if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) { Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]); - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -335,7 +335,7 @@ function item_post(App $a) { System::jsonExit(['preview' => '']); } - notice(DI::l10n()->t('Empty post discarded.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Empty post discarded.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -685,7 +685,7 @@ function item_post(App $a) { $post_id = Item::insert($datarray); if (!$post_id) { - notice(DI::l10n()->t('Item wasn\'t stored.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Item wasn\'t stored.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -841,7 +841,7 @@ function drop_item(int $id, string $return = '') $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]); if (!DBA::isResult($item)) { - notice(DI::l10n()->t('Item not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.')); DI::baseUrl()->redirect('network'); } @@ -863,7 +863,7 @@ function drop_item(int $id, string $return = '') item_redirect_after_action($item, $return); } else { Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]); - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('display/' . $item['guid']); //NOTREACHED } diff --git a/mod/lostpass.php b/mod/lostpass.php index 6aa76e0cc..150c170d7 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -37,7 +37,7 @@ function lostpass_post(App $a) $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame]; $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('No valid account found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No valid account found.')); DI::baseUrl()->redirect(); } @@ -97,7 +97,7 @@ function lostpass_content(App $a) $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]); if (!DBA::isResult($user)) { - notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.")); + DI::sysmsg()->addNotice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.")); return lostpass_form(); } @@ -110,7 +110,7 @@ function lostpass_content(App $a) ]; DBA::update('user', $fields, ['uid' => $user['uid']]); - notice(DI::l10n()->t('Request has expired, please make a new one.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Request has expired, please make a new one.')); return lostpass_form(); } diff --git a/mod/match.php b/mod/match.php index 02ee0c333..5a5d3be93 100644 --- a/mod/match.php +++ b/mod/match.php @@ -59,7 +59,7 @@ function match_content(App $a) return ''; } if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) { - notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.')); return ''; } diff --git a/mod/message.php b/mod/message.php index a07c8b449..d1231b7c5 100644 --- a/mod/message.php +++ b/mod/message.php @@ -66,7 +66,7 @@ function message_init(App $a) function message_post(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -80,17 +80,17 @@ function message_post(App $a) switch ($ret) { case -1: - notice(DI::l10n()->t('No recipient selected.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.')); $norecip = true; break; case -2: - notice(DI::l10n()->t('Unable to locate contact information.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.')); break; case -3: - notice(DI::l10n()->t('Message could not be sent.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.')); break; case -4: - notice(DI::l10n()->t('Message collection failure.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.')); break; } @@ -108,7 +108,7 @@ function message_content(App $a) Nav::setSelected('messages'); if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -143,12 +143,12 @@ function message_content(App $a) if ($cmd === 'drop') { $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); if(!DBA::isResult($message)){ - notice(DI::l10n()->t('Conversation not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.')); DI::baseUrl()->redirect('message'); } if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) { - notice(DI::l10n()->t('Message was not deleted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.')); } $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]); @@ -163,7 +163,7 @@ function message_content(App $a) $parent = $parentmail['parent-uri']; if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { - notice(DI::l10n()->t('Conversation was not removed.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.')); } } DI::baseUrl()->redirect('message'); @@ -219,7 +219,7 @@ function message_content(App $a) $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage()); if (!DBA::isResult($r)) { - notice(DI::l10n()->t('No messages.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No messages.')); return $o; } @@ -275,7 +275,7 @@ function message_content(App $a) } if (!DBA::isResult($messages)) { - notice(DI::l10n()->t('Message not available.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.')); return $o; } diff --git a/mod/notes.php b/mod/notes.php index b5bdbf870..a30d80769 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -41,7 +41,7 @@ function notes_init(App $a) function notes_content(App $a, $update = false) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index c14573c8b..146e9382b 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -108,7 +108,7 @@ class Delegation extends BaseModule $ret = []; Hook::callAll('home_init', $ret); - notice($this->t('You are now logged in as %s', $user['username'])); + DI::sysmsg()->addNotice($this->t('You are now logged in as %s', $user['username'])); DI::baseUrl()->redirect('network'); } From e96fd5166a1e16587dc874560b7db218e699c8a7 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 11:28:54 +0000 Subject: [PATCH 045/641] Fix wrong constant --- src/Module/Api/GNUSocial/GNUSocial/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Api/GNUSocial/GNUSocial/Config.php b/src/Module/Api/GNUSocial/GNUSocial/Config.php index 6e9a6e9f4..8b38ca896 100644 --- a/src/Module/Api/GNUSocial/GNUSocial/Config.php +++ b/src/Module/Api/GNUSocial/GNUSocial/Config.php @@ -55,7 +55,7 @@ class Config extends BaseApi 'friendica' => [ 'FRIENDICA_PLATFORM' => App::PLATFORM, 'FRIENDICA_VERSION' => App::VERSION, - 'DB_UPDATE_VERSION' => App::VERSION, + 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION, ] ], ]; From fdfa1f8630e320f4a5a1992898cd0efbe8faea53 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 18:55:22 +0000 Subject: [PATCH 046/641] The notice and info have been moved --- boot.php | 30 ------------- mod/lostpass.php | 4 +- mod/match.php | 2 +- mod/ostatus_subscribe.php | 2 +- mod/photos.php | 42 +++++++++---------- mod/repair_ostatus.php | 2 +- mod/settings.php | 10 ++--- mod/uimport.php | 6 +-- mod/unfollow.php | 14 +++---- mod/wall_attach.php | 4 +- mod/wall_upload.php | 4 +- mod/wallmessage.php | 24 +++++------ src/BaseModule.php | 2 +- src/Core/UserImport.php | 14 +++---- src/Model/Group.php | 2 +- src/Model/Profile.php | 2 +- src/Module/Admin/Addons/Details.php | 6 +-- src/Module/Admin/Addons/Index.php | 8 ++-- src/Module/Admin/Blocklist/Contact.php | 8 ++-- src/Module/Admin/DBSync.php | 2 +- src/Module/Admin/Item/Delete.php | 2 +- src/Module/Admin/Logs/Settings.php | 2 +- src/Module/Admin/Storage.php | 8 ++-- src/Module/Admin/Themes/Details.php | 8 ++-- src/Module/Admin/Themes/Embed.php | 2 +- src/Module/Admin/Themes/Index.php | 10 ++--- src/Module/Admin/Users/Active.php | 14 +++---- src/Module/Admin/Users/Blocked.php | 14 +++---- src/Module/Admin/Users/Create.php | 2 +- src/Module/Admin/Users/Index.php | 18 ++++---- src/Module/Admin/Users/Pending.php | 10 ++--- src/Module/Apps.php | 3 +- src/Module/BaseAdmin.php | 2 +- src/Module/BaseSearch.php | 2 +- src/Module/Contact.php | 2 +- src/Module/Contact/Advanced.php | 3 +- src/Module/Contact/Profile.php | 7 ++-- src/Module/Contact/Revoke.php | 3 +- src/Module/Conversation/Community.php | 2 +- src/Module/Conversation/Network.php | 4 +- src/Module/Debug/Feed.php | 3 +- src/Module/Directory.php | 2 +- src/Module/Filer/SaveTag.php | 3 +- src/Module/FollowConfirm.php | 2 +- src/Module/FriendSuggest.php | 7 ++-- src/Module/Group.php | 18 ++++---- src/Module/Invite.php | 8 ++-- src/Module/Notifications/Introductions.php | 3 +- src/Module/Notifications/Notification.php | 3 +- src/Module/Profile/Profile.php | 2 +- src/Module/Profile/Status.php | 2 +- src/Module/Register.php | 38 ++++++++--------- src/Module/RemoteFollow.php | 9 ++-- src/Module/Search/Directory.php | 2 +- src/Module/Search/Index.php | 4 +- src/Module/Search/Saved.php | 7 ++-- src/Module/Security/Logout.php | 3 +- src/Module/Security/OpenID.php | 4 +- src/Module/Security/TwoFactor/Recovery.php | 5 ++- src/Module/Security/TwoFactor/SignOut.php | 9 ++-- src/Module/Security/TwoFactor/Trust.php | 3 +- src/Module/Settings/Account.php | 26 ++++++------ src/Module/Settings/Delegation.php | 12 +++--- src/Module/Settings/Display.php | 2 +- src/Module/Settings/Profile/Index.php | 6 +-- src/Module/Settings/Profile/Photo/Crop.php | 12 +++--- src/Module/Settings/Profile/Photo/Index.php | 10 ++--- src/Module/Settings/TwoFactor/AppSpecific.php | 13 +++--- src/Module/Settings/TwoFactor/Index.php | 4 +- src/Module/Settings/TwoFactor/Recovery.php | 5 ++- src/Module/Settings/TwoFactor/Trusted.php | 7 ++-- src/Module/Settings/TwoFactor/Verify.php | 7 ++-- src/Security/Authentication.php | 10 ++--- 73 files changed, 273 insertions(+), 284 deletions(-) diff --git a/boot.php b/boot.php index 6336c2e41..24486f413 100644 --- a/boot.php +++ b/boot.php @@ -126,33 +126,3 @@ function remote_user() return false; } - -/** - * Show an error message to user. - * - * This function save text in session, to be shown to the user at next page load - * - * @param string $s - Text of notice - * - * @return void - * @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead - */ -function notice(string $s) -{ - \Friendica\DI::sysmsg()->addNotice($s); -} - -/** - * Show an info message to user. - * - * This function save text in session, to be shown to the user at next page load - * - * @param string $s - Text of notice - * - * @return void - * @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead - */ -function info(string $s) -{ - \Friendica\DI::sysmsg()->addInfo($s); -} diff --git a/mod/lostpass.php b/mod/lostpass.php index 150c170d7..62b621b8c 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -49,7 +49,7 @@ function lostpass_post(App $a) ]; $result = DBA::update('user', $fields, ['uid' => $user['uid']]); if ($result) { - info(DI::l10n()->t('Password reset request issued. Check your email.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Password reset request issued. Check your email.')); } $sitename = DI::config()->get('config', 'sitename'); @@ -152,7 +152,7 @@ function lostpass_generate_password($user) '$newpass' => $new_password, ]); - info(DI::l10n()->t("Your password has been reset.")); + DI::sysmsg()->addInfo(DI::l10n()->t("Your password has been reset.")); $sitename = DI::config()->get('config', 'sitename'); $preamble = Strings::deindent(DI::l10n()->t(' diff --git a/mod/match.php b/mod/match.php index 5a5d3be93..a1f7be77c 100644 --- a/mod/match.php +++ b/mod/match.php @@ -90,7 +90,7 @@ function match_content(App $a) } if (empty($entries)) { - info(DI::l10n()->t('No matches')); + DI::sysmsg()->addInfo(DI::l10n()->t('No matches')); } $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl'); diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 781de3493..2ecea6016 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -30,7 +30,7 @@ use Friendica\Protocol\ActivityPub; function ostatus_subscribe_content(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('ostatus_subscribe'); // NOTREACHED } diff --git a/mod/photos.php b/mod/photos.php index 6a4596bf2..047328aa5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -157,14 +157,14 @@ function photos_post(App $a) } if (!$can_post) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); System::exit(); } $owner_record = User::getOwnerDataById($page_owner_uid); if (!$owner_record) { - notice(DI::l10n()->t('Contact information unavailable')); + DI::sysmsg()->addNotice(DI::l10n()->t('Contact information unavailable')); DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid); System::exit(); } @@ -193,7 +193,7 @@ function photos_post(App $a) $album = hex2bin(DI::args()->getArgv()[3]); if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid, 'photo-type' => Photo::DEFAULT])) { - notice(DI::l10n()->t('Album not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Album not found.')); DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album'); return; // NOTREACHED } @@ -247,9 +247,9 @@ function photos_post(App $a) // Update the photo albums cache Photo::clearAlbumCache($page_owner_uid); - notice(DI::l10n()->t('Album successfully deleted')); + DI::sysmsg()->addNotice(DI::l10n()->t('Album successfully deleted')); } else { - notice(DI::l10n()->t('Album was empty.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Album was empty.')); } } @@ -281,7 +281,7 @@ function photos_post(App $a) // Update the photo albums cache Photo::clearAlbumCache($page_owner_uid); } else { - notice(DI::l10n()->t('Failed to delete the photo.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Failed to delete the photo.')); DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1] . '/image/' . DI::args()->getArgv()[3]); } @@ -633,21 +633,21 @@ function photos_post(App $a) if ($error !== UPLOAD_ERR_OK) { switch ($error) { case UPLOAD_ERR_INI_SIZE: - notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize'))); + DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize'))); break; case UPLOAD_ERR_FORM_SIZE: - notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0))); + DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0))); break; case UPLOAD_ERR_PARTIAL: - notice(DI::l10n()->t('Image upload didn\'t complete, please try again')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image upload didn\'t complete, please try again')); break; case UPLOAD_ERR_NO_FILE: - notice(DI::l10n()->t('Image file is missing')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image file is missing')); break; case UPLOAD_ERR_NO_TMP_DIR: case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_EXTENSION: - notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator')); + DI::sysmsg()->addNotice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator')); break; } @unlink($src); @@ -663,7 +663,7 @@ function photos_post(App $a) $maximagesize = DI::config()->get('system', 'maximagesize'); if ($maximagesize && ($filesize > $maximagesize)) { - notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); + DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); @unlink($src); $foo = 0; Hook::callAll('photo_post_end', $foo); @@ -671,7 +671,7 @@ function photos_post(App $a) } if (!$filesize) { - notice(DI::l10n()->t('Image file is empty.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image file is empty.')); @unlink($src); $foo = 0; Hook::callAll('photo_post_end', $foo); @@ -686,7 +686,7 @@ function photos_post(App $a) if (!$image->isValid()) { Logger::notice('unable to process image'); - notice(DI::l10n()->t('Unable to process image.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image.')); @unlink($src); $foo = 0; Hook::callAll('photo_post_end',$foo); @@ -712,7 +712,7 @@ function photos_post(App $a) if (!$r) { Logger::warning('image store failed'); - notice(DI::l10n()->t('Image upload failed.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.')); return; } @@ -799,12 +799,12 @@ function photos_content(App $a) } if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { - notice(DI::l10n()->t('Public access denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.')); return; } if (empty($user)) { - notice(DI::l10n()->t('No photos selected')); + DI::sysmsg()->addNotice(DI::l10n()->t('No photos selected')); return; } @@ -873,7 +873,7 @@ function photos_content(App $a) } if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) { - notice(DI::l10n()->t('Access to this item is restricted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.')); return; } @@ -888,7 +888,7 @@ function photos_content(App $a) // Display upload form if ($datatype === 'upload') { if (!$can_post) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -1088,9 +1088,9 @@ function photos_content(App $a) if (!DBA::isResult($ph)) { if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) { - notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied. Access to this item may be restricted.')); } else { - notice(DI::l10n()->t('Photo not available')); + DI::sysmsg()->addNotice(DI::l10n()->t('Photo not available')); } return; } diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php index b2ca61218..bc2c8bba2 100644 --- a/mod/repair_ostatus.php +++ b/mod/repair_ostatus.php @@ -28,7 +28,7 @@ use Friendica\Model\Contact; function repair_ostatus_content(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('ostatus_repair'); // NOTREACHED } diff --git a/mod/settings.php b/mod/settings.php index 2e21c2682..093572f18 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -37,7 +37,7 @@ use Friendica\Protocol\Email; function settings_init(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -47,7 +47,7 @@ function settings_init(App $a) function settings_post(App $a) { if (!$a->isLoggedIn()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -119,7 +119,7 @@ function settings_post(App $a) $mbox = Email::connect($mb, $mail_user, $dcrpass); unset($dcrpass); if (!$mbox) { - notice(DI::l10n()->t('Failed to connect with email account using the settings provided.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Failed to connect with email account using the settings provided.')); } } } @@ -148,12 +148,12 @@ function settings_content(App $a) Nav::setSelected('settings'); if (!local_user()) { - //notice(DI::l10n()->t('Permission denied.')); + //DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } if (!empty($_SESSION['submanage'])) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return ''; } diff --git a/mod/uimport.php b/mod/uimport.php index fb1ef25c3..da024a56e 100644 --- a/mod/uimport.php +++ b/mod/uimport.php @@ -30,7 +30,7 @@ use Friendica\DI; function uimport_post(App $a) { if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -43,7 +43,7 @@ function uimport_post(App $a) function uimport_content(App $a) { if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) { - notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.')); + DI::sysmsg()->addNotice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.')); return; } @@ -52,7 +52,7 @@ function uimport_content(App $a) $total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]); if ($total >= $max_dailies) { Logger::notice('max daily registrations exceeded.'); - notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); + DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); return; } } diff --git a/mod/unfollow.php b/mod/unfollow.php index 10830bd10..61c88ee9e 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -32,7 +32,7 @@ use Friendica\Util\Strings; function unfollow_post(App $a) { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('login'); // NOTREACHED } @@ -47,7 +47,7 @@ function unfollow_content(App $a) $base_return_path = 'contact'; if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('login'); // NOTREACHED } @@ -62,13 +62,13 @@ function unfollow_content(App $a) $contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition); if (!DBA::isResult($contact)) { - notice(DI::l10n()->t("You aren't following this contact.")); + DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact.")); DI::baseUrl()->redirect($base_return_path); // NOTREACHED } if (!Protocol::supportsFollow($contact['network'])) { - notice(DI::l10n()->t('Unfollowing is currently not supported by your network.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unfollowing is currently not supported by your network.')); DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']); // NOTREACHED } @@ -79,7 +79,7 @@ function unfollow_content(App $a) $self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]); if (!DBA::isResult($self)) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect($base_return_path); // NOTREACHED } @@ -131,7 +131,7 @@ function unfollow_process(string $url) $contact = DBA::selectFirst('contact', [], $condition); if (!DBA::isResult($contact)) { - notice(DI::l10n()->t("You aren't following this contact.")); + DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact.")); DI::baseUrl()->redirect($base_return_path); // NOTREACHED } @@ -146,6 +146,6 @@ function unfollow_process(string $url) $notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator'); } - notice($notice_message); + DI::sysmsg()->addNotice($notice_message); DI::baseUrl()->redirect($return_path); } diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 43f4681df..8341d7252 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -66,7 +66,7 @@ function wall_attach_post(App $a) { if ($r_json) { System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]); } - notice(DI::l10n()->t('Permission denied.') . EOL ); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.') . EOL ); System::exit(); } @@ -95,7 +95,7 @@ function wall_attach_post(App $a) { if ($r_json) { System::jsonExit(['error' => $msg]); } else { - notice($msg); + DI::sysmsg()->addNotice($msg); } System::exit(); } diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 4554c55aa..befb0fceb 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -88,7 +88,7 @@ function wall_upload_post(App $a, $desktopmode = true) if ($r_json) { System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]); } - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); System::exit(); } @@ -147,7 +147,7 @@ function wall_upload_post(App $a, $desktopmode = true) if ($r_json) { System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]); } - notice(DI::l10n()->t('Invalid request.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Invalid request.')); System::exit(); } diff --git a/mod/wallmessage.php b/mod/wallmessage.php index e8f7d24e3..2b4b8d2a5 100644 --- a/mod/wallmessage.php +++ b/mod/wallmessage.php @@ -34,7 +34,7 @@ function wallmessage_post(App $a) { $replyto = Profile::getMyURL(); if (!$replyto) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -53,13 +53,13 @@ function wallmessage_post(App $a) { } if (!$user['unkmail']) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } $total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]); if ($total > $user['cntunkmail']) { - notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])); return; } @@ -67,16 +67,16 @@ function wallmessage_post(App $a) { switch ($ret) { case -1: - notice(DI::l10n()->t('No recipient selected.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.')); break; case -2: - notice(DI::l10n()->t('Unable to check your home location.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to check your home location.')); break; case -3: - notice(DI::l10n()->t('Message could not be sent.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.')); break; case -4: - notice(DI::l10n()->t('Message collection failure.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.')); break; } @@ -87,33 +87,33 @@ function wallmessage_post(App $a) { function wallmessage_content(App $a) { if (!Profile::getMyURL()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } $recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : ''); if (!$recipient) { - notice(DI::l10n()->t('No recipient.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.')); return; } $user = User::getByNickname($recipient); if (empty($user)) { - notice(DI::l10n()->t('No recipient.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.')); Logger::notice('wallmessage: no recipient'); return; } if (!$user['unkmail']) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } $total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]); if ($total > $user['cntunkmail']) { - notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])); return; } diff --git a/src/BaseModule.php b/src/BaseModule.php index 99c297b75..e532b9536 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -397,7 +397,7 @@ abstract class BaseModule implements ICanHandleRequests if (!self::checkFormSecurityToken($typename, $formname)) { Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename); Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]); - notice(self::getFormSecurityStandardErrorMessage()); + DI::sysmsg()->addNotice(self::getFormSecurityStandardErrorMessage()); DI::baseUrl()->redirect($err_redirect); } } diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index f8485fc29..be7bbf0b5 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -123,13 +123,13 @@ class UserImport $account = json_decode(file_get_contents($file['tmp_name']), true); if ($account === null) { - notice(DI::l10n()->t("Error decoding account file")); + DI::sysmsg()->addNotice(DI::l10n()->t("Error decoding account file")); return; } if (empty($account['version'])) { - notice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?")); + DI::sysmsg()->addNotice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?")); return; } @@ -137,7 +137,7 @@ class UserImport // check if username matches deleted account if (DBA::exists('user', ['nickname' => $account['user']['nickname']]) || DBA::exists('userd', ['username' => $account['user']['nickname']])) { - notice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname'])); + DI::sysmsg()->addNotice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname'])); return; } @@ -173,7 +173,7 @@ class UserImport $r = self::dbImportAssoc('user', $account['user']); if ($r === false) { Logger::warning("uimport:insert user : ERROR : " . DBA::errorMessage()); - notice(DI::l10n()->t("User creation error")); + DI::sysmsg()->addNotice(DI::l10n()->t("User creation error")); return; } $newuid = self::lastInsertId(); @@ -218,7 +218,7 @@ class UserImport } } if ($errorcount > 0) { - notice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount)); + DI::sysmsg()->addNotice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount)); } foreach ($account['group'] as &$group) { @@ -271,7 +271,7 @@ class UserImport if ($r === false) { Logger::warning("uimport:insert profile: ERROR : " . DBA::errorMessage()); - notice(DI::l10n()->t("User profile creation error")); + DI::sysmsg()->addNotice(DI::l10n()->t("User profile creation error")); DBA::delete('user', ['uid' => $newuid]); DBA::delete('profile_field', ['uid' => $newuid]); return; @@ -324,7 +324,7 @@ class UserImport // send relocate messages Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid); - info(DI::l10n()->t("Done. You can now login with your username and password")); + DI::sysmsg()->addInfo(DI::l10n()->t("Done. You can now login with your username and password")); DI::baseUrl()->redirect('login'); } } diff --git a/src/Model/Group.php b/src/Model/Group.php index 4dec84c3a..3487ab53d 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -102,7 +102,7 @@ class Group $group = DBA::selectFirst('group', ['deleted'], ['id' => $gid]); if (DBA::isResult($group) && $group['deleted']) { DBA::update('group', ['deleted' => 0], ['id' => $gid]); - notice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.')); + DI::sysmsg()->addNotice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.')); } return true; } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index f6d189a10..b58de4efb 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -865,7 +865,7 @@ class Profile $a->setContactId($arr['visitor']['id']); - info(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name'])); + DI::sysmsg()->addInfo(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name'])); Logger::info('OpenWebAuth: auth success from ' . $visitor['addr']); } diff --git a/src/Module/Admin/Addons/Details.php b/src/Module/Admin/Addons/Details.php index 28435c545..be0e59e32 100644 --- a/src/Module/Admin/Addons/Details.php +++ b/src/Module/Admin/Addons/Details.php @@ -62,7 +62,7 @@ class Details extends BaseAdmin $addon = Strings::sanitizeFilePathItem($this->parameters['addon']); if (!is_file("addon/$addon/$addon.php")) { - notice(DI::l10n()->t('Addon not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Addon not found.')); Addon::uninstall($addon); DI::baseUrl()->redirect('admin/addons'); } @@ -73,10 +73,10 @@ class Details extends BaseAdmin // Toggle addon status if (Addon::isEnabled($addon)) { Addon::uninstall($addon); - info(DI::l10n()->t('Addon %s disabled.', $addon)); + DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon)); } else { Addon::install($addon); - info(DI::l10n()->t('Addon %s enabled.', $addon)); + DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s enabled.', $addon)); } DI::baseUrl()->redirect('admin/addons/' . $addon); diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index b9198ee36..8db0b70ed 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -39,18 +39,18 @@ class Index extends BaseAdmin switch ($_GET['action']) { case 'reload': Addon::reload(); - info(DI::l10n()->t('Addons reloaded')); + DI::sysmsg()->addInfo(DI::l10n()->t('Addons reloaded')); break; case 'toggle' : $addon = $_GET['addon'] ?? ''; if (Addon::isEnabled($addon)) { Addon::uninstall($addon); - info(DI::l10n()->t('Addon %s disabled.', $addon)); + DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon)); } elseif (Addon::install($addon)) { - info(DI::l10n()->t('Addon %s enabled.', $addon)); + DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s enabled.', $addon)); } else { - notice(DI::l10n()->t('Addon %s failed to install.', $addon)); + DI::sysmsg()->addNotice(DI::l10n()->t('Addon %s failed to install.', $addon)); } break; diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index 35a8a151d..85e7f2146 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -46,12 +46,12 @@ class Contact extends BaseAdmin if (!empty($_POST['page_contactblock_block'])) { $contact = Model\Contact::getByURL($contact_url, null, ['id', 'nurl']); if (empty($contact)) { - notice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url)); + DI::sysmsg()->addNotice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url)); DI::baseUrl()->redirect('admin/blocklist/contact'); } if (Network::isLocalLink($contact['nurl'])) { - notice(DI::l10n()->t('You can\'t block a local contact, please block the user instead')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t block a local contact, please block the user instead')); DI::baseUrl()->redirect('admin/blocklist/contact'); } @@ -63,14 +63,14 @@ class Contact extends BaseAdmin } } - info(DI::l10n()->t('The contact has been blocked from the node')); + DI::sysmsg()->addInfo(DI::l10n()->t('The contact has been blocked from the node')); } if (!empty($_POST['page_contactblock_unblock'])) { foreach ($contacts as $uid) { Model\Contact::unblock($uid); } - info(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts))); } DI::baseUrl()->redirect('admin/blocklist/contact'); diff --git a/src/Module/Admin/DBSync.php b/src/Module/Admin/DBSync.php index d5a16f9be..bb1fa9033 100644 --- a/src/Module/Admin/DBSync.php +++ b/src/Module/Admin/DBSync.php @@ -48,7 +48,7 @@ class DBSync extends BaseAdmin DI::config()->set('system', 'build', intval($curr) + 1); } - info(DI::l10n()->t('Update has been marked successful')); + DI::sysmsg()->addInfo(DI::l10n()->t('Update has been marked successful')); } break; diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index e52156051..d291e7b84 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -50,7 +50,7 @@ class Delete extends BaseAdmin Item::markForDeletion(['guid' => $guid]); } - info(DI::l10n()->t('Item marked for deletion.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Item marked for deletion.')); DI::baseUrl()->redirect('admin/item/delete'); } diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index 9dbc8f352..e5324e6f6 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -44,7 +44,7 @@ class Settings extends BaseAdmin if (is_file($logfile) && !is_writeable($logfile)) { - notice(DI::l10n()->t('The logfile \'%s\' is not writable. No logging possible', $logfile)); + DI::sysmsg()->addNotice(DI::l10n()->t('The logfile \'%s\' is not writable. No logging possible', $logfile)); return; } diff --git a/src/Module/Admin/Storage.php b/src/Module/Admin/Storage.php index f54344f47..207553437 100644 --- a/src/Module/Admin/Storage.php +++ b/src/Module/Admin/Storage.php @@ -43,7 +43,7 @@ class Storage extends BaseAdmin /** @var ICanConfigureStorage|false $newStorageConfig */ $newStorageConfig = DI::storageManager()->getConfigurationByName($storagebackend); } catch (InvalidClassStorageException $storageException) { - notice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend)); + DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend)); DI::baseUrl()->redirect('admin/storage'); } @@ -70,7 +70,7 @@ class Storage extends BaseAdmin $storage_form_errors = $newStorageConfig->saveOptions($storage_opts_data); if (count($storage_form_errors)) { foreach ($storage_form_errors as $name => $err) { - notice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err)); + DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err)); } DI::baseUrl()->redirect('admin/storage'); } @@ -81,10 +81,10 @@ class Storage extends BaseAdmin $newstorage = DI::storageManager()->getWritableStorageByName($storagebackend); if (!DI::storageManager()->setBackend($newstorage)) { - notice(DI::l10n()->t('Invalid storage backend setting value.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.')); } } catch (InvalidClassStorageException $storageException) { - notice(DI::l10n()->t('Invalid storage backend setting value.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.')); } } diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index dc6bf5818..45573cbe6 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -36,7 +36,7 @@ class Details extends BaseAdmin $theme = Strings::sanitizeFilePathItem($this->parameters['theme']); if (!is_dir("view/theme/$theme")) { - notice(DI::l10n()->t("Item not found.")); + DI::sysmsg()->addNotice(DI::l10n()->t("Item not found.")); return ''; } @@ -54,11 +54,11 @@ class Details extends BaseAdmin if ($isEnabled) { Theme::uninstall($theme); - info(DI::l10n()->t('Theme %s disabled.', $theme)); + DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme)); } elseif (Theme::install($theme)) { - info(DI::l10n()->t('Theme %s successfully enabled.', $theme)); + DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme)); } else { - notice(DI::l10n()->t('Theme %s failed to install.', $theme)); + DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme)); } DI::baseUrl()->redirect('admin/themes/' . $theme); diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 439e78e64..756b90afa 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -77,7 +77,7 @@ class Embed extends BaseAdmin $theme = Strings::sanitizeFilePathItem($this->parameters['theme']); if (!is_dir("view/theme/$theme")) { - notice($this->t('Unknown theme.')); + DI::sysmsg()->addNotice($this->t('Unknown theme.')); return ''; } diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index cf0ddcfc6..4dde4f856 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -48,7 +48,7 @@ class Index extends BaseAdmin } Theme::setAllowedList($allowed_themes); - info(DI::l10n()->t('Themes reloaded')); + DI::sysmsg()->addInfo(DI::l10n()->t('Themes reloaded')); break; case 'toggle' : @@ -56,17 +56,17 @@ class Index extends BaseAdmin if ($theme) { $theme = Strings::sanitizeFilePathItem($theme); if (!is_dir("view/theme/$theme")) { - notice(DI::l10n()->t('Item not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.')); return ''; } if (in_array($theme, Theme::getAllowedList())) { Theme::uninstall($theme); - info(DI::l10n()->t('Theme %s disabled.', $theme)); + DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s disabled.', $theme)); } elseif (Theme::install($theme)) { - info(DI::l10n()->t('Theme %s successfully enabled.', $theme)); + DI::sysmsg()->addInfo(DI::l10n()->t('Theme %s successfully enabled.', $theme)); } else { - notice(DI::l10n()->t('Theme %s failed to install.', $theme)); + DI::sysmsg()->addNotice(DI::l10n()->t('Theme %s failed to install.', $theme)); } } diff --git a/src/Module/Admin/Users/Active.php b/src/Module/Admin/Users/Active.php index eac12063e..2188d4a59 100644 --- a/src/Module/Admin/Users/Active.php +++ b/src/Module/Admin/Users/Active.php @@ -42,7 +42,7 @@ class Active extends BaseUsers foreach ($users as $uid) { User::block($uid); } - info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users))); } if (!empty($_POST['page_users_delete'])) { @@ -50,11 +50,11 @@ class Active extends BaseUsers if (local_user() != $uid) { User::remove($uid); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } } - info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); } DI::baseUrl()->redirect(DI::args()->getQueryString()); @@ -70,7 +70,7 @@ class Active extends BaseUsers if ($uid) { $user = User::getById($uid, ['username', 'blocked']); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('User not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found')); DI::baseUrl()->redirect('admin/users'); return ''; // NOTREACHED } @@ -83,9 +83,9 @@ class Active extends BaseUsers // delete user User::remove($uid); - notice(DI::l10n()->t('User "%s" deleted', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username'])); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } DI::baseUrl()->redirect('admin/users/active'); @@ -93,7 +93,7 @@ class Active extends BaseUsers case 'block': self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't'); User::block($uid); - notice(DI::l10n()->t('User "%s" blocked', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username'])); DI::baseUrl()->redirect('admin/users/active'); break; } diff --git a/src/Module/Admin/Users/Blocked.php b/src/Module/Admin/Users/Blocked.php index 63294f17c..e8434d5e0 100644 --- a/src/Module/Admin/Users/Blocked.php +++ b/src/Module/Admin/Users/Blocked.php @@ -43,7 +43,7 @@ class Blocked extends BaseUsers foreach ($users as $uid) { User::block($uid, false); } - info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users))); } if (!empty($_POST['page_users_delete'])) { @@ -51,11 +51,11 @@ class Blocked extends BaseUsers if (local_user() != $uid) { User::remove($uid); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } } - info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); } DI::baseUrl()->redirect('admin/users/blocked'); @@ -71,7 +71,7 @@ class Blocked extends BaseUsers if ($uid) { $user = User::getById($uid, ['username', 'blocked']); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('User not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found')); DI::baseUrl()->redirect('admin/users'); return ''; // NOTREACHED } @@ -84,16 +84,16 @@ class Blocked extends BaseUsers // delete user User::remove($uid); - notice(DI::l10n()->t('User "%s" deleted', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username'])); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } DI::baseUrl()->redirect('admin/users/blocked'); break; case 'unblock': self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't'); User::block($uid, false); - notice(DI::l10n()->t('User "%s" unblocked', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username'])); DI::baseUrl()->redirect('admin/users/blocked'); break; } diff --git a/src/Module/Admin/Users/Create.php b/src/Module/Admin/Users/Create.php index 5ab443b14..29dbf5d7e 100644 --- a/src/Module/Admin/Users/Create.php +++ b/src/Module/Admin/Users/Create.php @@ -44,7 +44,7 @@ class Create extends BaseUsers User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language); DI::baseUrl()->redirect('admin/users'); } catch (\Exception $ex) { - notice($ex->getMessage()); + DI::sysmsg()->addNotice($ex->getMessage()); } } diff --git a/src/Module/Admin/Users/Index.php b/src/Module/Admin/Users/Index.php index 8dfac5057..e8356720d 100644 --- a/src/Module/Admin/Users/Index.php +++ b/src/Module/Admin/Users/Index.php @@ -42,14 +42,14 @@ class Index extends BaseUsers foreach ($users as $uid) { User::block($uid); } - info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users))); } if (!empty($_POST['page_users_unblock'])) { foreach ($users as $uid) { User::block($uid, false); } - info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users))); } if (!empty($_POST['page_users_delete'])) { @@ -57,11 +57,11 @@ class Index extends BaseUsers if (local_user() != $uid) { User::remove($uid); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } } - info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users))); } DI::baseUrl()->redirect(DI::args()->getQueryString()); @@ -77,7 +77,7 @@ class Index extends BaseUsers if ($uid) { $user = User::getById($uid, ['username', 'blocked']); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('User not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found')); DI::baseUrl()->redirect('admin/users'); return ''; // NOTREACHED } @@ -90,9 +90,9 @@ class Index extends BaseUsers // delete user User::remove($uid); - notice(DI::l10n()->t('User "%s" deleted', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username'])); } else { - notice(DI::l10n()->t('You can\'t remove yourself')); + DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself')); } DI::baseUrl()->redirect('admin/users'); @@ -100,13 +100,13 @@ class Index extends BaseUsers case 'block': self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't'); User::block($uid); - notice(DI::l10n()->t('User "%s" blocked', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username'])); DI::baseUrl()->redirect('admin/users'); break; case 'unblock': self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't'); User::block($uid, false); - notice(DI::l10n()->t('User "%s" unblocked', $user['username'])); + DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username'])); DI::baseUrl()->redirect('admin/users'); break; } diff --git a/src/Module/Admin/Users/Pending.php b/src/Module/Admin/Users/Pending.php index b5b164bb5..484a128eb 100644 --- a/src/Module/Admin/Users/Pending.php +++ b/src/Module/Admin/Users/Pending.php @@ -45,14 +45,14 @@ class Pending extends BaseUsers foreach ($pending as $hash) { User::allow($hash); } - info(DI::l10n()->tt('%s user approved', '%s users approved', count($pending))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s user approved', '%s users approved', count($pending))); } if (!empty($_POST['page_users_deny'])) { foreach ($pending as $hash) { User::deny($hash); } - info(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending))); + DI::sysmsg()->addInfo(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending))); } DI::baseUrl()->redirect('admin/users/pending'); @@ -68,7 +68,7 @@ class Pending extends BaseUsers if ($uid) { $user = User::getById($uid, ['username', 'blocked']); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('User not found')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found')); DI::baseUrl()->redirect('admin/users'); return ''; // NOTREACHED } @@ -78,13 +78,13 @@ class Pending extends BaseUsers case 'allow': self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't'); User::allow(Register::getPendingForUser($uid)['hash'] ?? ''); - notice(DI::l10n()->t('Account approved.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Account approved.')); DI::baseUrl()->redirect('admin/users/pending'); break; case 'deny': self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't'); User::deny(Register::getPendingForUser($uid)['hash'] ?? ''); - notice(DI::l10n()->t('Registration revoked')); + DI::sysmsg()->addNotice(DI::l10n()->t('Registration revoked')); DI::baseUrl()->redirect('admin/users/pending'); break; } diff --git a/src/Module/Apps.php b/src/Module/Apps.php index db5636bf9..9ef4268de 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -28,6 +28,7 @@ use Friendica\Content\Nav; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Util\Profiler; use Psr\Log\LoggerInterface; @@ -51,7 +52,7 @@ class Apps extends BaseModule $apps = Nav::getAppMenu(); if (count($apps) == 0) { - notice($this->t('No installed applications.')); + DI::sysmsg()->addNotice($this->t('No installed applications.')); } $tpl = Renderer::getMarkupTemplate('apps.tpl'); diff --git a/src/Module/BaseAdmin.php b/src/Module/BaseAdmin.php index 713c44cc2..dd4e108e7 100644 --- a/src/Module/BaseAdmin.php +++ b/src/Module/BaseAdmin.php @@ -54,7 +54,7 @@ abstract class BaseAdmin extends BaseModule { if (!local_user()) { if ($interactive) { - notice(DI::l10n()->t('Please login to continue.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Please login to continue.')); Session::set('return_path', DI::args()->getQueryString()); DI::baseUrl()->redirect('login'); } else { diff --git a/src/Module/BaseSearch.php b/src/Module/BaseSearch.php index 276598131..f14a93b0f 100644 --- a/src/Module/BaseSearch.php +++ b/src/Module/BaseSearch.php @@ -116,7 +116,7 @@ class BaseSearch extends BaseModule protected static function printResult(ResultList $results, Pager $pager, string $header = ''): string { if ($results->getTotal() == 0) { - notice(DI::l10n()->t('No matches')); + DI::sysmsg()->addNotice(DI::l10n()->t('No matches')); return ''; } diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 4f565a871..97f4b7e25 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -85,7 +85,7 @@ class Contact extends BaseModule } } if ($count_actions > 0) { - info(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions)); + DI::sysmsg()->addInfo(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions)); } DI::baseUrl()->redirect($redirectUrl); diff --git a/src/Module/Contact/Advanced.php b/src/Module/Contact/Advanced.php index bbb1d59e0..d722691ff 100644 --- a/src/Module/Contact/Advanced.php +++ b/src/Module/Contact/Advanced.php @@ -30,6 +30,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Session; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model; use Friendica\Module\Contact; use Friendica\Module\Response; @@ -96,7 +97,7 @@ class Advanced extends BaseModule } if (!$r) { - notice($this->t('Contact update failed.')); + DI::sysmsg()->addNotice($this->t('Contact update failed.')); } } diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index 793d0fa4a..3af591a06 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -35,6 +35,7 @@ use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Group; use Friendica\Module; @@ -124,7 +125,7 @@ class Profile extends BaseModule } if (!Contact::update($fields, ['id' => $cdata['user'], 'uid' => local_user()])) { - notice($this->t('Failed to update contact record.')); + DI::sysmsg()->addNotice($this->t('Failed to update contact record.')); } } @@ -182,7 +183,7 @@ class Profile extends BaseModule } // @TODO: add $this->localRelationship->save($localRelationship); - info($message); + DI::sysmsg()->addInfo($message); } if ($cmd === 'ignore') { @@ -198,7 +199,7 @@ class Profile extends BaseModule } // @TODO: add $this->localRelationship->save($localRelationship); - info($message); + DI::sysmsg()->addInfo($message); } $this->baseUrl->redirect('contact/' . $contact['id']); diff --git a/src/Module/Contact/Revoke.php b/src/Module/Contact/Revoke.php index 35cb48149..4ade2b146 100644 --- a/src/Module/Contact/Revoke.php +++ b/src/Module/Contact/Revoke.php @@ -28,6 +28,7 @@ use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model; use Friendica\Module\Contact; use Friendica\Module\Response; @@ -87,7 +88,7 @@ class Revoke extends BaseModule Model\Contact::revokeFollow($this->contact); - notice($this->t('Follow was successfully revoked.')); + DI::sysmsg()->addNotice($this->t('Follow was successfully revoked.')); $this->baseUrl->redirect('contact/' . $this->parameters['id']); } diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php index 3ba95e1ef..a5bfe4190 100644 --- a/src/Module/Conversation/Community.php +++ b/src/Module/Conversation/Community.php @@ -155,7 +155,7 @@ class Community extends BaseModule $items = self::getItems(); if (!DBA::isResult($items)) { - notice(DI::l10n()->t('No results.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No results.')); return $o; } diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index c36876b34..cc6146a89 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -170,7 +170,7 @@ class Network extends BaseModule if (self::$groupId) { $group = DBA::selectFirst('group', ['name'], ['id' => self::$groupId, 'uid' => local_user()]); if (!DBA::isResult($group)) { - notice(DI::l10n()->t('No such group')); + DI::sysmsg()->addNotice(DI::l10n()->t('No such group')); } $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [ @@ -184,7 +184,7 @@ class Network extends BaseModule 'id' => DI::args()->get(0), ]) . $o; } else { - notice(DI::l10n()->t('Invalid contact.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Invalid contact.')); } } elseif (!DI::config()->get('theme', 'hide_eventlist')) { $o .= Profile::getBirthdays(); diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php index 46ded4236..fc9f95f07 100644 --- a/src/Module/Debug/Feed.php +++ b/src/Module/Debug/Feed.php @@ -25,6 +25,7 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Model; use Friendica\Module\Response; use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests; @@ -48,7 +49,7 @@ class Feed extends BaseModule $this->httpClient = $httpClient; if (!local_user()) { - notice($this->t('You must be logged in to use this module')); + DI::sysmsg()->addNotice($this->t('You must be logged in to use this module')); $baseUrl->redirect(); } } diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 9fac9db30..f48e2bf7e 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -72,7 +72,7 @@ class Directory extends BaseModule $profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search); if ($profiles['total'] === 0) { - notice(DI::l10n()->t('No entries (some entries may be hidden).')); + DI::sysmsg()->addNotice(DI::l10n()->t('No entries (some entries may be hidden).')); } else { foreach ($profiles['entries'] as $entry) { $contact = Model\Contact::getByURLForUser($entry['url'], local_user()); diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 3dfd7877c..c3b9acadd 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model; use Friendica\Module\Response; use Friendica\Network\HTTPException; @@ -43,7 +44,7 @@ class SaveTag extends BaseModule parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); if (!local_user()) { - notice($this->t('You must be logged in to use this module')); + DI::sysmsg()->addNotice($this->t('You must be logged in to use this module')); $baseUrl->redirect(); } } diff --git a/src/Module/FollowConfirm.php b/src/Module/FollowConfirm.php index b61cfd432..0254bfae3 100644 --- a/src/Module/FollowConfirm.php +++ b/src/Module/FollowConfirm.php @@ -35,7 +35,7 @@ class FollowConfirm extends BaseModule parent::post($request); $uid = local_user(); if (!$uid) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php index d8a42d8de..815c4e1ec 100644 --- a/src/Module/FriendSuggest.php +++ b/src/Module/FriendSuggest.php @@ -28,6 +28,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Worker; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model\Contact as ContactModel; use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Network\HTTPException\NotFoundException; @@ -78,7 +79,7 @@ class FriendSuggest extends BaseModule // We do query the "uid" as well to ensure that it is our contact $contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]); if (empty($contact)) { - notice($this->t('Suggested contact not found.')); + DI::sysmsg()->addNotice($this->t('Suggested contact not found.')); return; } @@ -96,7 +97,7 @@ class FriendSuggest extends BaseModule Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, $suggest->id); - info($this->t('Friend suggestion sent.')); + DI::sysmsg()->addInfo($this->t('Friend suggestion sent.')); } protected function content(array $request = []): string @@ -105,7 +106,7 @@ class FriendSuggest extends BaseModule $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]); if (empty($contact)) { - notice($this->t('Contact not found.')); + DI::sysmsg()->addNotice($this->t('Contact not found.')); $this->baseUrl->redirect(); } diff --git a/src/Module/Group.php b/src/Module/Group.php index cd07e9781..06ee555a7 100644 --- a/src/Module/Group.php +++ b/src/Module/Group.php @@ -39,7 +39,7 @@ class Group extends BaseModule } if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect(); } @@ -55,7 +55,7 @@ class Group extends BaseModule DI::baseUrl()->redirect('group/' . $r); } } else { - notice(DI::l10n()->t('Could not create group.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Could not create group.')); } DI::baseUrl()->redirect('group'); } @@ -66,13 +66,13 @@ class Group extends BaseModule $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user()]); if (!DBA::isResult($group)) { - notice(DI::l10n()->t('Group not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.')); DI::baseUrl()->redirect('contact'); } $groupname = trim($_POST['groupname']); if (strlen($groupname) && ($groupname != $group['name'])) { if (!Model\Group::update($group['id'], $groupname)) { - notice(DI::l10n()->t('Group name was not changed.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Group name was not changed.')); } } } @@ -132,10 +132,10 @@ class Group extends BaseModule throw new \Exception(DI::l10n()->t('Bad request.'), 400); } - info($message); + DI::sysmsg()->addInfo($message); System::jsonExit(['status' => 'OK', 'message' => $message]); } catch (\Exception $e) { - notice($e->getMessage()); + DI::sysmsg()->addNotice($e->getMessage()); System::jsonError($e->getCode(), ['status' => 'error', 'message' => $e->getMessage()]); } } @@ -212,12 +212,12 @@ class Group extends BaseModule // @TODO: Replace with parameter from router if (intval(DI::args()->getArgv()[2])) { if (!Model\Group::exists(DI::args()->getArgv()[2], local_user())) { - notice(DI::l10n()->t('Group not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.')); DI::baseUrl()->redirect('contact'); } if (!Model\Group::remove(DI::args()->getArgv()[2])) { - notice(DI::l10n()->t('Unable to remove group.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to remove group.')); } } DI::baseUrl()->redirect('group'); @@ -236,7 +236,7 @@ class Group extends BaseModule if ((DI::args()->getArgc() > 1) && intval(DI::args()->getArgv()[1])) { $group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user(), 'deleted' => false]); if (!DBA::isResult($group)) { - notice(DI::l10n()->t('Group not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Group not found.')); DI::baseUrl()->redirect('contact'); } diff --git a/src/Module/Invite.php b/src/Module/Invite.php index 77a7585bd..c36a8ad7d 100644 --- a/src/Module/Invite.php +++ b/src/Module/Invite.php @@ -79,7 +79,7 @@ class Invite extends BaseModule $recipient = trim($recipient); if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) { - notice(DI::l10n()->t('%s : Not a valid email address.', $recipient)); + DI::sysmsg()->addNotice(DI::l10n()->t('%s : Not a valid email address.', $recipient)); continue; } @@ -114,15 +114,15 @@ class Invite extends BaseModule $current_invites++; DI::pConfig()->set(local_user(), 'system', 'sent_invites', $current_invites); if ($current_invites > $max_invites) { - notice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.')); return; } } else { - notice(DI::l10n()->t('%s : Message delivery failed.', $recipient)); + DI::sysmsg()->addNotice(DI::l10n()->t('%s : Message delivery failed.', $recipient)); } } - info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total)); + DI::sysmsg()->addInfo(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total)); } protected function content(array $request = []): string diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php index 42ec3b6f7..ffe5d212f 100644 --- a/src/Module/Notifications/Introductions.php +++ b/src/Module/Notifications/Introductions.php @@ -30,6 +30,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Model\User; use Friendica\Module\BaseNotifications; use Friendica\Module\Response; @@ -211,7 +212,7 @@ class Introductions extends BaseNotifications } if (count($notifications['notifications']) == 0) { - notice($this->t('No introductions.')); + DI::sysmsg()->addNotice($this->t('No introductions.')); $notificationNoContent = $this->t('No more %s notifications.', $notifications['ident']); } diff --git a/src/Module/Notifications/Notification.php b/src/Module/Notifications/Notification.php index a28b5d6f6..cacf57ec0 100644 --- a/src/Module/Notifications/Notification.php +++ b/src/Module/Notifications/Notification.php @@ -27,6 +27,7 @@ use Friendica\Contact\Introduction\Repository\Introduction; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Module\Response; use Friendica\Module\Security\Login; @@ -131,7 +132,7 @@ class Notification extends BaseModule protected function content(array $request = []): string { if (!local_user()) { - notice($this->l10n->t('You must be logged in to show this page.')); + DI::sysmsg()->addNotice($this->l10n->t('You must be logged in to show this page.')); return Login::form(); } diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index ccc3208b6..f5e904544 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -106,7 +106,7 @@ class Profile extends BaseProfile $o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']); if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact_id) { - notice(DI::l10n()->t('Access to this profile has been restricted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.')); return ''; } diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index d851d5f47..99f5fe6ba 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -107,7 +107,7 @@ class Status extends BaseProfile $last_updated_key = "profile:" . $profile['uid'] . ":" . local_user() . ":" . $remote_contact; if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact) { - notice(DI::l10n()->t('Access to this profile has been restricted.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.')); return ''; } diff --git a/src/Module/Register.php b/src/Module/Register.php index 95cea1458..35faaa7df 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -74,20 +74,20 @@ class Register extends BaseModule $block = DI::config()->get('system', 'block_extended_register'); if (local_user() && $block) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return ''; } if (local_user()) { $user = DBA::selectFirst('user', ['parent-uid'], ['uid' => local_user()]); if (!empty($user['parent-uid'])) { - notice(DI::l10n()->t('Only parent users can create additional accounts.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Only parent users can create additional accounts.')); return ''; } } if (!local_user() && (intval(DI::config()->get('config', 'register_policy')) === self::CLOSED)) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return ''; } @@ -96,7 +96,7 @@ class Register extends BaseModule $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']); if ($count >= $max_dailies) { Logger::notice('max daily registrations exceeded.'); - notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); + DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); return ''; } } @@ -203,19 +203,19 @@ class Register extends BaseModule $additional_account = false; if (!local_user() && !empty($arr['post']['parent_password'])) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } elseif (local_user() && !empty($arr['post']['parent_password'])) { try { Model\User::getIdFromPasswordAuthentication(local_user(), $arr['post']['parent_password']); } catch (\Exception $ex) { - notice(DI::l10n()->t("Password doesn't match.")); + DI::sysmsg()->addNotice(DI::l10n()->t("Password doesn't match.")); $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']]; DI::baseUrl()->redirect('register?' . http_build_query($regdata)); } $additional_account = true; } elseif (local_user()) { - notice(DI::l10n()->t('Please enter your password.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Please enter your password.')); $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']]; DI::baseUrl()->redirect('register?' . http_build_query($regdata)); } @@ -242,7 +242,7 @@ class Register extends BaseModule case self::CLOSED: default: if (empty($_SESSION['authenticated']) && empty($_SESSION['administrator'])) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } $blocked = 1; @@ -257,14 +257,14 @@ class Register extends BaseModule // Is there text in the tar pit? if (!empty($arr['email'])) { Logger::info('Tar pit', $arr); - notice(DI::l10n()->t('You have entered too much information.')); + DI::sysmsg()->addNotice(DI::l10n()->t('You have entered too much information.')); DI::baseUrl()->redirect('register/'); } if ($additional_account) { $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]); if (!DBA::isResult($user)) { - notice(DI::l10n()->t('User not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('User not found.')); DI::baseUrl()->redirect('register'); } @@ -280,7 +280,7 @@ class Register extends BaseModule if ($arr['email'] != $arr['repeat']) { Logger::info('Mail mismatch', $arr); - notice(DI::l10n()->t('Please enter the identical mail address in the second field.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Please enter the identical mail address in the second field.')); $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']]; DI::baseUrl()->redirect('register?' . http_build_query($regdata)); } @@ -292,7 +292,7 @@ class Register extends BaseModule try { $result = Model\User::create($arr); } catch (\Exception $e) { - notice($e->getMessage()); + DI::sysmsg()->addNotice($e->getMessage()); return; } @@ -307,7 +307,7 @@ class Register extends BaseModule if ($additional_account) { DBA::update('user', ['parent-uid' => local_user()], ['uid' => $user['uid']]); - info(DI::l10n()->t('The additional account was created.')); + DI::sysmsg()->addInfo(DI::l10n()->t('The additional account was created.')); DI::baseUrl()->redirect('delegation'); } @@ -332,28 +332,28 @@ class Register extends BaseModule ); if ($res) { - info(DI::l10n()->t('Registration successful. Please check your email for further instructions.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Registration successful. Please check your email for further instructions.')); DI::baseUrl()->redirect(); } else { - notice( + DI::sysmsg()->addNotice( DI::l10n()->t('Failed to send email message. Here your accout details:
login: %s
password: %s

You can change your password after login.', $user['email'], $result['password']) ); } } else { - info(DI::l10n()->t('Registration successful.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Registration successful.')); DI::baseUrl()->redirect(); } } elseif (intval(DI::config()->get('config', 'register_policy')) === self::APPROVE) { if (!strlen(DI::config()->get('config', 'admin_email'))) { - notice(DI::l10n()->t('Your registration can not be processed.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Your registration can not be processed.')); DI::baseUrl()->redirect(); } // Check if the note to the admin is actually filled out if (empty($_POST['permonlybox'])) { - notice(DI::l10n()->t('You have to leave a request note for the admin.') + DI::sysmsg()->addNotice(DI::l10n()->t('You have to leave a request note for the admin.') . DI::l10n()->t('Your registration can not be processed.')); DI::baseUrl()->redirect('register/'); @@ -399,7 +399,7 @@ class Register extends BaseModule $result['password'] ); - info(DI::l10n()->t('Your registration is pending approval by the site owner.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Your registration is pending approval by the site owner.')); DI::baseUrl()->redirect(); } diff --git a/src/Module/RemoteFollow.php b/src/Module/RemoteFollow.php index 130c76319..05239440d 100644 --- a/src/Module/RemoteFollow.php +++ b/src/Module/RemoteFollow.php @@ -31,6 +31,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Search; use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Profile; use Friendica\Model\User; @@ -68,25 +69,25 @@ class RemoteFollow extends BaseModule } if (empty($this->owner)) { - notice($this->t('Profile unavailable.')); + DI::sysmsg()->addNotice($this->t('Profile unavailable.')); return; } $url = Probe::cleanURI($_POST['dfrn_url']); if (!strlen($url)) { - notice($this->t("Invalid locator")); + DI::sysmsg()->addNotice($this->t("Invalid locator")); return; } // Detect the network, make sure the provided URL is valid $data = Contact::getByURL($url); if (!$data) { - notice($this->t("The provided profile link doesn't seem to be valid")); + DI::sysmsg()->addNotice($this->t("The provided profile link doesn't seem to be valid")); return; } if (empty($data['subscribe'])) { - notice($this->t("Remote subscription can't be done for your network. Please subscribe directly on your system.")); + DI::sysmsg()->addNotice($this->t("Remote subscription can't be done for your network. Please subscribe directly on your system.")); return; } diff --git a/src/Module/Search/Directory.php b/src/Module/Search/Directory.php index 496a3e098..a088282cb 100644 --- a/src/Module/Search/Directory.php +++ b/src/Module/Search/Directory.php @@ -34,7 +34,7 @@ class Directory extends BaseSearch protected function content(array $request = []): string { if (!local_user()) { - notice(DI::l10n()->t('Permission denied.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index db20dd0a3..7dfdca39b 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -149,7 +149,7 @@ class Index extends BaseSearch // Tags don't look like an URL and the fulltext search does only work with natural words if (parse_url($search, PHP_URL_SCHEME) && parse_url($search, PHP_URL_HOST)) { Logger::info('Skipping tag and fulltext search since the search looks like a URL.', ['q' => $search]); - notice(DI::l10n()->t('No results.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No results.')); return $o; } @@ -191,7 +191,7 @@ class Index extends BaseSearch if (empty($items)) { if (empty($last_uriid)) { - notice(DI::l10n()->t('No results.')); + DI::sysmsg()->addNotice(DI::l10n()->t('No results.')); } return $o; } diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php index 4256ffcd4..cea0a9b1a 100644 --- a/src/Module/Search/Saved.php +++ b/src/Module/Search/Saved.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Search; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Module\Response; use Friendica\Util\Profiler; use Psr\Log\LoggerInterface; @@ -55,16 +56,16 @@ class Saved extends BaseModule $fields = ['uid' => local_user(), 'term' => $search]; if (!$this->dba->exists('search', $fields)) { if (!$this->dba->insert('search', $fields)) { - notice($this->t('Search term was not saved.')); + DI::sysmsg()->addNotice($this->t('Search term was not saved.')); } } else { - notice($this->t('Search term already saved.')); + DI::sysmsg()->addNotice($this->t('Search term already saved.')); } break; case 'remove': if (!$this->dba->delete('search', ['uid' => local_user(), 'term' => $search])) { - notice($this->t('Search term was not removed.')); + DI::sysmsg()->addNotice($this->t('Search term was not removed.')); } break; } diff --git a/src/Module/Security/Logout.php b/src/Module/Security/Logout.php index 004292cb5..82c176feb 100644 --- a/src/Module/Security/Logout.php +++ b/src/Module/Security/Logout.php @@ -28,6 +28,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Core\System; +use Friendica\DI; use Friendica\Model\Profile; use Friendica\Model\User\Cookie; use Friendica\Module\Response; @@ -80,7 +81,7 @@ class Logout extends BaseModule if ($visitor_home) { System::externalRedirect($visitor_home); } else { - info($this->t('Logged out.')); + DI::sysmsg()->addInfo($this->t('Logged out.')); $this->baseUrl->redirect(); } } diff --git a/src/Module/Security/OpenID.php b/src/Module/Security/OpenID.php index 7dbb765c6..2675f1fec 100644 --- a/src/Module/Security/OpenID.php +++ b/src/Module/Security/OpenID.php @@ -87,9 +87,9 @@ class OpenID extends BaseModule $session->set('openid_server', $open_id_obj->discover($open_id_obj->identity)); if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED) { - notice($l10n->t('Account not found. Please login to your existing account to add the OpenID to it.')); + DI::sysmsg()->addNotice($l10n->t('Account not found. Please login to your existing account to add the OpenID to it.')); } else { - notice($l10n->t('Account not found. Please register a new account or login to your existing account to add the OpenID to it.')); + DI::sysmsg()->addNotice($l10n->t('Account not found. Please register a new account or login to your existing account to add the OpenID to it.')); } DI::baseUrl()->redirect('login'); diff --git a/src/Module/Security/TwoFactor/Recovery.php b/src/Module/Security/TwoFactor/Recovery.php index 6d8d91dbe..38b341dad 100644 --- a/src/Module/Security/TwoFactor/Recovery.php +++ b/src/Module/Security/TwoFactor/Recovery.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleSessions; +use Friendica\DI; use Friendica\Model\User; use Friendica\Module\Response; use Friendica\Security\Authentication; @@ -70,13 +71,13 @@ class Recovery extends BaseModule if (RecoveryCode::existsForUser(local_user(), $recovery_code)) { RecoveryCode::markUsedForUser(local_user(), $recovery_code); $this->session->set('2fa', true); - info($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user()))); + DI::sysmsg()->addInfo($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user()))); $this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true); $this->baseUrl->redirect($this->session->pop('return_path', '')); } else { - notice($this->t('Invalid code, please retry.')); + DI::sysmsg()->addNotice($this->t('Invalid code, please retry.')); } } } diff --git a/src/Module/Security/TwoFactor/SignOut.php b/src/Module/Security/TwoFactor/SignOut.php index 75efc9e60..ac6e9321f 100644 --- a/src/Module/Security/TwoFactor/SignOut.php +++ b/src/Module/Security/TwoFactor/SignOut.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleSessions; +use Friendica\DI; use Friendica\Model\User\Cookie; use Friendica\Module\Response; use Friendica\Network\HTTPException\NotFoundException; @@ -75,7 +76,7 @@ class SignOut extends BaseModule $this->cookie->reset(['2fa_cookie_hash' => $trusted]); $this->session->clear(); - info($this->t('Logged out.')); + DI::sysmsg()->addInfo($this->t('Logged out.')); $this->baseUrl->redirect(); break; case 'sign_out': @@ -83,7 +84,7 @@ class SignOut extends BaseModule $this->cookie->clear(); $this->session->clear(); - info($this->t('Logged out.')); + DI::sysmsg()->addInfo($this->t('Logged out.')); $this->baseUrl->redirect(); break; default: @@ -105,14 +106,14 @@ class SignOut extends BaseModule $this->cookie->reset(['2fa_cookie_hash' => $trusted]); $this->session->clear(); - info($this->t('Logged out.')); + DI::sysmsg()->addInfo($this->t('Logged out.')); $this->baseUrl->redirect(); } } catch (TwoFactor\Exception\TrustedBrowserNotFoundException $exception) { $this->cookie->clear(); $this->session->clear(); - info($this->t('Logged out.')); + DI::sysmsg()->addInfo($this->t('Logged out.')); $this->baseUrl->redirect(); } diff --git a/src/Module/Security/TwoFactor/Trust.php b/src/Module/Security/TwoFactor/Trust.php index 1f5fb7418..ed24c6b14 100644 --- a/src/Module/Security/TwoFactor/Trust.php +++ b/src/Module/Security/TwoFactor/Trust.php @@ -26,6 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleSessions; +use Friendica\DI; use Friendica\Model\User; use Friendica\Model\User\Cookie; use Friendica\Module\Response; @@ -92,7 +93,7 @@ class Trust extends BaseModule // The string is sent to the browser to be sent back with each request if (!$this->cookie->set('2fa_cookie_hash', $trustedBrowser->cookie_hash)) { - notice($this->t('Couldn\'t save browser to Cookie.')); + DI::sysmsg()->addNotice($this->t('Couldn\'t save browser to Cookie.')); }; } catch (TrustedBrowserPersistenceException $exception) { $this->logger->warning('Unexpected error when saving the trusted browser.', ['trustedBrowser' => $trustedBrowser, 'exception' => $exception]); diff --git a/src/Module/Settings/Account.php b/src/Module/Settings/Account.php index 62ad08a4c..bb262ab1a 100644 --- a/src/Module/Settings/Account.php +++ b/src/Module/Settings/Account.php @@ -75,10 +75,10 @@ class Account extends BaseSettings throw new Exception(DI::l10n()->t('Password update failed. Please try again.')); } - info(DI::l10n()->t('Password changed.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Password changed.')); } catch (Exception $e) { - notice($e->getMessage()); - notice(DI::l10n()->t('Password unchanged.')); + DI::sysmsg()->addNotice($e->getMessage()); + DI::sysmsg()->addNotice(DI::l10n()->t('Password unchanged.')); } DI::baseUrl()->redirect($redirectUrl); @@ -123,7 +123,7 @@ class Account extends BaseSettings } if (strlen($err)) { - notice($err); + DI::sysmsg()->addNotice($err); return; } @@ -146,7 +146,7 @@ class Account extends BaseSettings } if (!User::update($fields, local_user())) { - notice(DI::l10n()->t('Settings were not updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.')); } // clear session language @@ -198,7 +198,7 @@ class Account extends BaseSettings ]; if (!User::update($fields, local_user()) || !Profile::update($profile_fields, local_user())) { - notice(DI::l10n()->t('Settings were not updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.')); } DI::baseUrl()->redirect($redirectUrl); @@ -218,7 +218,7 @@ class Account extends BaseSettings DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only); if (!User::update(['expire' => $expire], local_user())) { - notice(DI::l10n()->t('Settings were not updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.')); } DI::baseUrl()->redirect($redirectUrl); @@ -302,7 +302,7 @@ class Account extends BaseSettings ]; if (!User::update($fields, local_user())) { - notice(DI::l10n()->t('Settings were not updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.')); } DI::baseUrl()->redirect($redirectUrl); @@ -351,7 +351,7 @@ class Account extends BaseSettings ]); if (!User::update($fields, local_user()) || !empty($profile_fields) && !Profile::update($profile_fields, local_user())) { - notice(DI::l10n()->t('Settings were not updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.')); } DI::baseUrl()->redirect($redirectUrl); @@ -363,7 +363,7 @@ class Account extends BaseSettings // was there an error if ($_FILES['importcontact-filename']['error'] > 0) { Logger::notice('Contact CSV file upload error', ['error' => $_FILES['importcontact-filename']['error']]); - notice(DI::l10n()->t('Contact CSV file upload error')); + DI::sysmsg()->addNotice(DI::l10n()->t('Contact CSV file upload error')); } else { $csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name'])); Logger::notice('Import started', ['lines' => count($csvArray)]); @@ -382,7 +382,7 @@ class Account extends BaseSettings } Logger::notice('Import done'); - info(DI::l10n()->t('Importing Contacts done')); + DI::sysmsg()->addInfo(DI::l10n()->t('Importing Contacts done')); // delete temp file unlink($_FILES['importcontact-filename']['tmp_name']); } @@ -395,7 +395,7 @@ class Account extends BaseSettings if (!empty($request['relocate-submit'])) { Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user()); - info(DI::l10n()->t("Relocate message has been send to your contacts")); + DI::sysmsg()->addInfo(DI::l10n()->t("Relocate message has been send to your contacts")); DI::baseUrl()->redirect($redirectUrl); } @@ -412,7 +412,7 @@ class Account extends BaseSettings $profile = DBA::selectFirst('profile', [], ['uid' => local_user()]); if (!DBA::isResult($profile)) { - notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to find your profile. Please contact your admin.')); return ''; } diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php index 75e683e60..aeada0871 100644 --- a/src/Module/Settings/Delegation.php +++ b/src/Module/Settings/Delegation.php @@ -50,13 +50,13 @@ class Delegation extends BaseSettings if ($parent_uid != 0) { try { User::getIdFromPasswordAuthentication($parent_uid, $parent_password); - info(DI::l10n()->t('Delegation successfully granted.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Delegation successfully granted.')); } catch (\Exception $ex) { - notice(DI::l10n()->t('Parent user not found, unavailable or password doesn\'t match.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Parent user not found, unavailable or password doesn\'t match.')); return; } } else { - info(DI::l10n()->t('Delegation successfully revoked.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Delegation successfully revoked.')); } DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]); @@ -78,7 +78,7 @@ class Delegation extends BaseSettings if ($action === 'add' && $user_id) { if (Session::get('submanage')) { - notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); DI::baseUrl()->redirect('settings/delegation'); } @@ -92,7 +92,7 @@ class Delegation extends BaseSettings DBA::insert('manage', ['uid' => $user_id, 'mid' => local_user()]); } } else { - notice(DI::l10n()->t('Delegate user not found.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Delegate user not found.')); } DI::baseUrl()->redirect('settings/delegation'); @@ -100,7 +100,7 @@ class Delegation extends BaseSettings if ($action === 'remove' && $user_id) { if (Session::get('submanage')) { - notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); DI::baseUrl()->redirect('settings/delegation'); } diff --git a/src/Module/Settings/Display.php b/src/Module/Settings/Display.php index 4670bf500..fe42b8718 100644 --- a/src/Module/Settings/Display.php +++ b/src/Module/Settings/Display.php @@ -104,7 +104,7 @@ class Display extends BaseSettings DBA::update('user', ['theme' => $theme], ['uid' => local_user()]); } } else { - notice(DI::l10n()->t('The theme you chose isn\'t available.')); + DI::sysmsg()->addNotice(DI::l10n()->t('The theme you chose isn\'t available.')); } Hook::callAll('display_settings_post', $_POST); diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php index 49130e8c5..eec7468d0 100644 --- a/src/Module/Settings/Profile/Index.php +++ b/src/Module/Settings/Profile/Index.php @@ -80,7 +80,7 @@ class Index extends BaseSettings $name = trim($_POST['name'] ?? ''); if (!strlen($name)) { - notice(DI::l10n()->t('Profile Name is required.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Profile Name is required.')); return; } @@ -128,7 +128,7 @@ class Index extends BaseSettings ); if (!$result) { - notice(DI::l10n()->t('Profile couldn\'t be updated.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Profile couldn\'t be updated.')); return; } @@ -138,7 +138,7 @@ class Index extends BaseSettings protected function content(array $request = []): string { if (!local_user()) { - notice(DI::l10n()->t('You must be logged in to use this module')); + DI::sysmsg()->addNotice(DI::l10n()->t('You must be logged in to use this module')); return Login::form(); } diff --git a/src/Module/Settings/Profile/Photo/Crop.php b/src/Module/Settings/Profile/Photo/Crop.php index ee9ac3246..5afab9503 100644 --- a/src/Module/Settings/Profile/Photo/Crop.php +++ b/src/Module/Settings/Profile/Photo/Crop.php @@ -105,7 +105,7 @@ class Crop extends BaseSettings Photo::USER_AVATAR ); if ($r === false) { - notice(DI::l10n()->t('Image size reduction [%s] failed.', '300')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '300')); } else { Photo::update(['profile' => true], array_merge($condition, ['scale' => 4])); } @@ -123,7 +123,7 @@ class Crop extends BaseSettings Photo::USER_AVATAR ); if ($r === false) { - notice(DI::l10n()->t('Image size reduction [%s] failed.', '80')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '80')); } else { Photo::update(['profile' => true], array_merge($condition, ['scale' => 5])); } @@ -141,19 +141,19 @@ class Crop extends BaseSettings Photo::USER_AVATAR ); if ($r === false) { - notice(DI::l10n()->t('Image size reduction [%s] failed.', '48')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '48')); } else { Photo::update(['profile' => true], array_merge($condition, ['scale' => 6])); } Contact::updateSelfFromUserID(local_user(), true); - info(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.')); // Update global directory in background Profile::publishUpdate(local_user()); } else { - notice(DI::l10n()->t('Unable to process image')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image')); } } @@ -194,7 +194,7 @@ class Crop extends BaseSettings // Update global directory in background Profile::publishUpdate(local_user()); - info(DI::l10n()->t('Profile picture successfully updated.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Profile picture successfully updated.')); DI::baseUrl()->redirect('profile/' . DI::app()->getLoggedInUserNickname()); } diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index ff2a239b5..4f0b5ddad 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -43,7 +43,7 @@ class Index extends BaseSettings self::checkFormSecurityTokenRedirectOnError('/settings/profile/photo', 'settings_profile_photo'); if (empty($_FILES['userfile'])) { - notice(DI::l10n()->t('Missing uploaded image.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Missing uploaded image.')); return; } @@ -57,7 +57,7 @@ class Index extends BaseSettings $maximagesize = DI::config()->get('system', 'maximagesize', 0); if ($maximagesize && $filesize > $maximagesize) { - notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); + DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); @unlink($src); return; } @@ -66,7 +66,7 @@ class Index extends BaseSettings $Image = new Image($imagedata, $filetype); if (!$Image->isValid()) { - notice(DI::l10n()->t('Unable to process image.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image.')); @unlink($src); return; } @@ -93,13 +93,13 @@ class Index extends BaseSettings $filename = ''; if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 0, Photo::USER_AVATAR)) { - notice(DI::l10n()->t('Image upload failed.')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.')); } if ($width > 640 || $height > 640) { $Image->scaleDown(640); if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t(Photo::PROFILE_PHOTOS), 1, Photo::USER_AVATAR)) { - notice(DI::l10n()->t('Image size reduction [%s] failed.', '640')); + DI::sysmsg()->addNotice(DI::l10n()->t('Image size reduction [%s] failed.', '640')); } } diff --git a/src/Module/Settings/TwoFactor/AppSpecific.php b/src/Module/Settings/TwoFactor/AppSpecific.php index 5fc513393..69b509131 100644 --- a/src/Module/Settings/TwoFactor/AppSpecific.php +++ b/src/Module/Settings/TwoFactor/AppSpecific.php @@ -25,6 +25,7 @@ use Friendica\App; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Module\Response; use Friendica\Security\TwoFactor\Model\AppSpecificPassword; use Friendica\Module\BaseSettings; @@ -61,7 +62,7 @@ class AppSpecific extends BaseSettings } if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { - notice($this->t('Please enter your password to access this page.')); + DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.')); $this->baseUrl->redirect('settings/2fa'); } } @@ -79,20 +80,20 @@ class AppSpecific extends BaseSettings case 'generate': $description = $_POST['description'] ?? ''; if (empty($description)) { - notice($this->t('App-specific password generation failed: The description is empty.')); + DI::sysmsg()->addNotice($this->t('App-specific password generation failed: The description is empty.')); $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); } elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) { - notice($this->t('App-specific password generation failed: This description already exists.')); + DI::sysmsg()->addNotice($this->t('App-specific password generation failed: This description already exists.')); $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); } else { $this->appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? ''); - info($this->t('New app-specific password generated.')); + DI::sysmsg()->addInfo($this->t('New app-specific password generated.')); } break; case 'revoke_all' : AppSpecificPassword::deleteAllForUser(local_user()); - info($this->t('App-specific passwords successfully revoked.')); + DI::sysmsg()->addInfo($this->t('App-specific passwords successfully revoked.')); $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); break; } @@ -102,7 +103,7 @@ class AppSpecific extends BaseSettings self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific'); if (AppSpecificPassword::deleteForUser(local_user(), $_POST['revoke_id'])) { - info($this->t('App-specific password successfully revoked.')); + DI::sysmsg()->addInfo($this->t('App-specific password successfully revoked.')); } $this->baseUrl->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password')); diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index 0da49f317..be3d8d232 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -66,7 +66,7 @@ class Index extends BaseSettings DI::pConfig()->delete(local_user(), '2fa', 'verified'); Session::remove('2fa'); - info(DI::l10n()->t('Two-factor authentication successfully disabled.')); + DI::sysmsg()->addInfo(DI::l10n()->t('Two-factor authentication successfully disabled.')); DI::baseUrl()->redirect('settings/2fa'); } break; @@ -98,7 +98,7 @@ class Index extends BaseSettings } catch (FoundException $exception) { // Nothing to do here } catch (\Exception $e) { - notice(DI::l10n()->t($e->getMessage())); + DI::sysmsg()->addNotice(DI::l10n()->t($e->getMessage())); } } diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php index 9d453d5a2..04749f2f8 100644 --- a/src/Module/Settings/TwoFactor/Recovery.php +++ b/src/Module/Settings/TwoFactor/Recovery.php @@ -25,6 +25,7 @@ use Friendica\App; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Module\Response; use Friendica\Security\TwoFactor\Model\RecoveryCode; use Friendica\Module\BaseSettings; @@ -59,7 +60,7 @@ class Recovery extends BaseSettings } if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { - notice($this->t('Please enter your password to access this page.')); + DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.')); $this->baseUrl->redirect('settings/2fa'); } } @@ -75,7 +76,7 @@ class Recovery extends BaseSettings if ($_POST['action'] == 'regenerate') { RecoveryCode::regenerateForUser(local_user()); - info($this->t('New recovery codes successfully generated.')); + DI::sysmsg()->addInfo($this->t('New recovery codes successfully generated.')); $this->baseUrl->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password')); } } diff --git a/src/Module/Settings/TwoFactor/Trusted.php b/src/Module/Settings/TwoFactor/Trusted.php index 140394e07..61f97dbd1 100644 --- a/src/Module/Settings/TwoFactor/Trusted.php +++ b/src/Module/Settings/TwoFactor/Trusted.php @@ -25,6 +25,7 @@ use Friendica\App; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Renderer; +use Friendica\DI; use Friendica\Module\BaseSettings; use Friendica\Module\Response; use Friendica\Security\TwoFactor; @@ -62,7 +63,7 @@ class Trusted extends BaseSettings } if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { - notice($this->t('Please enter your password to access this page.')); + DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.')); $this->baseUrl->redirect('settings/2fa'); } } @@ -79,7 +80,7 @@ class Trusted extends BaseSettings switch ($_POST['action']) { case 'remove_all': $this->trustedBrowserRepo->removeAllForUser(local_user()); - info($this->t('Trusted browsers successfully removed.')); + DI::sysmsg()->addInfo($this->t('Trusted browsers successfully removed.')); $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password')); break; } @@ -89,7 +90,7 @@ class Trusted extends BaseSettings self::checkFormSecurityTokenRedirectOnError('settings/2fa/trusted', 'settings_2fa_trusted'); if ($this->trustedBrowserRepo->removeForUser(local_user(), $_POST['remove_id'])) { - info($this->t('Trusted browser successfully removed.')); + DI::sysmsg()->addInfo($this->t('Trusted browser successfully removed.')); } $this->baseUrl->redirect('settings/2fa/trusted?t=' . self::getFormSecurityToken('settings_2fa_password')); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 7b5bea385..3d7db0118 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -30,6 +30,7 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Renderer; use Friendica\Core\Session; +use Friendica\DI; use Friendica\Module\BaseSettings; use Friendica\Module\Response; use Friendica\Module\Security\Login; @@ -65,7 +66,7 @@ class Verify extends BaseSettings } if (!self::checkFormSecurityToken('settings_2fa_password', 't')) { - notice($this->t('Please enter your password to access this page.')); + DI::sysmsg()->addNotice($this->t('Please enter your password to access this page.')); $this->baseUrl->redirect('settings/2fa'); } } @@ -87,11 +88,11 @@ class Verify extends BaseSettings $this->pConfig->set(local_user(), '2fa', 'verified', true); Session::set('2fa', true); - info($this->t('Two-factor authentication successfully activated.')); + DI::sysmsg()->addInfo($this->t('Two-factor authentication successfully activated.')); $this->baseUrl->redirect('settings/2fa'); } else { - notice($this->t('Invalid code, please retry.')); + DI::sysmsg()->addNotice($this->t('Invalid code, please retry.')); } } } diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php index 42dc02340..3cd7b76bc 100644 --- a/src/Security/Authentication.php +++ b/src/Security/Authentication.php @@ -223,7 +223,7 @@ class Authentication // if it's an email address or doesn't resolve to a URL, fail. if ($noid || strpos($openid_url, '@') || !Network::isUrlValid($openid_url)) { - notice($this->l10n->t('Login failed.')); + DI::sysmsg()->addNotice($this->l10n->t('Login failed.')); $this->baseUrl->redirect(); } @@ -237,7 +237,7 @@ class Authentication $openid->optional = ['namePerson/friendly', 'contact/email', 'namePerson', 'namePerson/first', 'media/image/aspect11', 'media/image/default']; System::externalRedirect($openid->authUrl()); } catch (Exception $e) { - notice($this->l10n->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '

' . $this->l10n->t('The error message was:') . ' ' . $e->getMessage()); + DI::sysmsg()->addNotice($this->l10n->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '

' . $this->l10n->t('The error message was:') . ' ' . $e->getMessage()); } } @@ -268,7 +268,7 @@ class Authentication ); } catch (Exception $e) { $this->logger->warning('authenticate: failed login attempt', ['action' => 'login', 'username' => $username, 'ip' => $this->remoteAddress]); - notice($this->l10n->t('Login failed. Please check your credentials.')); + DI::sysmsg()->addNotice($this->l10n->t('Login failed. Please check your credentials.')); $this->baseUrl->redirect(); } @@ -379,8 +379,8 @@ class Authentication if ($interactive) { if ($user_record['login_date'] <= DBA::NULL_DATETIME) { - info($this->l10n->t('Welcome %s', $user_record['username'])); - info($this->l10n->t('Please upload a profile photo.')); + DI::sysmsg()->addInfo($this->l10n->t('Welcome %s', $user_record['username'])); + DI::sysmsg()->addInfo($this->l10n->t('Please upload a profile photo.')); $this->baseUrl->redirect('settings/profile/photo/new'); } } From 497fc4e43216b72deca14b3213244e25eed4108b Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 17 Oct 2022 21:25:04 +0200 Subject: [PATCH 047/641] Move Monolog to Addons --- bin/console.php | 3 + composer.json | 2 +- composer.lock | 84 +------- doc/Addons.md | 4 + doc/de/Addons.md | 4 + src/Core/Logger/Factory/Logger.php | 179 +++++++----------- .../Logger/Type/Monolog/DevelopHandler.php | 76 -------- .../Type/Monolog/IntrospectionProcessor.php | 62 ------ src/Core/Logger/Type/README.md | 1 - src/Database/Database.php | 7 +- tests/src/Core/Cache/DatabaseCacheTest.php | 3 +- .../src/Core/Storage/DatabaseStorageTest.php | 3 +- .../Storage/Repository/StorageManagerTest.php | 2 +- 13 files changed, 92 insertions(+), 338 deletions(-) delete mode 100644 src/Core/Logger/Type/Monolog/DevelopHandler.php delete mode 100644 src/Core/Logger/Type/Monolog/IntrospectionProcessor.php diff --git a/bin/console.php b/bin/console.php index 3e588acd6..41e017248 100755 --- a/bin/console.php +++ b/bin/console.php @@ -26,6 +26,7 @@ if (php_sapi_name() !== 'cli') { } use Dice\Dice; +use Friendica\DI; use Psr\Log\LoggerInterface; require dirname(__DIR__) . '/vendor/autoload.php'; @@ -33,6 +34,8 @@ require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); +/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class +DI::init($dice); \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); (new Friendica\Core\Console($dice, $argv))->execute(); diff --git a/composer.json b/composer.json index cc3a0db5f..959e8de31 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,6 @@ "michelf/php-markdown": "^1.7", "minishlink/web-push": "^6.0", "mobiledetect/mobiledetectlib": "^2.8", - "monolog/monolog": "^1.25", "nikic/fast-route": "^1.3", "paragonie/hidden-string": "^1.0", "patrickschur/language-detection": "^5.0.0", @@ -50,6 +49,7 @@ "pragmarx/google2fa": "^5.0", "pragmarx/recovery": "^0.2", "psr/container": "^1.0", + "psr/log": "^1.1", "seld/cli-prompt": "^1.0", "smarty/smarty": "^4", "ua-parser/uap-php": "^3.9", diff --git a/composer.lock b/composer.lock index 9de7fd696..96949561b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f5922f03b367e68a5930df6ed80c5c2f", + "content-hash": "c851fbba46ed090d0fbaf68e9b3b94df", "packages": [ { "name": "asika/simple-console", @@ -1543,88 +1543,6 @@ ], "time": "2022-02-17T19:24:25+00:00" }, - { - "name": "monolog/monolog", - "version": "1.27.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", - "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpstan/phpstan": "^0.12.59", - "phpunit/phpunit": "~4.5", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ], - "time": "2022-06-09T08:53:42+00:00" - }, { "name": "nikic/fast-route", "version": "v1.3.0", diff --git a/doc/Addons.md b/doc/Addons.md index bbc0ed61c..91765ec48 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -919,6 +919,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- Hook::callAll('block', $hook_data); Hook::callAll('unblock', $hook_data); +### src/Core/Logger/Factory.php + + Hook::callAll('logger_instance', $data); + ### src/Core/StorageManager Hook::callAll('storage_instance', $data); diff --git a/doc/de/Addons.md b/doc/de/Addons.md index 5a4ca98a0..342dd1b81 100644 --- a/doc/de/Addons.md +++ b/doc/de/Addons.md @@ -405,6 +405,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap Hook::callAll('block', $hook_data); Hook::callAll('unblock', $hook_data); +### src/Core/Logger/Factory.php + + Hook::callAll('logger_instance', $data); + ### src/Core/StorageManager Hook::callAll('storage_instance', $data); diff --git a/src/Core/Logger/Factory/Logger.php b/src/Core/Logger/Factory/Logger.php index 954784c95..4df7d8eca 100644 --- a/src/Core/Logger/Factory/Logger.php +++ b/src/Core/Logger/Factory/Logger.php @@ -22,19 +22,16 @@ namespace Friendica\Core\Logger\Factory; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Logger\Exception\LoggerException; use Friendica\Core; use Friendica\Core\Logger\Exception\LogLevelException; use Friendica\Database\Database; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Util\FileSystem; use Friendica\Core\Logger\Util\Introspection; -use Friendica\Core\Logger\Type\Monolog\DevelopHandler; -use Friendica\Core\Logger\Type\Monolog\IntrospectionProcessor; use Friendica\Core\Logger\Type\ProfilerLogger; use Friendica\Core\Logger\Type\StreamLogger; use Friendica\Core\Logger\Type\SyslogLogger; use Friendica\Util\Profiler; -use Monolog; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; use Psr\Log\NullLogger; @@ -60,9 +57,15 @@ class Logger /** @var string The log-channel (app, worker, ...) */ private $channel; - public function __construct(string $channel) + public function __construct(string $channel, bool $includeAddon = true) { $this->channel = $channel; + + /// @fixme clean solution = Making Addon & Hook dynamic and load them inside the constructor, so there's no custom load logic necessary anymore + if ($includeAddon) { + Core\Addon::loadAddons(); + Core\Hook::loadHooks(); + } } /** @@ -88,35 +91,9 @@ class Logger $minLevel = $minLevel ?? $config->get('system', 'loglevel'); $loglevel = self::mapLegacyConfigDebugLevel((string)$minLevel); - switch ($config->get('system', 'logger_config', 'stream')) { - case 'monolog': - $loggerTimeZone = new \DateTimeZone('UTC'); - Monolog\Logger::setTimezone($loggerTimeZone); - - $logger = new Monolog\Logger($this->channel); - $logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor()); - $logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor()); - $logger->pushProcessor(new Monolog\Processor\UidProcessor()); - $logger->pushProcessor(new IntrospectionProcessor($introspection, LogLevel::DEBUG)); - - $stream = $config->get('system', 'logfile'); - - // just add a stream in case it's either writable or not file - if (!is_file($stream) || is_writable($stream)) { - try { - static::addStreamHandler($logger, $stream, $loglevel); - } catch (\Throwable $e) { - // No Logger .. - try { - $logger = new SyslogLogger($this->channel, $introspection, $loglevel); - } catch (\Throwable $e) { - // No logger ... - $logger = new NullLogger(); - } - } - } - break; + $name = $config->get('system', 'logger_config', 'stream'); + switch ($name) { case 'syslog': try { $logger = new SyslogLogger($this->channel, $introspection, $loglevel, $config->get('system', 'syslog_flags', SyslogLogger::DEFAULT_FLAGS), $config->get('system', 'syslog_facility', SyslogLogger::DEFAULT_FACILITY)); @@ -132,29 +109,48 @@ class Logger case 'stream': default: - $stream = $config->get('system', 'logfile'); - // just add a stream in case it's either writable or not file - if (!is_file($stream) || is_writable($stream)) { - try { - $logger = new StreamLogger($this->channel, $stream, $introspection, $fileSystem, $loglevel); - } catch (LogLevelException $exception) { - // If there's a wrong config value for loglevel, try again with standard - $logger = $this->create($database, $config, $profiler, $fileSystem, LogLevel::NOTICE); - $logger->warning('Invalid loglevel set in config.', ['loglevel' => $loglevel]); - } catch (\Throwable $t) { - // No logger ... - $logger = new NullLogger(); - } - } else { - try { - $logger = new SyslogLogger($this->channel, $introspection, $loglevel); - } catch (LogLevelException $exception) { - // If there's a wrong config value for loglevel, try again with standard - $logger = $this->create($database, $config, $profiler, $fileSystem, LogLevel::NOTICE); - $logger->warning('Invalid loglevel set in config.', ['loglevel' => $loglevel]); - } catch (\Throwable $e) { - // No logger ... - $logger = new NullLogger(); + $data = [ + 'name' => $name, + 'channel' => $this->channel, + 'introspection' => $introspection, + 'loglevel' => $loglevel, + 'logger' => null, + ]; + try { + Core\Hook::callAll('logger_instance', $data); + } catch (InternalServerErrorException $exception) { + $data['logger'] = null; + } + + if (($data['logger'] ?? null) instanceof LoggerInterface) { + $logger = $data['logger']; + } + + if (empty($logger)) { + $stream = $config->get('system', 'logfile'); + // just add a stream in case it's either writable or not file + if (!is_file($stream) || is_writable($stream)) { + try { + $logger = new StreamLogger($this->channel, $stream, $introspection, $fileSystem, $loglevel); + } catch (LogLevelException $exception) { + // If there's a wrong config value for loglevel, try again with standard + $logger = $this->create($database, $config, $profiler, $fileSystem, LogLevel::NOTICE); + $logger->warning('Invalid loglevel set in config.', ['loglevel' => $loglevel]); + } catch (\Throwable $t) { + // No logger ... + $logger = new NullLogger(); + } + } else { + try { + $logger = new SyslogLogger($this->channel, $introspection, $loglevel); + } catch (LogLevelException $exception) { + // If there's a wrong config value for loglevel, try again with standard + $logger = $this->create($database, $config, $profiler, $fileSystem, LogLevel::NOTICE); + $logger->warning('Invalid loglevel set in config.', ['loglevel' => $loglevel]); + } catch (\Throwable $e) { + // No logger ... + $logger = new NullLogger(); + } } } break; @@ -197,27 +193,11 @@ class Logger return new NullLogger(); } - $loggerTimeZone = new \DateTimeZone('UTC'); - Monolog\Logger::setTimezone($loggerTimeZone); - $introspection = new Introspection(self::$ignoreClassList); - switch ($config->get('system', 'logger_config', 'stream')) { + $name = $config->get('system', 'logger_config', 'stream'); - case 'monolog': - $loggerTimeZone = new \DateTimeZone('UTC'); - Monolog\Logger::setTimezone($loggerTimeZone); - - $logger = new Monolog\Logger(self::DEV_CHANNEL); - $logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor()); - $logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor()); - $logger->pushProcessor(new Monolog\Processor\UidProcessor()); - $logger->pushProcessor(new IntrospectionProcessor($introspection, LogLevel::DEBUG)); - - $logger->pushHandler(new DevelopHandler($developerIp)); - - static::addStreamHandler($logger, $stream, LogLevel::DEBUG); - break; + switch ($name) { case 'syslog': $logger = new SyslogLogger(self::DEV_CHANNEL, $introspection, LogLevel::DEBUG); @@ -225,6 +205,23 @@ class Logger case 'stream': default: + $data = [ + 'name' => $name, + 'channel' => self::DEV_CHANNEL, + 'introspection' => $introspection, + 'loglevel' => LogLevel::DEBUG, + 'logger' => null, + ]; + try { + Core\Hook::callAll('logger_instance', $data); + } catch (InternalServerErrorException $exception) { + $data['logger'] = null; + } + + if (($data['logger'] ?? null) instanceof LoggerInterface) { + return $data['logger']; + } + $logger = new StreamLogger(self::DEV_CHANNEL, $stream, $introspection, $fileSystem, LogLevel::DEBUG); break; } @@ -273,38 +270,4 @@ class Logger return $level; } } - - /** - * Adding a handler to a given logger instance - * - * @param LoggerInterface $logger The logger instance - * @param mixed $stream The stream which handles the logger output - * @param string $level The level, for which this handler at least should handle logging - * - * @return void - * - * @throws LoggerException - */ - public static function addStreamHandler(LoggerInterface $logger, $stream, string $level = LogLevel::NOTICE) - { - if ($logger instanceof Monolog\Logger) { - $loglevel = Monolog\Logger::toMonologLevel($level); - - // fallback to notice if an invalid loglevel is set - if (!is_int($loglevel)) { - $loglevel = LogLevel::NOTICE; - } - - try { - $fileHandler = new Monolog\Handler\StreamHandler($stream, $loglevel); - - $formatter = new Monolog\Formatter\LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n"); - $fileHandler->setFormatter($formatter); - - $logger->pushHandler($fileHandler); - } catch (\Exception $exception) { - throw new LoggerException('Cannot create Monolog Logger.', $exception); - } - } - } } diff --git a/src/Core/Logger/Type/Monolog/DevelopHandler.php b/src/Core/Logger/Type/Monolog/DevelopHandler.php deleted file mode 100644 index febb8d6cd..000000000 --- a/src/Core/Logger/Type/Monolog/DevelopHandler.php +++ /dev/null @@ -1,76 +0,0 @@ -. - * - */ - -namespace Friendica\Core\Logger\Type\Monolog; - -use Friendica\App\Request; -use Monolog\Handler; -use Monolog\Logger; - -/** - * Simple handler for Friendica developers to use for deeper logging - * - * If you want to debug only interactions from your IP or the IP of a remote server for federation debug, - * you'll use Logger::develop() for the duration of your work, and you clean it up when you're done before submitting your PR. - */ -class DevelopHandler extends Handler\AbstractHandler -{ - /** - * @var string The IP of the developer who wants to debug - */ - private $developerIp; - - /** - * @var string The IP of the current request - */ - private $remoteAddress; - - /** - * @param Request $request The current http request - * @param string $developerIp The IP of the developer who wants to debug - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(Request $request, $developerIp, int $level = Logger::DEBUG, bool $bubble = true) - { - parent::__construct($level, $bubble); - - $this->developerIp = $developerIp; - $this->remoteAddress = $request->getRemoteAddress(); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record): bool - { - if (!$this->isHandling($record)) { - return false; - } - - /// Just in case the remote IP is the same as the developer IP log the output - if (!is_null($this->developerIp) && $this->remoteAddress != $this->developerIp) { - return false; - } - - return false === $this->bubble; - } -} diff --git a/src/Core/Logger/Type/Monolog/IntrospectionProcessor.php b/src/Core/Logger/Type/Monolog/IntrospectionProcessor.php deleted file mode 100644 index 99a9defaf..000000000 --- a/src/Core/Logger/Type/Monolog/IntrospectionProcessor.php +++ /dev/null @@ -1,62 +0,0 @@ -. - * - */ - -namespace Friendica\Core\Logger\Type\Monolog; - -use Friendica\Core\Logger\Util\Introspection; -use Monolog\Logger; -use Monolog\Processor\ProcessorInterface; - -/** - * Injects line/file//function where the log message came from - */ -class IntrospectionProcessor implements ProcessorInterface -{ - private $level; - - private $introspection; - - /** - * @param Introspection $introspection Holds the Introspection of the current call - * @param string|int $level The minimum logging level at which this Processor will be triggered - */ - public function __construct(Introspection $introspection, $level = Logger::DEBUG) - { - $this->level = Logger::toMonologLevel($level); - $introspection->addClasses(['Monolog\\']); - $this->introspection = $introspection; - } - - public function __invoke(array $record): array - { - // return if the level is not high enough - if ($record['level'] < $this->level) { - return $record; - } - // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], - $this->introspection->getRecord() - ); - - return $record; - } -} diff --git a/src/Core/Logger/Type/README.md b/src/Core/Logger/Type/README.md index 449403194..b204353c0 100644 --- a/src/Core/Logger/Type/README.md +++ b/src/Core/Logger/Type/README.md @@ -5,7 +5,6 @@ This namespace contains the different implementations of a Logger. ### Configuration guideline The following settings are possible for `logger_config`: -- `monolog`: A Logging framework with lots of additions (see [Monolog](https://github.com/Seldaek/monolog/)). There are just Friendica additions inside the Monolog directory - [`stream`](StreamLogger.php): A small logger for files or streams - [`syslog`](SyslogLogger.php): Prints the logging output into the syslog diff --git a/src/Database/Database.php b/src/Database/Database.php index fde5bd9f1..79c39e9af 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -36,6 +36,7 @@ use PDO; use PDOException; use PDOStatement; use Psr\Log\LoggerInterface; +use Psr\Log\NullLogger; /** * This class is for the low level database stuff that does driver specific things. @@ -80,15 +81,17 @@ class Database /** @var ViewDefinition */ protected $viewDefinition; - public function __construct(Cache $configCache, Profiler $profiler, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition, LoggerInterface $logger) + public function __construct(Cache $configCache, Profiler $profiler, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition) { // We are storing these values for being able to perform a reconnect $this->configCache = $configCache; $this->profiler = $profiler; - $this->logger = $logger; $this->dbaDefinition = $dbaDefinition; $this->viewDefinition = $viewDefinition; + // Temporary NullLogger until we can fetch the logger class from the config + $this->logger = new NullLogger(); + $this->connect(); } diff --git a/tests/src/Core/Cache/DatabaseCacheTest.php b/tests/src/Core/Cache/DatabaseCacheTest.php index 71b488bcb..e0d47c264 100644 --- a/tests/src/Core/Cache/DatabaseCacheTest.php +++ b/tests/src/Core/Cache/DatabaseCacheTest.php @@ -48,7 +48,6 @@ class DatabaseCacheTest extends CacheTest protected function getInstance() { - $logger = new NullLogger(); $profiler = Mockery::mock(Profiler::class); $profiler->shouldReceive('startRecording'); $profiler->shouldReceive('stopRecording'); @@ -62,7 +61,7 @@ class DatabaseCacheTest extends CacheTest $dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load(); $viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load(); - $dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $logger); + $dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition); $this->cache = new Cache\Type\DatabaseCache('database', $dba); return $this->cache; diff --git a/tests/src/Core/Storage/DatabaseStorageTest.php b/tests/src/Core/Storage/DatabaseStorageTest.php index 75bbc4239..2933fab52 100644 --- a/tests/src/Core/Storage/DatabaseStorageTest.php +++ b/tests/src/Core/Storage/DatabaseStorageTest.php @@ -47,7 +47,6 @@ class DatabaseStorageTest extends StorageTest protected function getInstance() { - $logger = new NullLogger(); $profiler = \Mockery::mock(Profiler::class); $profiler->shouldReceive('startRecording'); $profiler->shouldReceive('stopRecording'); @@ -61,7 +60,7 @@ class DatabaseStorageTest extends StorageTest $dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load(); $viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load(); - $dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $logger); + $dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition); return new Database($dba); } diff --git a/tests/src/Core/Storage/Repository/StorageManagerTest.php b/tests/src/Core/Storage/Repository/StorageManagerTest.php index 99dee27a6..27af7f837 100644 --- a/tests/src/Core/Storage/Repository/StorageManagerTest.php +++ b/tests/src/Core/Storage/Repository/StorageManagerTest.php @@ -87,7 +87,7 @@ class StorageManagerTest extends DatabaseTest $dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load(); $viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load(); - $this->dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $this->logger); + $this->dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition); $configModel = new Repository\Config($this->dba, new Mode(Mode::DBCONFIGAVAILABLE)); $this->config = new PreloadConfig($configCache, $configModel); From 33ac39c33547984a9f32115155e435df1abc59c1 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Oct 2022 21:11:00 +0000 Subject: [PATCH 048/641] The user related functions moved to the session class --- boot.php | 50 +++-------------------------------- src/BaseModule.php | 2 +- src/Core/Session.php | 62 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 47 deletions(-) diff --git a/boot.php b/boot.php index 24486f413..32a1494c6 100644 --- a/boot.php +++ b/boot.php @@ -27,7 +27,7 @@ * easily as email does today. */ -use Friendica\Model\Contact; +use Friendica\Core\Session; /** * Constant with a HTML line break. @@ -55,22 +55,6 @@ if (!defined('SIGTERM')) { define('SIGTERM', 15); } -/** - * Depending on the PHP version this constant does exist - or not. - * See here: http://php.net/manual/en/curl.constants.php#117928 - */ -if (!defined('CURLE_OPERATION_TIMEDOUT')) { - define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED); -} - -if (!function_exists('exif_imagetype')) { - function exif_imagetype($file) - { - $size = getimagesize($file); - return $size[2]; - } -} - /** * Returns the user id of locally logged in user or false. * @@ -78,11 +62,7 @@ if (!function_exists('exif_imagetype')) { */ function local_user() { - if (!empty($_SESSION['authenticated']) && !empty($_SESSION['uid'])) { - return intval($_SESSION['uid']); - } - - return false; + return Session::getLocalUser(); } /** @@ -92,21 +72,7 @@ function local_user() */ function public_contact() { - static $public_contact_id = false; - - if (!$public_contact_id && !empty($_SESSION['authenticated'])) { - if (!empty($_SESSION['my_address'])) { - // Local user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, false)); - } elseif (!empty($_SESSION['visitor_home'])) { - // Remote user - $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, false)); - } - } elseif (empty($_SESSION['authenticated'])) { - $public_contact_id = false; - } - - return $public_contact_id; + return Session::getPublicContact(); } /** @@ -116,13 +82,5 @@ function public_contact() */ function remote_user() { - if (empty($_SESSION['authenticated'])) { - return false; - } - - if (!empty($_SESSION['visitor_id'])) { - return intval($_SESSION['visitor_id']); - } - - return false; + return Session::getRemoteUser(); } diff --git a/src/BaseModule.php b/src/BaseModule.php index e532b9536..09107f047 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -389,7 +389,7 @@ abstract class BaseModule implements ICanHandleRequests public static function getFormSecurityStandardErrorMessage(): string { - return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.") . EOL; + return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it."); } public static function checkFormSecurityTokenRedirectOnError(string $err_redirect, string $typename = '', string $formname = 'form_security_token') diff --git a/src/Core/Session.php b/src/Core/Session.php index 059cd499c..859dd8aa2 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -69,6 +69,68 @@ class Session DI::session()->clear(); } + /** + * Returns the user id of locally logged in user or false. + * + * @return int|bool user id or false + */ + public static function getLocalUser() + { + $session = DI::session(); + + if (!empty($session->get('authenticated')) && !empty($session->get('uid'))) { + return intval($session->get('uid')); + } + + return false; + } + + /** + * Returns the public contact id of logged in user or false. + * + * @return int|bool public contact id or false + */ + public static function getPublicContact() + { + static $public_contact_id = false; + + $session = DI::session(); + + if (!$public_contact_id && !empty($session->get('authenticated'))) { + if (!empty($session->get('my_address'))) { + // Local user + $public_contact_id = intval(Contact::getIdForURL($session->get('my_address'), 0, false)); + } elseif (!empty($session->get('visitor_home'))) { + // Remote user + $public_contact_id = intval(Contact::getIdForURL($session->get('visitor_home'), 0, false)); + } + } elseif (empty($session->get('authenticated'))) { + $public_contact_id = false; + } + + return $public_contact_id; + } + + /** + * Returns public contact id of authenticated site visitor or false + * + * @return int|bool visitor_id or false + */ + public static function getRemoteUser() + { + $session = DI::session(); + + if (empty($session->get('authenticated'))) { + return false; + } + + if (!empty($session->get('visitor_id'))) { + return intval($session->get('visitor_id')); + } + + return false; + } + /** * Return the user contact ID of a visitor for the given user ID they are visiting * From 27e9f2b223176e4d26c00e98f9741eca82f4bb63 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Oct 2022 04:35:06 +0000 Subject: [PATCH 049/641] SIGTERM moved --- boot.php | 7 +------ src/App.php | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index 32a1494c6..d43ef8b0d 100644 --- a/boot.php +++ b/boot.php @@ -36,7 +36,7 @@ use Friendica\Core\Session; * feed for the source. * This can be used in HTML and JavaScript where needed a line break. */ -define('EOL', "
\r\n"); +define('EOL', "
\r\n"); /** * @name Gravity @@ -50,11 +50,6 @@ define('GRAVITY_COMMENT', 6); define('GRAVITY_UNKNOWN', 9); /* @}*/ -// Normally this constant is defined - but not if "pcntl" isn't installed -if (!defined('SIGTERM')) { - define('SIGTERM', 15); -} - /** * Returns the user id of locally logged in user or false. * diff --git a/src/App.php b/src/App.php index d46f69843..55b3e72e0 100644 --- a/src/App.php +++ b/src/App.php @@ -351,6 +351,11 @@ class App { set_time_limit(0); + // Normally this constant is defined - but not if "pcntl" isn't installed + if (!defined('SIGTERM')) { + define('SIGTERM', 15); + } + // Ensure that all "strtotime" operations do run timezone independent date_default_timezone_set('UTC'); From 810ea228f0cbcecf19d64ead7e39997976cff15c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 18 Oct 2022 07:57:59 +0200 Subject: [PATCH 050/641] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- boot.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot.php b/boot.php index d43ef8b0d..36a0745d6 100644 --- a/boot.php +++ b/boot.php @@ -54,6 +54,7 @@ define('GRAVITY_UNKNOWN', 9); * Returns the user id of locally logged in user or false. * * @return int|bool user id or false + * @deprecated since version 2022.12, use Core\Session::getLocalUser() instead */ function local_user() { @@ -64,6 +65,7 @@ function local_user() * Returns the public contact id of logged in user or false. * * @return int|bool public contact id or false + * @deprecated since version 2022.12, use Core\Session:: getPublicContact() instead */ function public_contact() { @@ -74,6 +76,7 @@ function public_contact() * Returns public contact id of authenticated site visitor or false * * @return int|bool visitor_id or false + * @deprecated since version 2022.12, use Core\Session:: getRemoteUser() instead */ function remote_user() { From d43122c6d8eb7ef59b36299f1e1296c81f6a2799 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Oct 2022 08:02:55 +0000 Subject: [PATCH 051/641] Check the readability before acessing /proc/loadavg --- src/Core/System.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Core/System.php b/src/Core/System.php index 0c1e499d9..8a8f273a8 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -442,10 +442,13 @@ class System */ public static function getLoadAvg(): array { - $content = @file_get_contents('/proc/loadavg'); - if (empty($content)) { - $content = shell_exec('cat /proc/loadavg'); + if (is_readable('/proc/loadavg')) { + $content = @file_get_contents('/proc/loadavg'); + if (empty($content)) { + $content = shell_exec('cat /proc/loadavg'); + } } + if (empty($content) || !preg_match("#([.\d]+)\s([.\d]+)\s([.\d]+)\s(\d+)/(\d+)#", $content, $matches)) { $load_arr = sys_getloadavg(); if (empty($load_arr)) { From 6f68679375616a28634115cb63f9f22928419055 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Oct 2022 12:29:50 +0000 Subject: [PATCH 052/641] The EOL constant is removed --- boot.php | 9 --------- mod/wall_attach.php | 8 ++++---- mod/wall_upload.php | 6 +++--- src/Content/Conversation.php | 2 +- src/Core/Installer.php | 32 ++++++++++++++++---------------- src/Database/DBStructure.php | 2 +- src/Model/Contact.php | 18 +++++++++--------- src/Model/User.php | 2 +- src/Module/Install.php | 2 +- src/Object/EMail/ItemCCEMail.php | 4 ++-- 10 files changed, 38 insertions(+), 47 deletions(-) diff --git a/boot.php b/boot.php index 36a0745d6..1716956fa 100644 --- a/boot.php +++ b/boot.php @@ -29,15 +29,6 @@ use Friendica\Core\Session; -/** - * Constant with a HTML line break. - * - * Contains a HTML line break (br) element and a real carriage return with line - * feed for the source. - * This can be used in HTML and JavaScript where needed a line break. - */ -define('EOL', "
\r\n"); - /** * @name Gravity * diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 8341d7252..8a3ed7606 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -66,7 +66,7 @@ function wall_attach_post(App $a) { if ($r_json) { System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]); } - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.') . EOL ); + DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); System::exit(); } @@ -90,7 +90,7 @@ function wall_attach_post(App $a) { */ if ($filesize <= 0) { - $msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?')); + $msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . '
' . (DI::l10n()->t('Or - did you try to upload an empty file?')); @unlink($src); if ($r_json) { System::jsonExit(['error' => $msg]); @@ -106,7 +106,7 @@ function wall_attach_post(App $a) { if ($r_json) { System::jsonExit(['error' => $msg]); } else { - echo $msg . EOL; + echo $msg . '
'; } System::exit(); } @@ -120,7 +120,7 @@ function wall_attach_post(App $a) { if ($r_json) { System::jsonExit(['error' => $msg]); } else { - echo $msg . EOL; + echo $msg . '
'; } System::exit(); } diff --git a/mod/wall_upload.php b/mod/wall_upload.php index befb0fceb..efea196fd 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -165,7 +165,7 @@ function wall_upload_post(App $a, $desktopmode = true) if ($r_json) { System::jsonExit(['error' => $msg]); } else { - echo $msg. EOL; + echo $msg . '
'; } System::exit(); } @@ -203,7 +203,7 @@ function wall_upload_post(App $a, $desktopmode = true) if ($r_json) { System::jsonExit(['error' => $msg]); } else { - echo $msg. EOL; + echo $msg . '
'; } System::exit(); } @@ -227,7 +227,7 @@ function wall_upload_post(App $a, $desktopmode = true) if ($r_json) { System::jsonExit(['error' => $msg]); } else { - echo $msg. EOL; + echo $msg . '
'; } System::exit(); } diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 84f75cff3..a38182849 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -261,7 +261,7 @@ class Conversation break; } - $expanded .= "\t" . ''; + $expanded .= "\t" . ''; } $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('voting_fakelink.tpl'), [ diff --git a/src/Core/Installer.php b/src/Core/Installer.php index 9a9bdfb5f..1d29a5cf9 100644 --- a/src/Core/Installer.php +++ b/src/Core/Installer.php @@ -197,7 +197,7 @@ class Installer $result = DBStructure::install(); if ($result) { - $txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL; + $txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . '
'; $txt .= DI::l10n()->t('Please see the file "doc/INSTALL.md".'); $this->addCheck($txt, false, true, htmlentities($result, ENT_COMPAT, 'UTF-8')); @@ -259,9 +259,9 @@ class Installer $help = ""; if (!$passed) { - $help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . EOL; - $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . EOL; - $help .= EOL . EOL; + $help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . '
'; + $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See 'Setup the worker'") . '
'; + $help .= '

'; $tpl = Renderer::getMarkupTemplate('field_input.tpl'); /// @todo Separate backend Installer class and presentation layer/view $help .= Renderer::replaceMacros($tpl, [ @@ -279,7 +279,7 @@ class Installer [$result] = explode("\n", $result); $help = ""; if (!$passed2) { - $help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . EOL; + $help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . '
'; $help .= DI::l10n()->t('Found PHP version: ') . "$result"; } $this->addCheck(DI::l10n()->t('PHP cli binary'), $passed2, true, $help); @@ -295,7 +295,7 @@ class Installer $passed3 = $result == $str; $help = ""; if (!$passed3) { - $help .= DI::l10n()->t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . EOL; + $help .= DI::l10n()->t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . '
'; $help .= DI::l10n()->t('This is required for message delivery to work.'); } else { $this->phppath = $phppath; @@ -333,7 +333,7 @@ class Installer // Get private key if (!$res) { - $help .= DI::l10n()->t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL; + $help .= DI::l10n()->t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . '
'; $help .= DI::l10n()->t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".'); $status = false; } @@ -511,10 +511,10 @@ class Installer (!file_exists('config/local.config.php') && !is_writable('.'))) { $status = false; - $help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL; - $help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL; - $help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL; - $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "doc/INSTALL.md" for instructions.') . EOL; + $help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . '
'; + $help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . '
'; + $help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . '
'; + $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "doc/INSTALL.md" for instructions.') . '
'; } $this->addCheck(DI::l10n()->t('config/local.config.php is writable'), $status, false, $help); @@ -537,10 +537,10 @@ class Installer if (!is_writable('view/smarty3')) { $status = false; - $help = DI::l10n()->t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . EOL; - $help .= DI::l10n()->t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . EOL; - $help .= DI::l10n()->t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . EOL; - $help .= DI::l10n()->t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . EOL; + $help = DI::l10n()->t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . '
'; + $help .= DI::l10n()->t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . '
'; + $help .= DI::l10n()->t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . '
'; + $help .= DI::l10n()->t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . '
'; } $this->addCheck(DI::l10n()->t('view/smarty3 is writable'), $status, true, $help); @@ -571,7 +571,7 @@ class Installer if ($fetchResult->getReturnCode() != 204) { $status = false; - $help = DI::l10n()->t('Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-dist to .htaccess.') . EOL; + $help = DI::l10n()->t('Url rewrite in .htaccess seems not working. Make sure you copied .htaccess-dist to .htaccess.') . '
'; $help .= DI::l10n()->t('In some circumstances (like running inside containers), you can skip this error.'); $error_msg = []; $error_msg['head'] = DI::l10n()->t('Error message from Curl when fetching'); diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index d14e791e2..74bd5b423 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -150,7 +150,7 @@ class DBStructure echo DI::l10n()->t("\nError %d occurred during database update:\n%s\n", DBA::errorNo(), DBA::errorMessage()); - return DI::l10n()->t('Errors encountered performing database changes: ') . $message . EOL; + return DI::l10n()->t('Errors encountered performing database changes: ') . $message . '
'; } /** diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 434c2b1f6..ca23c09f6 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2853,30 +2853,30 @@ class Contact // do we have enough information? if (empty($protocol) || ($protocol == Protocol::PHANTOM) || (empty($ret['url']) && empty($ret['addr']))) { - $result['message'] .= DI::l10n()->t('The profile address specified does not provide adequate information.') . EOL; + $result['message'] .= DI::l10n()->t('The profile address specified does not provide adequate information.') . '
'; if (empty($ret['poll'])) { - $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL; + $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . '
'; } if (empty($ret['name'])) { - $result['message'] .= DI::l10n()->t('An author or name was not found.') . EOL; + $result['message'] .= DI::l10n()->t('An author or name was not found.') . '
'; } if (empty($ret['url'])) { - $result['message'] .= DI::l10n()->t('No browser URL could be matched to this address.') . EOL; + $result['message'] .= DI::l10n()->t('No browser URL could be matched to this address.') . '
'; } if (strpos($ret['url'], '@') !== false) { - $result['message'] .= DI::l10n()->t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL; - $result['message'] .= DI::l10n()->t('Use mailto: in front of address to force email check.') . EOL; + $result['message'] .= DI::l10n()->t('Unable to match @-style Identity Address with a known protocol or email contact.') . '
'; + $result['message'] .= DI::l10n()->t('Use mailto: in front of address to force email check.') . '
'; } return $result; } if ($protocol === Protocol::OSTATUS && DI::config()->get('system', 'ostatus_disabled')) { - $result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . EOL; + $result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . '
'; $ret['notify'] = ''; } if (!$ret['notify']) { - $result['message'] .= DI::l10n()->t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL; + $result['message'] .= DI::l10n()->t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . '
'; } $writeable = ((($protocol === Protocol::OSTATUS) && ($ret['notify'])) ? 1 : 0); @@ -2935,7 +2935,7 @@ class Contact $contact = DBA::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]); if (!DBA::isResult($contact)) { - $result['message'] .= DI::l10n()->t('Unable to retrieve contact information.') . EOL; + $result['message'] .= DI::l10n()->t('Unable to retrieve contact information.') . '
'; return $result; } diff --git a/src/Model/User.php b/src/Model/User.php index 5bd84466f..005e3bbf3 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -994,7 +994,7 @@ class User try { $authurl = $openid->authUrl(); } catch (Exception $e) { - throw new Exception(DI::l10n()->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . DI::l10n()->t('The error message was:') . $e->getMessage(), 0, $e); + throw new Exception(DI::l10n()->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '
' . DI::l10n()->t('The error message was:') . $e->getMessage(), 0, $e); } System::externalRedirect($authurl); // NOTREACHED diff --git a/src/Module/Install.php b/src/Module/Install.php index 843cee9f1..1631cfe7f 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -337,7 +337,7 @@ class Install extends BaseModule if (count($this->installer->getChecks()) == 0) { $txt = '

'; - $txt .= $this->t('Your Friendica site database has been installed.') . EOL; + $txt .= $this->t('Your Friendica site database has been installed.') . '
'; $db_return_text .= $txt; } diff --git a/src/Object/EMail/ItemCCEMail.php b/src/Object/EMail/ItemCCEMail.php index 927a068d7..fd4baa0b9 100644 --- a/src/Object/EMail/ItemCCEMail.php +++ b/src/Object/EMail/ItemCCEMail.php @@ -41,8 +41,8 @@ class ItemCCEMail extends Email $disclaimer = '


' . $l10n->t('This message was sent to you by %s, a member of the Friendica social network.', $user['username']) . '
'; - $disclaimer .= $l10n->t('You may visit them online at %s', $baseUrl . '/profile/' . $a->getLoggedInUserNickname()) . EOL; - $disclaimer .= $l10n->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL; + $disclaimer .= $l10n->t('You may visit them online at %s', $baseUrl . '/profile/' . $a->getLoggedInUserNickname()) . '
'; + $disclaimer .= $l10n->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . '
'; if (!$item['title'] == '') { $subject = $item['title']; } else { From 3a2f5091d950cdab149f0fbde7e5b1c916ea6d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 18 Oct 2022 16:19:11 +0200 Subject: [PATCH 053/641] Added missing `use` statement, thanks to @MrPetovan --- mod/oexchange.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/oexchange.php b/mod/oexchange.php index 4eb25a2ab..79a5b06fd 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -20,6 +20,7 @@ */ use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\System; use Friendica\DI; use Friendica\Module\Response; From abe02a646c83a30cd4a0fae9c345c7cdb0701065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 18 Oct 2022 16:25:26 +0200 Subject: [PATCH 054/641] Added missing `use` statement (again), thanks to @MrPetovan Yes, we need more unit-testing! Not only to rely on your IDE that it will locate it for you. --- mod/oexchange.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/oexchange.php b/mod/oexchange.php index 79a5b06fd..f914e1e17 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\HTML; use Friendica\Core\System; use Friendica\DI; use Friendica\Module\Response; From 54d3d03252808092384174164427d13e8e1febe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 18 Oct 2022 16:33:33 +0200 Subject: [PATCH 055/641] Ops, code-convention not followed --- mod/tagger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/tagger.php b/mod/tagger.php index f3fe3b886..b3f5f9af1 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -135,7 +135,7 @@ EOT; 'author-name' => $contact['name'], 'author-link' => $contact['url'], 'author-avatar' => $contact['thumb'], - 'body' => sprintf( $bodyverb, $ulink, $alink, $plink, $termlink), + 'body' => sprintf($bodyverb, $ulink, $alink, $plink, $termlink), 'verb' => Activity::TAG, 'target-type' => $targettype, 'target' => $target, From 66b9cace9fed02774388cd20587d912e9fa64d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 11 Sep 2022 22:46:40 +0200 Subject: [PATCH 056/641] Changed: - first parameter can be null --- src/Util/Temporal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index 0186b59dd..ef87f8488 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -311,7 +311,7 @@ class Temporal * * @return string with relative date */ - public static function getRelativeDate(string $posted_date, string $format = null): string + public static function getRelativeDate(string $posted_date = null, string $format = null): string { $localtime = $posted_date . ' UTC'; From 2773ac9909195ed7c7a50ce77753831e4275c001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sat, 24 Sep 2022 14:11:46 +0200 Subject: [PATCH 057/641] Changed according feedback: - $posted_date should not allow NULL, instead use `?? ''` instead - this happened in e.g. 2FA app-specific password listing --- src/Security/TwoFactor/Model/AppSpecificPassword.php | 2 +- src/Util/Temporal.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Security/TwoFactor/Model/AppSpecificPassword.php b/src/Security/TwoFactor/Model/AppSpecificPassword.php index 6d1ef0bdc..d98437565 100644 --- a/src/Security/TwoFactor/Model/AppSpecificPassword.php +++ b/src/Security/TwoFactor/Model/AppSpecificPassword.php @@ -86,7 +86,7 @@ class AppSpecificPassword $appSpecificPasswords = DBA::toArray($appSpecificPasswordsStmt); array_walk($appSpecificPasswords, function (&$value) { - $value['ago'] = Temporal::getRelativeDate($value['last_used']); + $value['ago'] = Temporal::getRelativeDate($value['last_used'] ?? ''); $value['utc'] = $value['last_used'] ? DateTimeFormat::utc($value['last_used'], 'c') : ''; $value['local'] = $value['last_used'] ? DateTimeFormat::local($value['last_used'], 'r') : ''; }); diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index ef87f8488..74389c44b 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -311,13 +311,13 @@ class Temporal * * @return string with relative date */ - public static function getRelativeDate(string $posted_date = null, string $format = null): string + public static function getRelativeDate(string $posted_date, string $format = null): string { $localtime = $posted_date . ' UTC'; $abs = strtotime($localtime); - if (is_null($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) { + if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) { return DI::l10n()->t('never'); } From c36da392f8e25a78dcc448ba3d2ef71b8d718ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 18 Oct 2022 18:20:08 +0200 Subject: [PATCH 058/641] Changed: - re-added `null` again https://github.com/friendica/friendica/pull/11900#discussion_r979248182 - removed null coalescing operator --- src/Security/TwoFactor/Model/AppSpecificPassword.php | 2 +- src/Util/Temporal.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Security/TwoFactor/Model/AppSpecificPassword.php b/src/Security/TwoFactor/Model/AppSpecificPassword.php index d98437565..6d1ef0bdc 100644 --- a/src/Security/TwoFactor/Model/AppSpecificPassword.php +++ b/src/Security/TwoFactor/Model/AppSpecificPassword.php @@ -86,7 +86,7 @@ class AppSpecificPassword $appSpecificPasswords = DBA::toArray($appSpecificPasswordsStmt); array_walk($appSpecificPasswords, function (&$value) { - $value['ago'] = Temporal::getRelativeDate($value['last_used'] ?? ''); + $value['ago'] = Temporal::getRelativeDate($value['last_used']); $value['utc'] = $value['last_used'] ? DateTimeFormat::utc($value['last_used'], 'c') : ''; $value['local'] = $value['last_used'] ? DateTimeFormat::local($value['last_used'], 'r') : ''; }); diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index 74389c44b..cc6a078fe 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -311,13 +311,16 @@ class Temporal * * @return string with relative date */ - public static function getRelativeDate(string $posted_date, string $format = null): string + public static function getRelativeDate(string $posted_date = null, string $format = null): string { - $localtime = $posted_date . ' UTC'; + if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME) { + return DI::l10n()->t('never'); + } + $localtime = $posted_date . ' UTC'; $abs = strtotime($localtime); - if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) { + if ($abs === false) { return DI::l10n()->t('never'); } From ae8273744536a22701f95bc5c37f817aba8eed04 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Oct 2022 18:32:20 +0000 Subject: [PATCH 059/641] Fix errors introduced by PR #11997 --- src/Content/Item.php | 10 +++++----- src/Module/Profile/Status.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index 80edecc82..b363ad982 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -580,11 +580,11 @@ class Item public function createSharedPostByUrl(string $url, int $uid = 0, bool $add_media = false): string { if (!empty($uid)) { - $id = ModelItem::searchByLink($url, $uid); + $id = ItemModel::searchByLink($url, $uid); } if (empty($id)) { - $id = ModelItem::fetchByLink($url); + $id = ItemModel::fetchByLink($url); } if (!$id) { @@ -614,7 +614,7 @@ class Item public function createSharedPostByUriId(int $UriId, int $uid = 0, bool $add_media = false): string { $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; - $shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]); + $shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]); if (!DBA::isResult($shared_item)) { Logger::notice('Post does not exist.', ['uri-id' => $UriId, 'uid' => $uid]); return ''; @@ -634,11 +634,11 @@ class Item public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = '', bool $add_media = false): string { $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network']; - $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]); + $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]); if (!DBA::isResult($shared_item) && !empty($host) && Diaspora::storeByGuid($guid, $host, true)) { Logger::debug('Fetched post', ['guid' => $guid, 'host' => $host, 'uid' => $uid]); - $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]); + $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]); } elseif (DBA::isResult($shared_item)) { Logger::debug('Found existing post', ['guid' => $guid, 'host' => $host, 'uid' => $uid]); } diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 7cdd907c8..1a313cbfa 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -176,7 +176,7 @@ class Status extends BaseProfile $condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR (`gravity` = ? AND `vid` = ? AND `origin` AND `thr-parent-id` IN (SELECT `uri-id` FROM `post` WHERE `gravity` = ? AND `network` = ?)))", - GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]); + Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]); $condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED, 'visible' => true, 'deleted' => false]); From 7ac86e49d13af8f3b3bd0670ab309a8ab66f442a Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:10:37 +0200 Subject: [PATCH 060/641] Move Core\Session::get() to DI::session()->get() --- mod/redir.php | 2 +- src/App.php | 18 +++++++++++++----- src/Content/Conversation.php | 8 +++++--- src/Content/Nav.php | 4 ++-- src/Core/Session.php | 5 ----- src/Model/Profile.php | 2 +- src/Module/Conversation/Network.php | 2 +- src/Module/Delegation.php | 4 ++-- src/Module/Profile/Status.php | 2 +- src/Module/Settings/Delegation.php | 4 ++-- src/Module/Settings/Display.php | 2 +- src/Module/Settings/TwoFactor/Verify.php | 2 +- src/Module/Update/Profile.php | 2 +- src/Object/Post.php | 8 ++++---- view/theme/frio/theme.php | 2 +- 15 files changed, 36 insertions(+), 31 deletions(-) diff --git a/mod/redir.php b/mod/redir.php index ba1b7e13b..426abfd49 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -91,7 +91,7 @@ function redir_init(App $a) { // with the local contact. Otherwise the local user would ask the local contact // for authentification everytime he/she is visiting a profile page of the local // contact. - if (($host == $remotehost) && (Session::getRemoteContactID(Session::get('visitor_visiting')) == Session::get('visitor_id'))) { + if (($host == $remotehost) && (Session::getRemoteContactID(DI::session()->get('visitor_visiting')) == DI::session()->get('visitor_id'))) { // Remote user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; diff --git a/src/App.php b/src/App.php index 55b3e72e0..003ff5658 100644 --- a/src/App.php +++ b/src/App.php @@ -26,6 +26,7 @@ use Friendica\App\Arguments; use Friendica\App\BaseURL; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Factory\Config; +use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Module\Maintenance; use Friendica\Security\Authentication; use Friendica\Core\Config\ValueObject\Cache; @@ -127,6 +128,11 @@ class App */ private $pConfig; + /** + * @var IHandleSessions + */ + private $session; + /** * Set the user ID * @@ -328,8 +334,9 @@ class App * @param L10n $l10n The translator instance * @param App\Arguments $args The Friendica Arguments of the call * @param IManagePersonalConfigValues $pConfig Personal configuration + * @param IHandleSessions $session The Session handler */ - public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig) + public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleSessions $session) { $this->database = $database; $this->config = $config; @@ -340,6 +347,7 @@ class App $this->l10n = $l10n; $this->args = $args; $this->pConfig = $pConfig; + $this->session = $session; $this->load(); } @@ -415,7 +423,7 @@ class App } // Specific mobile theme override - if (($this->mode->isMobile() || $this->mode->isTablet()) && Core\Session::get('show-mobile', true)) { + if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) { $user_mobile_theme = $this->getCurrentMobileTheme(); // --- means same mobile theme as desktop @@ -496,7 +504,7 @@ class App } } - $theme_name = $page_theme ?: Core\Session::get('theme', $system_theme); + $theme_name = $page_theme ?: $this->session->get('theme', $system_theme); $theme_name = Strings::sanitizeFilePathItem($theme_name); if ($theme_name @@ -528,7 +536,7 @@ class App } } - $mobile_theme_name = $page_mobile_theme ?: Core\Session::get('mobile-theme', $system_mobile_theme); + $mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme); $mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name); if ($mobile_theme_name == '---' @@ -625,7 +633,7 @@ class App // Valid profile links contain a path with "/profile/" and no query parameters if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) { - if (Core\Session::get('visitor_home') != $_GET['zrl']) { + if ($this->session->get('visitor_home') != $_GET['zrl']) { Core\Session::set('my_url', $_GET['zrl']); Core\Session::set('authenticated', 0); diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 817bc402a..ede7a56b6 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -32,7 +32,6 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Protocol; use Friendica\Core\Renderer; -use Friendica\Core\Session; use Friendica\Core\Theme; use Friendica\Database\DBA; use Friendica\Model\Contact; @@ -77,8 +76,10 @@ class Conversation private $page; /** @var App\Mode */ private $mode; + /** @var Session\Capability\IHandleSessions */ + private $session; - public function __construct(LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app) + public function __construct(LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app, Session\Capability\IHandleSessions $session) { $this->activity = $activity; $this->item = $item; @@ -92,6 +93,7 @@ class Conversation $this->pConfig = $pConfig; $this->page = $page; $this->app = $app; + $this->session = $session; } /** @@ -497,7 +499,7 @@ class Conversation if (!$update) { $live_update_div = '
' . "\r\n" - . ""; } } elseif ($mode === 'community') { diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 6861d69e8..b43e926e8 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -208,7 +208,7 @@ class Nav // "Home" should also take you home from an authenticated remote profile connection $homelink = Profile::getMyURL(); if (! $homelink) { - $homelink = Session::get('visitor_home', ''); + $homelink = DI::session()->get('visitor_home', ''); } if ((DI::args()->getModuleName() != 'home') && (! (local_user()))) { @@ -276,7 +276,7 @@ class Nav $nav['home'] = ['profile/' . $a->getLoggedInUserNickname(), DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')]; // Don't show notifications for public communities - if (Session::get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) { + if (DI::session()->get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) { $nav['introductions'] = ['notifications/intros', DI::l10n()->t('Introductions'), '', DI::l10n()->t('Friend Requests')]; $nav['notifications'] = ['notifications', DI::l10n()->t('Notifications'), '', DI::l10n()->t('Notifications')]; $nav['notifications']['all'] = ['notifications/system', DI::l10n()->t('See all notifications'), '', '']; diff --git a/src/Core/Session.php b/src/Core/Session.php index 859dd8aa2..7c4d2974d 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -39,11 +39,6 @@ class Session return DI::session()->exists($name); } - public static function get($name, $defaults = null) - { - return DI::session()->get($name, $defaults); - } - public static function pop($name, $defaults = null) { return DI::session()->pop($name, $defaults); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index b58de4efb..d9467471f 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -683,7 +683,7 @@ class Profile */ public static function getMyURL(): string { - return Session::get('my_url') ?? ''; + return DI::session()->get('my_url') ?? ''; } /** diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index bfdeb7e57..d5f4f6d2f 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -307,7 +307,7 @@ class Network extends BaseModule self::$forumContactId = $this->parameters['contact_id'] ?? 0; - self::$selectedTab = Session::get('network-tab', DI::pConfig()->get(local_user(), 'network.view', 'selected_tab', '')); + self::$selectedTab = DI::session()->get('network-tab', DI::pConfig()->get(local_user(), 'network.view', 'selected_tab', '')); if (!empty($get['star'])) { self::$selectedTab = 'star'; diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index 146e9382b..f8aeb4c76 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -46,8 +46,8 @@ class Delegation extends BaseModule $uid = local_user(); $orig_record = User::getById(DI::app()->getLoggedInUserId()); - if (Session::get('submanage')) { - $user = User::getById(Session::get('submanage')); + if (DI::session()->get('submanage')) { + $user = User::getById(DI::session()->get('submanage')); if (DBA::isResult($user)) { $uid = intval($user['uid']); $orig_record = $user; diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 1a313cbfa..2bf9b429b 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -139,7 +139,7 @@ class Status extends BaseProfile // Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups $condition = Item::getPermissionsConditionArrayByUserId($profile['uid']); - $last_updated_array = Session::get('last_updated', []); + $last_updated_array = DI::session()->get('last_updated', []); if (!empty($category)) { $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `category-view` WHERE `name` = ? AND `type` = ? AND `uid` = ?)", diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php index aeada0871..a711c674a 100644 --- a/src/Module/Settings/Delegation.php +++ b/src/Module/Settings/Delegation.php @@ -77,7 +77,7 @@ class Delegation extends BaseSettings $user_id = $args->get(3); if ($action === 'add' && $user_id) { - if (Session::get('submanage')) { + if (DI::session()->get('submanage')) { DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); DI::baseUrl()->redirect('settings/delegation'); } @@ -99,7 +99,7 @@ class Delegation extends BaseSettings } if ($action === 'remove' && $user_id) { - if (Session::get('submanage')) { + if (DI::session()->get('submanage')) { DI::sysmsg()->addNotice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.')); DI::baseUrl()->redirect('settings/delegation'); } diff --git a/src/Module/Settings/Display.php b/src/Module/Settings/Display.php index fe42b8718..81f496eea 100644 --- a/src/Module/Settings/Display.php +++ b/src/Module/Settings/Display.php @@ -157,7 +157,7 @@ class Display extends BaseSettings } $theme_selected = $user['theme'] ?: $default_theme; - $mobile_theme_selected = Session::get('mobile-theme', $default_mobile_theme); + $mobile_theme_selected = DI::session()->get('mobile-theme', $default_mobile_theme); $itemspage_network = intval(DI::pConfig()->get(local_user(), 'system', 'itemspage_network')); $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : DI::config()->get('system', 'itemspage_network')); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 3d7db0118..820f7e255 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -106,7 +106,7 @@ class Verify extends BaseSettings parent::content(); $company = 'Friendica'; - $holder = Session::get('my_address'); + $holder = DI::session()->get('my_address'); $secret = $this->pConfig->get(local_user(), '2fa', 'secret'); $otpauthUrl = (new Google2FA())->getQRCodeUrl($company, $holder, $secret); diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index b7dae9ec1..4d6793605 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -66,7 +66,7 @@ class Profile extends BaseModule // Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups $sql_extra = Item::getPermissionsSQLByUserId($a->getProfileOwner()); - $last_updated_array = Session::get('last_updated', []); + $last_updated_array = DI::session()->get('last_updated', []); $last_updated = $last_updated_array[$last_updated_key] ?? 0; diff --git a/src/Object/Post.php b/src/Object/Post.php index 7300fd09b..bbce29672 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -217,7 +217,7 @@ class Post $edpost = false; if (local_user()) { - if (Strings::compareLink(Session::get('my_url'), $item['author-link'])) { + if (Strings::compareLink(DI::session()->get('my_url'), $item['author-link'])) { if ($item['event-id'] != 0) { $edpost = ['events/event/' . $item['event-id'], DI::l10n()->t('Edit')]; } else { @@ -434,9 +434,9 @@ class Post } // Fetching of Diaspora posts doesn't always work. There are issues with reshares and possibly comments - if (!local_user() && ($item['network'] != Protocol::DIASPORA) && !empty(Session::get('remote_comment'))) { + if (!local_user() && ($item['network'] != Protocol::DIASPORA) && !empty(DI::session()->get('remote_comment'))) { $remote_comment = [DI::l10n()->t('Comment this item on your system'), DI::l10n()->t('Remote comment'), - str_replace('{uri}', urlencode($item['uri']), Session::get('remote_comment'))]; + str_replace('{uri}', urlencode($item['uri']), DI::session()->get('remote_comment'))]; // Ensure to either display the remote comment or the local activities $buttons = []; @@ -507,7 +507,7 @@ class Post 'location_html' => $location_html, 'indent' => $indent, 'shiny' => $shiny, - 'owner_self' => $item['author-link'] == Session::get('my_url'), + 'owner_self' => $item['author-link'] == DI::session()->get('my_url'), 'owner_url' => $this->getOwnerUrl(), 'owner_photo' => DI::baseUrl()->remove(DI::contentItem()->getOwnerAvatar($item)), 'owner_name' => $this->getOwnerName(), diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 863992c40..2913a1553 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -207,7 +207,7 @@ function frio_remote_nav(App $a, array &$nav_info) // get the homelink from $_SESSION $homelink = Profile::getMyURL(); if (!$homelink) { - $homelink = Session::get('visitor_home', ''); + $homelink = DI::session()->get('visitor_home', ''); } // since $userinfo isn't available for the hook we write it to the nav array From fb2b2f5c58cbdf07fe7e0683a3e9b6096e8b0497 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:11:00 +0200 Subject: [PATCH 061/641] Remove unused Core\Session::create() method --- src/Core/Session.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Core/Session.php b/src/Core/Session.php index 7c4d2974d..cc8ede5ca 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function exists($name) - { - return DI::session()->exists($name); - } - public static function pop($name, $defaults = null) { return DI::session()->pop($name, $defaults); From dfb57927732f738d1b59c77dd308dbaadb466126 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:11:19 +0200 Subject: [PATCH 062/641] Remove unused Core\Session::pop() method --- src/Core/Session.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Core/Session.php b/src/Core/Session.php index cc8ede5ca..9deadbedb 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function pop($name, $defaults = null) - { - return DI::session()->pop($name, $defaults); - } - public static function set($name, $value) { DI::session()->set($name, $value); From 3a8bcb3fbf396da7d7966016410ad6ad9275d1e9 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:12:23 +0200 Subject: [PATCH 063/641] Move Core\Session::set() to DI::session()->set() --- src/App.php | 4 ++-- src/Core/Session.php | 5 ----- src/Module/Conversation/Network.php | 2 +- src/Module/Delegation.php | 2 +- src/Module/Profile/Status.php | 2 +- src/Module/Settings/TwoFactor/Verify.php | 2 +- src/Module/Update/Profile.php | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/App.php b/src/App.php index 003ff5658..95b0716e2 100644 --- a/src/App.php +++ b/src/App.php @@ -634,8 +634,8 @@ class App if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) { if ($this->session->get('visitor_home') != $_GET['zrl']) { - Core\Session::set('my_url', $_GET['zrl']); - Core\Session::set('authenticated', 0); + $this->session->set('my_url', $_GET['zrl']); + $this->session->set('authenticated', 0); $remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']); if (!empty($remote_contact['subscribe'])) { diff --git a/src/Core/Session.php b/src/Core/Session.php index 9deadbedb..1af219dd5 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function set($name, $value) - { - DI::session()->set($name, $value); - } - public static function setMultiple(array $values) { DI::session()->setMultiple($values); diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index d5f4f6d2f..ed32744d3 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -345,7 +345,7 @@ class Network extends BaseModule self::$star = false; } - Session::set('network-tab', self::$selectedTab); + DI::session()->set('network-tab', self::$selectedTab); DI::pConfig()->set(local_user(), 'network.view', 'selected_tab', self::$selectedTab); self::$accountTypeString = $get['accounttype'] ?? $this->parameters['accounttype'] ?? ''; diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index f8aeb4c76..e3ae977e2 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -102,7 +102,7 @@ class Delegation extends BaseModule DI::auth()->setForUser(DI::app(), $user, true, true); if ($limited_id) { - Session::set('submanage', $original_id); + DI::session()->set('submanage', $original_id); } $ret = []; diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 2bf9b429b..fa3f36e88 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -189,7 +189,7 @@ class Status extends BaseProfile // Set a time stamp for this page. We will make use of it when we // search for new items (update routine) $last_updated_array[$last_updated_key] = time(); - Session::set('last_updated', $last_updated_array); + DI::session()->set('last_updated', $last_updated_array); if ($is_owner && !DI::config()->get('theme', 'hide_eventlist')) { $o .= ProfileModel::getBirthdays(); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 820f7e255..86e9af5ae 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -86,7 +86,7 @@ class Verify extends BaseSettings if ($valid) { $this->pConfig->set(local_user(), '2fa', 'verified', true); - Session::set('2fa', true); + DI::session()->set('2fa', true); DI::sysmsg()->addInfo($this->t('Two-factor authentication successfully activated.')); diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index 4d6793605..4a1360fb9 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -102,7 +102,7 @@ class Profile extends BaseModule // Set a time stamp for this page. We will make use of it when we // search for new items (update routine) $last_updated_array[$last_updated_key] = time(); - Session::set('last_updated', $last_updated_array); + DI::session()->set('last_updated', $last_updated_array); if ($is_owner && !$a->getProfileOwner() && !DI::config()->get('theme', 'hide_eventlist')) { $o .= ProfileModel::getBirthdays(); From 315ed3ed22a76fcafe991e919d4daf342239c5d0 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:12:48 +0200 Subject: [PATCH 064/641] Remove unused Core\Session::setMultiple() --- src/Core/Session.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Core/Session.php b/src/Core/Session.php index 1af219dd5..41ddf9783 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function setMultiple(array $values) - { - DI::session()->setMultiple($values); - } - public static function remove($name) { DI::session()->remove($name); From a2eb0c737877567adcacfd94c06d3af7d042c670 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:13:28 +0200 Subject: [PATCH 065/641] Move Core\Session::remove() to DI::session()->remove() --- src/Core/Session.php | 5 ----- src/Module/Settings/TwoFactor/Index.php | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Core/Session.php b/src/Core/Session.php index 41ddf9783..c1d2b7390 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function remove($name) - { - DI::session()->remove($name); - } - public static function clear() { DI::session()->clear(); diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index be3d8d232..ae4e518fa 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -22,7 +22,6 @@ namespace Friendica\Module\Settings\TwoFactor; use Friendica\Core\Renderer; -use Friendica\Core\Session; use Friendica\DI; use Friendica\Network\HTTPException\FoundException; use Friendica\Security\TwoFactor\Model\AppSpecificPassword; @@ -64,7 +63,7 @@ class Index extends BaseSettings RecoveryCode::deleteForUser(local_user()); DI::pConfig()->delete(local_user(), '2fa', 'secret'); DI::pConfig()->delete(local_user(), '2fa', 'verified'); - Session::remove('2fa'); + DI::session()->remove('2fa'); DI::sysmsg()->addInfo(DI::l10n()->t('Two-factor authentication successfully disabled.')); DI::baseUrl()->redirect('settings/2fa'); From 4a2f67aa9a8d5422c7bdf4ac270eda2abf74f9b3 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 18 Oct 2022 21:13:58 +0200 Subject: [PATCH 066/641] Move Core\Session::clear() to DI::session()->clear() --- src/Core/Session.php | 5 ----- src/Module/Delegation.php | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Core/Session.php b/src/Core/Session.php index c1d2b7390..a944cf8f5 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -34,11 +34,6 @@ class Session public static $exists = false; public static $expire = 180000; - public static function clear() - { - DI::session()->clear(); - } - /** * Returns the user id of locally logged in user or false. * diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index e3ae977e2..fc86e9b64 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -24,7 +24,6 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\Hook; use Friendica\Core\Renderer; -use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Notification; @@ -97,7 +96,7 @@ class Delegation extends BaseModule return; } - Session::clear(); + DI::session()->clear(); DI::auth()->setForUser(DI::app(), $user, true, true); From f4dbd69e0eb8026dc8c7afad6367917da4834785 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Tue, 18 Oct 2022 22:18:01 +0200 Subject: [PATCH 067/641] FR translation update THX Nicolas Derive --- view/lang/fr/messages.po | 1660 +++++++++++++++++++------------------- view/lang/fr/strings.php | 9 +- 2 files changed, 847 insertions(+), 822 deletions(-) diff --git a/view/lang/fr/messages.po b/view/lang/fr/messages.po index 5cac16e52..266a89962 100644 --- a/view/lang/fr/messages.po +++ b/view/lang/fr/messages.po @@ -34,7 +34,7 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 13:22-0400\n" +"POT-Creation-Date: 2022-10-17 09:33+0000\n" "PO-Revision-Date: 2011-05-05 10:19+0000\n" "Last-Translator: Nicolas Derive, 2022\n" "Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" @@ -45,7 +45,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" #: mod/cal.php:46 mod/cal.php:50 mod/follow.php:39 mod/redir.php:36 -#: mod/redir.php:177 src/Module/Conversation/Community.php:181 +#: mod/redir.php:177 src/Module/Conversation/Community.php:196 #: src/Module/Debug/ItemBody.php:38 src/Module/Diaspora/Receive.php:57 #: src/Module/Item/Follow.php:42 src/Module/Item/Ignore.php:41 #: src/Module/Item/Pin.php:42 src/Module/Item/Pin.php:57 @@ -69,10 +69,10 @@ msgstr "Utilisateur introuvable." msgid "Access to this profile has been restricted." msgstr "L'accès au profil a été restreint." -#: mod/cal.php:243 mod/events.php:374 src/Content/Nav.php:196 -#: src/Content/Nav.php:260 src/Module/BaseProfile.php:84 -#: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:224 -#: view/theme/frio/theme.php:228 +#: mod/cal.php:243 mod/events.php:374 src/Content/Nav.php:197 +#: src/Content/Nav.php:261 src/Module/BaseProfile.php:84 +#: src/Module/BaseProfile.php:95 view/theme/frio/theme.php:240 +#: view/theme/frio/theme.php:244 msgid "Events" msgstr "Évènements" @@ -93,17 +93,17 @@ msgid "today" msgstr "aujourd'hui" #: mod/cal.php:250 mod/events.php:384 src/Model/Event.php:461 -#: src/Util/Temporal.php:334 +#: src/Util/Temporal.php:338 msgid "month" msgstr "mois" #: mod/cal.php:251 mod/events.php:385 src/Model/Event.php:462 -#: src/Util/Temporal.php:335 +#: src/Util/Temporal.php:339 msgid "week" msgstr "semaine" #: mod/cal.php:252 mod/events.php:386 src/Model/Event.php:463 -#: src/Util/Temporal.php:336 +#: src/Util/Temporal.php:340 msgid "day" msgstr "jour" @@ -131,7 +131,7 @@ msgid "calendar" msgstr "calendrier" #: mod/display.php:143 mod/photos.php:802 -#: src/Module/Conversation/Community.php:175 src/Module/Directory.php:49 +#: src/Module/Conversation/Community.php:190 src/Module/Directory.php:49 #: src/Module/Search/Index.php:65 msgid "Public access denied." msgstr "Accès public refusé." @@ -145,7 +145,7 @@ msgid "The feed for this item is unavailable." msgstr "Le flux pour cet objet n'est pas disponible." #: mod/editpost.php:38 mod/events.php:217 mod/follow.php:56 mod/follow.php:130 -#: mod/item.php:181 mod/item.php:186 mod/item.php:870 mod/message.php:69 +#: mod/item.php:182 mod/item.php:187 mod/item.php:866 mod/message.php:69 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:33 #: mod/photos.php:160 mod/photos.php:891 mod/repair_ostatus.php:31 #: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156 @@ -164,8 +164,8 @@ msgstr "Le flux pour cet objet n'est pas disponible." #: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56 #: src/Module/Register.php:77 src/Module/Register.php:90 #: src/Module/Register.php:206 src/Module/Register.php:245 -#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:49 -#: src/Module/Settings/Account.php:409 src/Module/Settings/Delegation.php:42 +#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50 +#: src/Module/Settings/Account.php:410 src/Module/Settings/Delegation.php:42 #: src/Module/Settings/Delegation.php:70 src/Module/Settings/Display.php:42 #: src/Module/Settings/Display.php:120 #: src/Module/Settings/Profile/Photo/Crop.php:166 @@ -238,7 +238,7 @@ msgid "audio link" msgstr "lien audio" #: mod/editpost.php:103 src/Content/Conversation.php:352 -#: src/Module/Item/Compose.php:173 +#: src/Module/Item/Compose.php:200 msgid "Set your location" msgstr "Définir votre localisation" @@ -256,8 +256,8 @@ msgstr "supp. localisation" #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358 #: mod/photos.php:1489 mod/wallmessage.php:142 -#: src/Content/Conversation.php:368 src/Content/Conversation.php:713 -#: src/Module/Item/Compose.php:177 src/Object/Post.php:538 +#: src/Content/Conversation.php:368 src/Content/Conversation.php:714 +#: src/Module/Item/Compose.php:204 src/Object/Post.php:538 msgid "Please wait" msgstr "Patientez" @@ -274,12 +274,12 @@ msgid "Public post" msgstr "Publication publique" #: mod/editpost.php:120 src/Content/Conversation.php:357 -#: src/Module/Item/Compose.php:178 +#: src/Module/Item/Compose.php:205 msgid "Set title" msgstr "Définir un titre" #: mod/editpost.php:122 src/Content/Conversation.php:359 -#: src/Module/Item/Compose.php:179 +#: src/Module/Item/Compose.php:206 msgid "Categories (comma-separated list)" msgstr "Catégories (séparées par des virgules)" @@ -289,11 +289,11 @@ msgstr "Exemple : bob@exemple.com, mary@exemple.com" #: mod/editpost.php:128 mod/events.php:513 mod/photos.php:1337 #: mod/photos.php:1393 mod/photos.php:1467 src/Content/Conversation.php:383 -#: src/Module/Item/Compose.php:172 src/Object/Post.php:1003 +#: src/Module/Item/Compose.php:199 src/Object/Post.php:1003 msgid "Preview" msgstr "Aperçu" -#: mod/editpost.php:130 mod/fbrowser.php:118 mod/fbrowser.php:145 +#: mod/editpost.php:130 mod/fbrowser.php:119 mod/fbrowser.php:146 #: mod/follow.php:144 mod/photos.php:1004 mod/photos.php:1105 mod/tagrm.php:35 #: mod/tagrm.php:127 mod/unfollow.php:97 src/Content/Conversation.php:386 #: src/Module/Contact/Revoke.php:108 src/Module/RemoteFollow.php:127 @@ -302,37 +302,37 @@ msgid "Cancel" msgstr "Annuler" #: mod/editpost.php:134 src/Content/Conversation.php:343 -#: src/Module/Item/Compose.php:163 src/Object/Post.php:994 +#: src/Module/Item/Compose.php:190 src/Object/Post.php:994 msgid "Bold" msgstr "Gras" #: mod/editpost.php:135 src/Content/Conversation.php:344 -#: src/Module/Item/Compose.php:164 src/Object/Post.php:995 +#: src/Module/Item/Compose.php:191 src/Object/Post.php:995 msgid "Italic" msgstr "Italique" #: mod/editpost.php:136 src/Content/Conversation.php:345 -#: src/Module/Item/Compose.php:165 src/Object/Post.php:996 +#: src/Module/Item/Compose.php:192 src/Object/Post.php:996 msgid "Underline" msgstr "Souligné" #: mod/editpost.php:137 src/Content/Conversation.php:346 -#: src/Module/Item/Compose.php:166 src/Object/Post.php:997 +#: src/Module/Item/Compose.php:193 src/Object/Post.php:997 msgid "Quote" msgstr "Citation" #: mod/editpost.php:138 src/Content/Conversation.php:347 -#: src/Module/Item/Compose.php:167 src/Object/Post.php:998 +#: src/Module/Item/Compose.php:194 src/Object/Post.php:998 msgid "Code" msgstr "Code" #: mod/editpost.php:139 src/Content/Conversation.php:349 -#: src/Module/Item/Compose.php:169 src/Object/Post.php:1000 +#: src/Module/Item/Compose.php:196 src/Object/Post.php:1000 msgid "Link" msgstr "Lien" #: mod/editpost.php:140 src/Content/Conversation.php:350 -#: src/Module/Item/Compose.php:170 src/Object/Post.php:1001 +#: src/Module/Item/Compose.php:197 src/Object/Post.php:1001 msgid "Link or Media" msgstr "Lien ou média" @@ -441,9 +441,9 @@ msgstr "Partager cet évènement" #: src/Module/Delegation.php:148 src/Module/FriendSuggest.php:144 #: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:331 src/Module/Invite.php:178 -#: src/Module/Item/Compose.php:162 src/Module/Profile/Profile.php:247 +#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:247 #: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:992 -#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 +#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:171 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 msgid "Submit" msgstr "Envoyer" @@ -452,7 +452,7 @@ msgstr "Envoyer" msgid "Basic" msgstr "Simple" -#: mod/events.php:517 src/Module/Admin/Site.php:441 src/Module/Contact.php:474 +#: mod/events.php:517 src/Module/Admin/Site.php:439 src/Module/Contact.php:477 #: src/Module/Profile/Profile.php:249 msgid "Advanced" msgstr "Avancé" @@ -461,17 +461,17 @@ msgstr "Avancé" msgid "Failed to remove event" msgstr "La suppression de l'évènement a échoué." -#: mod/fbrowser.php:61 src/Content/Nav.php:194 src/Module/BaseProfile.php:64 -#: view/theme/frio/theme.php:222 +#: mod/fbrowser.php:61 src/Content/Nav.php:195 src/Module/BaseProfile.php:64 +#: view/theme/frio/theme.php:238 msgid "Photos" msgstr "Photos" -#: mod/fbrowser.php:120 mod/fbrowser.php:147 +#: mod/fbrowser.php:121 mod/fbrowser.php:148 #: src/Module/Settings/Profile/Photo/Index.php:129 msgid "Upload" msgstr "Téléverser" -#: mod/fbrowser.php:142 +#: mod/fbrowser.php:143 msgid "Files" msgstr "Fichiers" @@ -495,8 +495,8 @@ msgstr "Le support de Diaspora est désactivé. Le contact ne peut pas être ajo msgid "OStatus support is disabled. Contact can't be added." msgstr "Le support d'OStatus est désactivé. Le contact ne peut pas être ajouté." -#: mod/follow.php:138 src/Content/Item.php:397 src/Content/Widget.php:80 -#: src/Model/Contact.php:1109 src/Model/Contact.php:1120 +#: mod/follow.php:138 src/Content/Item.php:400 src/Content/Widget.php:80 +#: src/Model/Contact.php:1169 src/Model/Contact.php:1180 #: view/theme/vier/theme.php:181 msgid "Connect/Follow" msgstr "Se connecter/Suivre" @@ -533,7 +533,7 @@ msgid "Add a personal note:" msgstr "Ajouter une note personnelle :" #: mod/follow.php:163 mod/unfollow.php:109 src/Module/BaseProfile.php:59 -#: src/Module/Contact.php:444 +#: src/Module/Contact.php:447 msgid "Status Messages and Posts" msgstr "Messages d'état et publications" @@ -541,27 +541,27 @@ msgstr "Messages d'état et publications" msgid "The contact could not be added." msgstr "Le contact n'a pas pu être ajouté." -#: mod/item.php:131 mod/item.php:135 +#: mod/item.php:132 mod/item.php:136 msgid "Unable to locate original post." msgstr "Impossible de localiser la publication originale." -#: mod/item.php:337 mod/item.php:342 +#: mod/item.php:338 mod/item.php:343 msgid "Empty post discarded." msgstr "Publication vide rejetée." -#: mod/item.php:682 +#: mod/item.php:678 msgid "Post updated." msgstr "Publication mise à jour." -#: mod/item.php:692 mod/item.php:697 +#: mod/item.php:688 mod/item.php:693 msgid "Item wasn't stored." msgstr "La publication n'a pas été enregistrée." -#: mod/item.php:708 +#: mod/item.php:704 msgid "Item couldn't be fetched." msgstr "La publication n'a pas pu être obtenue." -#: mod/item.php:848 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:844 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 #: src/Module/Debug/ItemBody.php:57 msgid "Item not found." @@ -713,7 +713,7 @@ msgstr "Aucune correspondance" msgid "Profile Match" msgstr "Correpondance de profils" -#: mod/message.php:46 mod/message.php:126 src/Content/Nav.php:288 +#: mod/message.php:46 mod/message.php:126 src/Content/Nav.php:289 msgid "New Message" msgstr "Nouveau message" @@ -739,7 +739,7 @@ msgstr "Récupération des messages infructueuse." msgid "Discard" msgstr "Rejeter" -#: mod/message.php:133 src/Content/Nav.php:285 view/theme/frio/theme.php:229 +#: mod/message.php:133 src/Content/Nav.php:286 view/theme/frio/theme.php:245 msgid "Messages" msgstr "Messages" @@ -1094,7 +1094,7 @@ msgid "Rotate CCW (left)" msgstr "Tourner dans le sens contraire des aiguilles d'une montre (vers la gauche)" #: mod/photos.php:1333 mod/photos.php:1389 mod/photos.php:1463 -#: src/Module/Contact.php:544 src/Module/Item/Compose.php:160 +#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:989 msgid "This is you" msgstr "C'est vous" @@ -1104,12 +1104,12 @@ msgstr "C'est vous" msgid "Comment" msgstr "Commenter" -#: mod/photos.php:1424 src/Content/Conversation.php:629 +#: mod/photos.php:1424 src/Content/Conversation.php:630 #: src/Object/Post.php:256 msgid "Select" msgstr "Sélectionner" -#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:630 +#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:631 #: src/Module/Admin/Users/Active.php:139 #: src/Module/Admin/Users/Blocked.php:140 src/Module/Admin/Users/Index.php:153 msgid "Delete" @@ -1156,7 +1156,7 @@ msgstr "Mauvaise requête." msgid "Contact not found." msgstr "Contact introuvable." -#: mod/removeme.php:65 src/Navigation/Notifications/Repository/Notify.php:464 +#: mod/removeme.php:65 src/Navigation/Notifications/Repository/Notify.php:467 msgid "[Friendica System Notify]" msgstr "[Notification Système de Friendica]" @@ -1218,7 +1218,7 @@ msgstr "Applications connectées" msgid "Name" msgstr "Nom" -#: mod/settings.php:177 src/Content/Nav.php:214 +#: mod/settings.php:177 src/Content/Nav.php:215 msgid "Home Page" msgstr "Page d'accueil" @@ -1233,9 +1233,9 @@ msgstr "Révoquer l'autorisation" #: mod/settings.php:205 mod/settings.php:237 mod/settings.php:268 #: mod/settings.php:352 src/Module/Admin/Addons/Index.php:69 #: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:81 -#: src/Module/Admin/Site.php:436 src/Module/Admin/Themes/Index.php:113 -#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:562 -#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:193 +#: src/Module/Admin/Site.php:434 src/Module/Admin/Themes/Index.php:113 +#: src/Module/Admin/Tos.php:83 src/Module/Settings/Account.php:563 +#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:201 msgid "Save Settings" msgstr "Sauvegarder les paramètres" @@ -1417,7 +1417,7 @@ msgstr "Envoyer les publications publiques à tous les contacts courriels :" msgid "Action after import:" msgstr "Action après import :" -#: mod/settings.php:350 src/Content/Nav.php:282 +#: mod/settings.php:350 src/Content/Nav.php:283 msgid "Mark as seen" msgstr "Marquer comme vu" @@ -1439,15 +1439,15 @@ msgstr "Aucune suggestion. Si ce site est récent, merci de recommencer dans 24h msgid "Friend Suggestions" msgstr "Suggestions d'abonnement" -#: mod/tagger.php:78 src/Content/Item.php:297 src/Model/Item.php:2765 +#: mod/tagger.php:78 src/Content/Item.php:300 src/Model/Item.php:2855 msgid "photo" msgstr "photo" -#: mod/tagger.php:78 src/Content/Item.php:291 src/Content/Item.php:301 +#: mod/tagger.php:78 src/Content/Item.php:294 src/Content/Item.php:304 msgid "status" msgstr "le statut" -#: mod/tagger.php:111 src/Content/Item.php:311 +#: mod/tagger.php:111 src/Content/Item.php:314 #, php-format msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "%1$s a mentionné %3$s de %2$s avec %4$s" @@ -1585,17 +1585,17 @@ msgstr "Le thème système n'est pas configuré." msgid "Apologies but the website is unavailable at the moment." msgstr "Désolé mais le site web n'est pas disponible pour le moment." -#: src/App/Page.php:276 +#: src/App/Page.php:281 msgid "Delete this item?" msgstr "Effacer cet élément?" -#: src/App/Page.php:277 +#: src/App/Page.php:282 msgid "" "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." msgstr "Bloquer ce contact ? Iel ne pourra pas s'abonner à votre compte et vous ne pourrez pas voir leurs publications ni leurs commentaires." -#: src/App/Page.php:347 +#: src/App/Page.php:352 msgid "toggle mobile" msgstr "activ. mobile" @@ -1623,18 +1623,18 @@ msgid "All contacts" msgstr "Tous les contacts" #: src/BaseModule.php:424 src/Content/Widget.php:235 src/Core/ACL.php:194 -#: src/Module/Contact.php:367 src/Module/PermissionTooltip.php:122 +#: src/Module/Contact.php:370 src/Module/PermissionTooltip.php:122 #: src/Module/PermissionTooltip.php:144 msgid "Followers" msgstr "Abonnés" #: src/BaseModule.php:429 src/Content/Widget.php:236 -#: src/Module/Contact.php:368 +#: src/Module/Contact.php:371 msgid "Following" msgstr "Abonnements" #: src/BaseModule.php:434 src/Content/Widget.php:237 -#: src/Module/Contact.php:369 +#: src/Module/Contact.php:372 msgid "Mutual friends" msgstr "Contact mutuels" @@ -1674,63 +1674,63 @@ msgstr "Aucun profil distant n'a été trouvé à cette URL (%s)" msgid "The contact has been blocked from the node" msgstr "Le profile distant a été bloqué" -#: src/Console/MergeContacts.php:74 +#: src/Console/MergeContacts.php:75 #, php-format msgid "%d %s, %d duplicates." msgstr "%d%s, %d duplications." -#: src/Console/MergeContacts.php:77 +#: src/Console/MergeContacts.php:78 #, php-format msgid "uri-id is empty for contact %s." msgstr "l'uri-id est vide pour le contact %s." -#: src/Console/MergeContacts.php:90 +#: src/Console/MergeContacts.php:91 #, php-format msgid "No valid first contact found for uri-id %d." msgstr "Aucun premier contact valide trouvé pour l'uri-id %d." -#: src/Console/MergeContacts.php:101 +#: src/Console/MergeContacts.php:102 #, php-format msgid "Wrong duplicate found for uri-id %d in %d (url: %s != %s)." msgstr "Mauvaise duplication trouvée pour l'uri-id %d dans %d (url : %s != %s)." -#: src/Console/MergeContacts.php:105 +#: src/Console/MergeContacts.php:106 #, php-format msgid "Wrong duplicate found for uri-id %d in %d (nurl: %s != %s)." msgstr "Mauvaise duplication trouvée pour l'uri-id %d dans %d (nurl : %s != %s)." -#: src/Console/MergeContacts.php:141 +#: src/Console/MergeContacts.php:142 #, php-format msgid "Deletion of id %d failed" msgstr "La suppression de l'id %d a échoué." -#: src/Console/MergeContacts.php:143 +#: src/Console/MergeContacts.php:144 #, php-format msgid "Deletion of id %d was successful" msgstr "id %d supprimé avec succès." -#: src/Console/MergeContacts.php:149 +#: src/Console/MergeContacts.php:150 #, php-format msgid "Updating \"%s\" in \"%s\" from %d to %d" msgstr "Mise à jour de \"%s\" dans \"%s\" depuis %d vers %d" -#: src/Console/MergeContacts.php:151 +#: src/Console/MergeContacts.php:152 msgid " - found" msgstr "- trouvé(s)" -#: src/Console/MergeContacts.php:158 +#: src/Console/MergeContacts.php:159 msgid " - failed" msgstr "- échoué(s)" -#: src/Console/MergeContacts.php:160 +#: src/Console/MergeContacts.php:161 msgid " - success" msgstr "- succès" -#: src/Console/MergeContacts.php:164 +#: src/Console/MergeContacts.php:165 msgid " - deleted" msgstr "- supprimé(s)" -#: src/Console/MergeContacts.php:167 +#: src/Console/MergeContacts.php:168 msgid " - done" msgstr "- fait(s)" @@ -1793,12 +1793,12 @@ msgid "Enter new password: " msgstr "Entrer le nouveau mot de passe :" #: src/Console/User.php:210 src/Module/Security/PasswordTooLong.php:65 -#: src/Module/Settings/Account.php:74 +#: src/Module/Settings/Account.php:75 msgid "Password update failed. Please try again." msgstr "Le changement de mot de passe a échoué. Merci de recommencer." #: src/Console/User.php:213 src/Module/Security/PasswordTooLong.php:68 -#: src/Module/Settings/Account.php:77 +#: src/Module/Settings/Account.php:78 msgid "Password changed." msgstr "Mot de passe changé." @@ -1977,7 +1977,7 @@ msgid "%s attends maybe." msgstr "%s participe peut-être" #: src/Content/Conversation.php:222 src/Content/Conversation.php:260 -#: src/Content/Conversation.php:873 +#: src/Content/Conversation.php:874 #, php-format msgid "%s reshared this." msgstr "%s a partagé ceci." @@ -2050,7 +2050,7 @@ msgstr "%2$d personnes ont partagé ceci" msgid "Visible to everybody" msgstr "Visible par tout le monde" -#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:171 +#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:198 #: src/Object/Post.php:1002 msgid "Please enter a image/video/audio/webpage URL:" msgstr "Veuillez entrer une URL d'image/vidéo/page web." @@ -2071,7 +2071,7 @@ msgstr "Où êtes-vous actuellement ?" msgid "Delete item(s)?" msgstr "Supprimer les élément(s) ?" -#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:143 +#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:175 msgid "Created at" msgstr "Créé à" @@ -2083,7 +2083,7 @@ msgstr "Nouvelle publication" msgid "Share" msgstr "Partager" -#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:168 +#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:195 #: src/Object/Post.php:999 msgid "Image" msgstr "Image" @@ -2092,117 +2092,117 @@ msgstr "Image" msgid "Video" msgstr "Vidéo" -#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:184 +#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:222 msgid "Scheduled at" msgstr "Prévu pour" -#: src/Content/Conversation.php:657 src/Object/Post.php:244 +#: src/Content/Conversation.php:658 src/Object/Post.php:244 msgid "Pinned item" msgstr "Élément épinglé" -#: src/Content/Conversation.php:673 src/Object/Post.php:486 +#: src/Content/Conversation.php:674 src/Object/Post.php:486 #: src/Object/Post.php:487 #, php-format msgid "View %s's profile @ %s" msgstr "Voir le profil de %s @ %s" -#: src/Content/Conversation.php:686 src/Object/Post.php:474 +#: src/Content/Conversation.php:687 src/Object/Post.php:474 msgid "Categories:" msgstr "Catégories :" -#: src/Content/Conversation.php:687 src/Object/Post.php:475 +#: src/Content/Conversation.php:688 src/Object/Post.php:475 msgid "Filed under:" msgstr "Rangé sous :" -#: src/Content/Conversation.php:695 src/Object/Post.php:500 +#: src/Content/Conversation.php:696 src/Object/Post.php:500 #, php-format msgid "%s from %s" msgstr "%s de %s" -#: src/Content/Conversation.php:711 +#: src/Content/Conversation.php:712 msgid "View in context" msgstr "Voir dans le contexte" -#: src/Content/Conversation.php:776 +#: src/Content/Conversation.php:777 msgid "remove" msgstr "enlever" -#: src/Content/Conversation.php:780 +#: src/Content/Conversation.php:781 msgid "Delete Selected Items" msgstr "Supprimer les éléments sélectionnés" -#: src/Content/Conversation.php:845 src/Content/Conversation.php:848 -#: src/Content/Conversation.php:851 src/Content/Conversation.php:854 +#: src/Content/Conversation.php:846 src/Content/Conversation.php:849 +#: src/Content/Conversation.php:852 src/Content/Conversation.php:855 #, php-format msgid "You had been addressed (%s)." msgstr "Vous avez été mentionné (%s)" -#: src/Content/Conversation.php:857 +#: src/Content/Conversation.php:858 #, php-format msgid "You are following %s." msgstr "Vous suivez %s." -#: src/Content/Conversation.php:860 +#: src/Content/Conversation.php:861 msgid "You subscribed to one or more tags in this post." msgstr "Vous vous êtes abonné(e) à une étiquette ou plus de cette publication." -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 msgid "Reshared" msgstr "Partagé" -#: src/Content/Conversation.php:875 +#: src/Content/Conversation.php:876 #, php-format msgid "Reshared by %s <%s>" msgstr "Partagé par %s <%s>" -#: src/Content/Conversation.php:878 +#: src/Content/Conversation.php:879 #, php-format msgid "%s is participating in this thread." msgstr "%s participe à ce fil de discussion" -#: src/Content/Conversation.php:881 +#: src/Content/Conversation.php:882 msgid "Stored for general reasons" msgstr "Stocké pour des raisons générales." -#: src/Content/Conversation.php:884 +#: src/Content/Conversation.php:885 msgid "Global post" msgstr "Publication globale" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 msgid "Sent via an relay server" msgstr "Envoyé via un serveur relais" -#: src/Content/Conversation.php:887 +#: src/Content/Conversation.php:888 #, php-format msgid "Sent via the relay server %s <%s>" msgstr "Envoyé par le serveur relais %s <%s>" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 msgid "Fetched" msgstr "Récupéré" -#: src/Content/Conversation.php:890 +#: src/Content/Conversation.php:891 #, php-format msgid "Fetched because of %s <%s>" msgstr "Récupéré grâce à %s <%s>" -#: src/Content/Conversation.php:893 +#: src/Content/Conversation.php:894 msgid "Stored because of a child post to complete this thread." msgstr "Stocké parce qu'une publication fille complète ce fil de discussion." -#: src/Content/Conversation.php:896 +#: src/Content/Conversation.php:897 msgid "Local delivery" msgstr "Distribution locale" -#: src/Content/Conversation.php:899 +#: src/Content/Conversation.php:900 msgid "Stored because of your activity (like, comment, star, ...)" msgstr "Stocké en lien avec votre activité (j'aime, commentaire, étoile...)" -#: src/Content/Conversation.php:902 +#: src/Content/Conversation.php:903 msgid "Distributed" msgstr "Distribué" -#: src/Content/Conversation.php:905 +#: src/Content/Conversation.php:906 msgid "Pushed to us" msgstr "Poussé vers nous" @@ -2304,7 +2304,7 @@ msgstr "Afficher l'ancienneté" msgid "Display membership date in profile" msgstr "Affiche la date de création du compte sur votre profile" -#: src/Content/ForumManager.php:151 src/Content/Nav.php:241 +#: src/Content/ForumManager.php:151 src/Content/Nav.php:242 #: src/Content/Text/HTML.php:903 src/Content/Widget.php:524 msgid "Forums" msgstr "Forums" @@ -2322,51 +2322,51 @@ msgstr "voir moins" msgid "show more" msgstr "montrer plus" -#: src/Content/Item.php:288 src/Model/Item.php:2763 +#: src/Content/Item.php:291 src/Model/Item.php:2853 msgid "event" msgstr "évènement" -#: src/Content/Item.php:380 view/theme/frio/theme.php:250 +#: src/Content/Item.php:383 view/theme/frio/theme.php:266 msgid "Follow Thread" msgstr "Suivre le fil" -#: src/Content/Item.php:381 src/Model/Contact.php:1114 +#: src/Content/Item.php:384 src/Model/Contact.php:1174 msgid "View Status" msgstr "Voir les statuts" -#: src/Content/Item.php:382 src/Content/Item.php:400 -#: src/Model/Contact.php:1052 src/Model/Contact.php:1106 -#: src/Model/Contact.php:1115 src/Module/Directory.php:158 +#: src/Content/Item.php:385 src/Content/Item.php:403 +#: src/Model/Contact.php:1112 src/Model/Contact.php:1166 +#: src/Model/Contact.php:1175 src/Module/Directory.php:158 #: src/Module/Settings/Profile/Index.php:225 msgid "View Profile" msgstr "Voir le profil" -#: src/Content/Item.php:383 src/Model/Contact.php:1116 +#: src/Content/Item.php:386 src/Model/Contact.php:1176 msgid "View Photos" msgstr "Voir les photos" -#: src/Content/Item.php:384 src/Model/Contact.php:1107 -#: src/Model/Contact.php:1117 +#: src/Content/Item.php:387 src/Model/Contact.php:1167 +#: src/Model/Contact.php:1177 msgid "Network Posts" msgstr "Publications du réseau" -#: src/Content/Item.php:385 src/Model/Contact.php:1108 -#: src/Model/Contact.php:1118 +#: src/Content/Item.php:388 src/Model/Contact.php:1168 +#: src/Model/Contact.php:1178 msgid "View Contact" msgstr "Voir Contact" -#: src/Content/Item.php:386 src/Model/Contact.php:1119 +#: src/Content/Item.php:389 src/Model/Contact.php:1179 msgid "Send PM" msgstr "Message privé" -#: src/Content/Item.php:387 src/Module/Admin/Blocklist/Contact.php:100 +#: src/Content/Item.php:390 src/Module/Admin/Blocklist/Contact.php:100 #: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154 -#: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Block" msgstr "Bloquer" -#: src/Content/Item.php:388 src/Module/Contact.php:399 +#: src/Content/Item.php:391 src/Module/Contact.php:402 #: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457 #: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:204 @@ -2374,105 +2374,105 @@ msgstr "Bloquer" msgid "Ignore" msgstr "Ignorer" -#: src/Content/Item.php:392 src/Object/Post.php:455 +#: src/Content/Item.php:395 src/Object/Post.php:455 msgid "Languages" msgstr "Langues" -#: src/Content/Nav.php:90 +#: src/Content/Nav.php:91 msgid "Nothing new here" msgstr "Rien de neuf ici" -#: src/Content/Nav.php:94 src/Module/Special/HTTPException.php:50 +#: src/Content/Nav.php:95 src/Module/Special/HTTPException.php:50 msgid "Go back" msgstr "Revenir" -#: src/Content/Nav.php:95 +#: src/Content/Nav.php:96 msgid "Clear notifications" msgstr "Effacer les notifications" -#: src/Content/Nav.php:96 src/Content/Text/HTML.php:890 +#: src/Content/Nav.php:97 src/Content/Text/HTML.php:890 msgid "@name, !forum, #tags, content" msgstr "@nom, !forum, #tags, contenu" -#: src/Content/Nav.php:185 src/Module/Security/Login.php:158 +#: src/Content/Nav.php:186 src/Module/Security/Login.php:158 msgid "Logout" msgstr "Se déconnecter" -#: src/Content/Nav.php:185 +#: src/Content/Nav.php:186 msgid "End this session" msgstr "Mettre fin à cette session" -#: src/Content/Nav.php:187 src/Module/Bookmarklet.php:44 +#: src/Content/Nav.php:188 src/Module/Bookmarklet.php:44 #: src/Module/Security/Login.php:159 msgid "Login" msgstr "Connexion" -#: src/Content/Nav.php:187 +#: src/Content/Nav.php:188 msgid "Sign in" msgstr "Se connecter" -#: src/Content/Nav.php:192 src/Module/BaseProfile.php:56 -#: src/Module/Contact.php:433 src/Module/Contact/Profile.php:380 -#: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:220 +#: src/Content/Nav.php:193 src/Module/BaseProfile.php:56 +#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380 +#: src/Module/Settings/TwoFactor/Index.php:120 view/theme/frio/theme.php:236 msgid "Status" msgstr "Statut" -#: src/Content/Nav.php:192 src/Content/Nav.php:275 -#: view/theme/frio/theme.php:220 +#: src/Content/Nav.php:193 src/Content/Nav.php:276 +#: view/theme/frio/theme.php:236 msgid "Your posts and conversations" msgstr "Vos publications et conversations" -#: src/Content/Nav.php:193 src/Module/BaseProfile.php:48 -#: src/Module/BaseSettings.php:55 src/Module/Contact.php:457 +#: src/Content/Nav.php:194 src/Module/BaseProfile.php:48 +#: src/Module/BaseSettings.php:55 src/Module/Contact.php:460 #: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:241 -#: src/Module/Welcome.php:57 view/theme/frio/theme.php:221 +#: src/Module/Welcome.php:57 view/theme/frio/theme.php:237 msgid "Profile" msgstr "Profil" -#: src/Content/Nav.php:193 view/theme/frio/theme.php:221 +#: src/Content/Nav.php:194 view/theme/frio/theme.php:237 msgid "Your profile page" msgstr "Votre page de profil" -#: src/Content/Nav.php:194 view/theme/frio/theme.php:222 +#: src/Content/Nav.php:195 view/theme/frio/theme.php:238 msgid "Your photos" msgstr "Vos photos" -#: src/Content/Nav.php:195 src/Module/BaseProfile.php:72 -#: src/Module/BaseProfile.php:75 src/Module/Contact.php:449 -#: view/theme/frio/theme.php:223 +#: src/Content/Nav.php:196 src/Module/BaseProfile.php:72 +#: src/Module/BaseProfile.php:75 src/Module/Contact.php:452 +#: view/theme/frio/theme.php:239 msgid "Media" msgstr "Média" -#: src/Content/Nav.php:195 view/theme/frio/theme.php:223 +#: src/Content/Nav.php:196 view/theme/frio/theme.php:239 msgid "Your postings with media" msgstr "Vos publications avec des médias" -#: src/Content/Nav.php:196 view/theme/frio/theme.php:224 +#: src/Content/Nav.php:197 view/theme/frio/theme.php:240 msgid "Your events" msgstr "Vos évènements" -#: src/Content/Nav.php:197 +#: src/Content/Nav.php:198 msgid "Personal notes" msgstr "Notes personnelles" -#: src/Content/Nav.php:197 +#: src/Content/Nav.php:198 msgid "Your personal notes" msgstr "Vos notes personnelles" -#: src/Content/Nav.php:214 src/Content/Nav.php:275 +#: src/Content/Nav.php:215 src/Content/Nav.php:276 msgid "Home" msgstr "Profil" -#: src/Content/Nav.php:218 src/Module/Register.php:168 +#: src/Content/Nav.php:219 src/Module/Register.php:168 #: src/Module/Security/Login.php:124 msgid "Register" msgstr "S'inscrire" -#: src/Content/Nav.php:218 +#: src/Content/Nav.php:219 msgid "Create an account" msgstr "Créer un compte" -#: src/Content/Nav.php:224 src/Module/Help.php:67 +#: src/Content/Nav.php:225 src/Module/Help.php:67 #: src/Module/Settings/TwoFactor/AppSpecific.php:127 #: src/Module/Settings/TwoFactor/Index.php:119 #: src/Module/Settings/TwoFactor/Recovery.php:105 @@ -2480,158 +2480,158 @@ msgstr "Créer un compte" msgid "Help" msgstr "Aide" -#: src/Content/Nav.php:224 +#: src/Content/Nav.php:225 msgid "Help and documentation" msgstr "Aide et documentation" -#: src/Content/Nav.php:228 +#: src/Content/Nav.php:229 msgid "Apps" msgstr "Applications" -#: src/Content/Nav.php:228 +#: src/Content/Nav.php:229 msgid "Addon applications, utilities, games" msgstr "Applications supplémentaires, utilitaires, jeux" -#: src/Content/Nav.php:232 src/Content/Text/HTML.php:888 +#: src/Content/Nav.php:233 src/Content/Text/HTML.php:888 #: src/Module/Admin/Logs/View.php:87 src/Module/Search/Index.php:112 msgid "Search" msgstr "Recherche" -#: src/Content/Nav.php:232 +#: src/Content/Nav.php:233 msgid "Search site content" msgstr "Rechercher dans le contenu du site" -#: src/Content/Nav.php:235 src/Content/Text/HTML.php:897 +#: src/Content/Nav.php:236 src/Content/Text/HTML.php:897 msgid "Full Text" msgstr "Texte Entier" -#: src/Content/Nav.php:236 src/Content/Text/HTML.php:898 +#: src/Content/Nav.php:237 src/Content/Text/HTML.php:898 #: src/Content/Widget/TagCloud.php:68 msgid "Tags" msgstr "Tags" -#: src/Content/Nav.php:237 src/Content/Nav.php:296 +#: src/Content/Nav.php:238 src/Content/Nav.php:297 #: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:125 -#: src/Module/BaseProfile.php:128 src/Module/Contact.php:370 -#: src/Module/Contact.php:464 view/theme/frio/theme.php:231 +#: src/Module/BaseProfile.php:128 src/Module/Contact.php:373 +#: src/Module/Contact.php:467 view/theme/frio/theme.php:247 msgid "Contacts" msgstr "Contacts" -#: src/Content/Nav.php:256 +#: src/Content/Nav.php:257 msgid "Community" msgstr "Communauté" -#: src/Content/Nav.php:256 +#: src/Content/Nav.php:257 msgid "Conversations on this and other servers" msgstr "Flux public global" -#: src/Content/Nav.php:260 src/Module/BaseProfile.php:87 -#: src/Module/BaseProfile.php:98 view/theme/frio/theme.php:228 +#: src/Content/Nav.php:261 src/Module/BaseProfile.php:87 +#: src/Module/BaseProfile.php:98 view/theme/frio/theme.php:244 msgid "Events and Calendar" msgstr "Évènements et agenda" -#: src/Content/Nav.php:263 +#: src/Content/Nav.php:264 msgid "Directory" msgstr "Annuaire" -#: src/Content/Nav.php:263 +#: src/Content/Nav.php:264 msgid "People directory" msgstr "Annuaire des utilisateurs" -#: src/Content/Nav.php:265 src/Module/BaseAdmin.php:88 +#: src/Content/Nav.php:266 src/Module/BaseAdmin.php:88 msgid "Information" msgstr "Information" -#: src/Content/Nav.php:265 +#: src/Content/Nav.php:266 msgid "Information about this friendica instance" msgstr "Information au sujet de cette instance de friendica" -#: src/Content/Nav.php:268 src/Module/Admin/Tos.php:76 +#: src/Content/Nav.php:269 src/Module/Admin/Tos.php:76 #: src/Module/BaseAdmin.php:99 src/Module/Register.php:176 #: src/Module/Tos.php:87 msgid "Terms of Service" msgstr "Conditions de service" -#: src/Content/Nav.php:268 +#: src/Content/Nav.php:269 msgid "Terms of Service of this Friendica instance" msgstr "Conditions d'Utilisation de ce serveur Friendica" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:227 +#: src/Content/Nav.php:274 view/theme/frio/theme.php:243 msgid "Network" msgstr "Réseau" -#: src/Content/Nav.php:273 view/theme/frio/theme.php:227 +#: src/Content/Nav.php:274 view/theme/frio/theme.php:243 msgid "Conversations from your friends" msgstr "Flux de conversations" -#: src/Content/Nav.php:279 +#: src/Content/Nav.php:280 msgid "Introductions" msgstr "Introductions" -#: src/Content/Nav.php:279 +#: src/Content/Nav.php:280 msgid "Friend Requests" msgstr "Demande d'abonnement" -#: src/Content/Nav.php:280 src/Module/BaseNotifications.php:148 +#: src/Content/Nav.php:281 src/Module/BaseNotifications.php:148 #: src/Module/Notifications/Introductions.php:73 msgid "Notifications" msgstr "Notifications" -#: src/Content/Nav.php:281 +#: src/Content/Nav.php:282 msgid "See all notifications" msgstr "Voir toutes les notifications" -#: src/Content/Nav.php:282 +#: src/Content/Nav.php:283 msgid "Mark all system notifications as seen" msgstr "Marquer toutes les notifications système comme vues" -#: src/Content/Nav.php:285 view/theme/frio/theme.php:229 +#: src/Content/Nav.php:286 view/theme/frio/theme.php:245 msgid "Private mail" msgstr "Messages privés" -#: src/Content/Nav.php:286 +#: src/Content/Nav.php:287 msgid "Inbox" msgstr "Messages entrants" -#: src/Content/Nav.php:287 +#: src/Content/Nav.php:288 msgid "Outbox" msgstr "Messages sortants" -#: src/Content/Nav.php:291 +#: src/Content/Nav.php:292 msgid "Accounts" msgstr "Comptes" -#: src/Content/Nav.php:291 +#: src/Content/Nav.php:292 msgid "Manage other pages" msgstr "Gérer les autres pages" -#: src/Content/Nav.php:294 src/Module/Admin/Addons/Details.php:114 +#: src/Content/Nav.php:295 src/Module/Admin/Addons/Details.php:114 #: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:122 -#: src/Module/Welcome.php:52 view/theme/frio/theme.php:230 +#: src/Module/Welcome.php:52 view/theme/frio/theme.php:246 msgid "Settings" msgstr "Réglages" -#: src/Content/Nav.php:294 view/theme/frio/theme.php:230 +#: src/Content/Nav.php:295 view/theme/frio/theme.php:246 msgid "Account settings" msgstr "Compte" -#: src/Content/Nav.php:296 view/theme/frio/theme.php:231 +#: src/Content/Nav.php:297 view/theme/frio/theme.php:247 msgid "Manage/edit friends and contacts" msgstr "Gestion des contacts" -#: src/Content/Nav.php:301 src/Module/BaseAdmin.php:129 +#: src/Content/Nav.php:302 src/Module/BaseAdmin.php:129 msgid "Admin" msgstr "Admin" -#: src/Content/Nav.php:301 +#: src/Content/Nav.php:302 msgid "Site setup and configuration" msgstr "Démarrage et configuration du site" -#: src/Content/Nav.php:304 +#: src/Content/Nav.php:305 msgid "Navigation" msgstr "Navigation" -#: src/Content/Nav.php:304 +#: src/Content/Nav.php:305 msgid "Site map" msgstr "Carte du site" @@ -2659,38 +2659,38 @@ msgstr "suivant" msgid "last" msgstr "dernier" -#: src/Content/Text/BBCode.php:998 src/Content/Text/BBCode.php:1833 -#: src/Content/Text/BBCode.php:1834 +#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1883 +#: src/Content/Text/BBCode.php:1884 msgid "Image/photo" msgstr "Image/photo" -#: src/Content/Text/BBCode.php:1188 +#: src/Content/Text/BBCode.php:1238 #, php-format msgid "%2$s %3$s" msgstr "%2$s %3$s" -#: src/Content/Text/BBCode.php:1213 src/Model/Item.php:3339 -#: src/Model/Item.php:3345 src/Model/Item.php:3346 +#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3456 +#: src/Model/Item.php:3462 src/Model/Item.php:3463 msgid "Link to source" msgstr "Lien vers la source" -#: src/Content/Text/BBCode.php:1751 src/Content/Text/HTML.php:940 +#: src/Content/Text/BBCode.php:1801 src/Content/Text/HTML.php:940 msgid "Click to open/close" msgstr "Cliquer pour ouvrir/fermer" -#: src/Content/Text/BBCode.php:1782 +#: src/Content/Text/BBCode.php:1832 msgid "$1 wrote:" msgstr "$1 a écrit :" -#: src/Content/Text/BBCode.php:1838 src/Content/Text/BBCode.php:1839 +#: src/Content/Text/BBCode.php:1888 src/Content/Text/BBCode.php:1889 msgid "Encrypted content" msgstr "Contenu chiffré" -#: src/Content/Text/BBCode.php:2057 +#: src/Content/Text/BBCode.php:2109 msgid "Invalid source protocol" msgstr "Protocole d'image invalide" -#: src/Content/Text/BBCode.php:2072 +#: src/Content/Text/BBCode.php:2124 msgid "Invalid link protocol" msgstr "Protocole de lien invalide" @@ -2743,7 +2743,7 @@ msgstr "Entrez un nom ou un centre d'intérêt" msgid "Examples: Robert Morgenstein, Fishing" msgstr "Exemples : Robert Morgenstein, Pêche" -#: src/Content/Widget.php:82 src/Module/Contact.php:391 +#: src/Content/Widget.php:82 src/Module/Contact.php:394 #: src/Module/Directory.php:97 view/theme/vier/theme.php:183 msgid "Find" msgstr "Trouver" @@ -2770,7 +2770,7 @@ msgid "Local Directory" msgstr "Annuaire local" #: src/Content/Widget.php:211 src/Model/Group.php:587 -#: src/Module/Contact.php:354 src/Module/Welcome.php:76 +#: src/Module/Contact.php:357 src/Module/Welcome.php:76 msgid "Groups" msgstr "Groupes" @@ -2782,7 +2782,7 @@ msgstr "Tous les groupes" msgid "Relationships" msgstr "Relations" -#: src/Content/Widget.php:244 src/Module/Contact.php:306 +#: src/Content/Widget.php:244 src/Module/Contact.php:309 #: src/Module/Group.php:293 msgid "All Contacts" msgstr "Tous les contacts" @@ -2827,11 +2827,11 @@ msgstr "Personnes" msgid "Organisations" msgstr "Organisations" -#: src/Content/Widget.php:523 src/Model/Contact.php:1541 +#: src/Content/Widget.php:523 src/Model/Contact.php:1605 msgid "News" msgstr "Nouvelles" -#: src/Content/Widget.php:527 src/Module/Settings/Account.php:455 +#: src/Content/Widget.php:527 src/Module/Settings/Account.php:456 msgid "Account Types" msgstr "Type de compte" @@ -3273,32 +3273,37 @@ msgid "Could not connect to database." msgstr "Impossible de se connecter à la base." #: src/Core/L10n.php:403 src/Model/Event.php:428 -#: src/Module/Settings/Display.php:182 +#: src/Module/Settings/Display.php:184 msgid "Monday" msgstr "Lundi" #: src/Core/L10n.php:403 src/Model/Event.php:429 +#: src/Module/Settings/Display.php:185 msgid "Tuesday" msgstr "Mardi" #: src/Core/L10n.php:403 src/Model/Event.php:430 +#: src/Module/Settings/Display.php:186 msgid "Wednesday" msgstr "Mercredi" #: src/Core/L10n.php:403 src/Model/Event.php:431 +#: src/Module/Settings/Display.php:187 msgid "Thursday" msgstr "Jeudi" #: src/Core/L10n.php:403 src/Model/Event.php:432 +#: src/Module/Settings/Display.php:188 msgid "Friday" msgstr "Vendredi" #: src/Core/L10n.php:403 src/Model/Event.php:433 +#: src/Module/Settings/Display.php:189 msgid "Saturday" msgstr "Samedi" #: src/Core/L10n.php:403 src/Model/Event.php:427 -#: src/Module/Settings/Display.php:182 +#: src/Module/Settings/Display.php:183 msgid "Sunday" msgstr "Dimanche" @@ -3424,7 +3429,7 @@ msgstr "Déc" #: src/Core/Renderer.php:89 src/Core/Renderer.php:118 #: src/Core/Renderer.php:145 src/Core/Renderer.php:179 -#: src/Render/FriendicaSmartyEngine.php:57 +#: src/Render/FriendicaSmartyEngine.php:60 msgid "" "Friendica can't display this page at the moment, please contact the " "administrator." @@ -3452,36 +3457,36 @@ msgstr "Répertoire dans lequel les fichiers sont stockés. Pour une sécurité msgid "Enter a valid existing folder" msgstr "Entrez le chemin d'un dossier existant" -#: src/Core/Update.php:67 +#: src/Core/Update.php:69 #, php-format msgid "" "Updates from version %s are not supported. Please update at least to version" " 2021.01 and wait until the postupdate finished version 1383." msgstr "Les mises à jour automatiques ne sont pas disponibles depuis la version %s. Veuillez mettre à jour manuellement jusqu'à la version 2021.01 et attendre que la mise à jour des données atteigne la version 1383." -#: src/Core/Update.php:78 +#: src/Core/Update.php:80 #, php-format msgid "" "Updates from postupdate version %s are not supported. Please update at least" " to version 2021.01 and wait until the postupdate finished version 1383." msgstr "La mise à jour automatique des données n'est pas disponible depuis la version %s. Veuillez mettre à jour manuellement jusqu'à la version 2021.01 et attendre que la mise à jour des données atteigne la version 1383." -#: src/Core/Update.php:153 +#: src/Core/Update.php:155 #, php-format msgid "%s: executing pre update %d" msgstr "%s : Exécution de la mise à jour préalable %d" -#: src/Core/Update.php:191 +#: src/Core/Update.php:193 #, php-format msgid "%s: executing post update %d" msgstr "%s : Exécution de la mise à jour des données %d" -#: src/Core/Update.php:261 +#: src/Core/Update.php:263 #, php-format msgid "Update %s failed. See error logs." msgstr "Mise-à-jour %s échouée. Voir les journaux d'erreur." -#: src/Core/Update.php:315 +#: src/Core/Update.php:317 #, php-format msgid "" "\n" @@ -3491,16 +3496,16 @@ msgid "" "\t\t\t\tfriendica developer if you can not help me on your own. My database might be invalid." msgstr "\nLes développeur•se•s de Friendica ont récemment publié la mise à jour %s, mais en tentant de l’installer, quelque chose s’est terriblement mal passé. Une réparation s’impose et je ne peux pas la faire tout seul. Contactez un développeur Friendica si vous ne pouvez pas corriger le problème vous-même. Il est possible que ma base de données soit corrompue." -#: src/Core/Update.php:321 +#: src/Core/Update.php:323 #, php-format msgid "The error message is\\n[pre]%s[/pre]" msgstr "The message d'erreur est\\n[pre]%s[/pre]" -#: src/Core/Update.php:325 src/Core/Update.php:367 +#: src/Core/Update.php:327 src/Core/Update.php:369 msgid "[Friendica Notify] Database update" msgstr "[Friendica:Notification] Mise à jour de la base de données" -#: src/Core/Update.php:361 +#: src/Core/Update.php:363 #, php-format msgid "" "\n" @@ -3618,81 +3623,81 @@ msgstr "Erreur du site" msgid "Legacy module file not found: %s" msgstr "Module original non trouvé: %s" -#: src/Model/Contact.php:1110 src/Model/Contact.php:1121 +#: src/Model/Contact.php:1170 src/Model/Contact.php:1181 msgid "UnFollow" msgstr "Se désabonner" -#: src/Model/Contact.php:1127 src/Module/Admin/Users/Pending.php:107 +#: src/Model/Contact.php:1187 src/Module/Admin/Users/Pending.php:107 #: src/Module/Notifications/Introductions.php:130 #: src/Module/Notifications/Introductions.php:202 msgid "Approve" msgstr "Approuver" -#: src/Model/Contact.php:1537 +#: src/Model/Contact.php:1601 msgid "Organisation" msgstr "Organisation" -#: src/Model/Contact.php:1545 +#: src/Model/Contact.php:1609 msgid "Forum" msgstr "Forum" -#: src/Model/Contact.php:2634 +#: src/Model/Contact.php:2795 msgid "Disallowed profile URL." msgstr "URL de profil interdite." -#: src/Model/Contact.php:2639 src/Module/Friendica.php:81 +#: src/Model/Contact.php:2800 src/Module/Friendica.php:81 msgid "Blocked domain" msgstr "Domaine bloqué" -#: src/Model/Contact.php:2644 +#: src/Model/Contact.php:2805 msgid "Connect URL missing." msgstr "URL de connexion manquante." -#: src/Model/Contact.php:2653 +#: src/Model/Contact.php:2814 msgid "" "The contact could not be added. Please check the relevant network " "credentials in your Settings -> Social Networks page." msgstr "Le contact n'a pu être ajouté. Veuillez vérifier les identifiants du réseau concerné dans la page Réglages -> Réseaux Sociaux si pertinent." -#: src/Model/Contact.php:2695 +#: src/Model/Contact.php:2856 msgid "The profile address specified does not provide adequate information." msgstr "L'adresse de profil indiquée ne fournit par les informations adéquates." -#: src/Model/Contact.php:2697 +#: src/Model/Contact.php:2858 msgid "No compatible communication protocols or feeds were discovered." msgstr "Aucun protocole de communication ni aucun flux n'a pu être découvert." -#: src/Model/Contact.php:2700 +#: src/Model/Contact.php:2861 msgid "An author or name was not found." msgstr "Aucun auteur ou nom d'auteur n'a pu être trouvé." -#: src/Model/Contact.php:2703 +#: src/Model/Contact.php:2864 msgid "No browser URL could be matched to this address." msgstr "Aucune URL de navigation ne correspond à cette adresse." -#: src/Model/Contact.php:2706 +#: src/Model/Contact.php:2867 msgid "" "Unable to match @-style Identity Address with a known protocol or email " "contact." msgstr "Impossible de faire correspondre l'adresse d'identité en \"@\" avec un protocole connu ou un contact courriel." -#: src/Model/Contact.php:2707 +#: src/Model/Contact.php:2868 msgid "Use mailto: in front of address to force email check." msgstr "Utilisez mailto: en face d'une adresse pour l'obliger à être reconnue comme courriel." -#: src/Model/Contact.php:2713 +#: src/Model/Contact.php:2874 msgid "" "The profile address specified belongs to a network which has been disabled " "on this site." msgstr "L'adresse de profil spécifiée correspond à un réseau qui a été désactivé sur ce site." -#: src/Model/Contact.php:2718 +#: src/Model/Contact.php:2879 msgid "" "Limited profile. This person will be unable to receive direct/personal " "notifications from you." msgstr "Profil limité. Cette personne ne sera pas capable de recevoir des notifications directes/personnelles de votre part." -#: src/Model/Contact.php:2777 +#: src/Model/Contact.php:2938 msgid "Unable to retrieve contact information." msgstr "Impossible de récupérer les informations du contact." @@ -3812,33 +3817,33 @@ msgstr "Nom du groupe : " msgid "Edit groups" msgstr "Modifier les groupes" -#: src/Model/Item.php:1861 +#: src/Model/Item.php:1965 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "Langues détectées dans cette publication :\\n%s" -#: src/Model/Item.php:2767 +#: src/Model/Item.php:2857 msgid "activity" msgstr "activité" -#: src/Model/Item.php:2769 +#: src/Model/Item.php:2859 msgid "comment" msgstr "commentaire" -#: src/Model/Item.php:2772 +#: src/Model/Item.php:2862 msgid "post" msgstr "publication" -#: src/Model/Item.php:2888 +#: src/Model/Item.php:3005 #, php-format msgid "Content warning: %s" msgstr "Avertissement de contenu: %s" -#: src/Model/Item.php:3251 +#: src/Model/Item.php:3368 msgid "bytes" msgstr "octets" -#: src/Model/Item.php:3282 +#: src/Model/Item.php:3399 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" @@ -3846,7 +3851,7 @@ msgstr[0] "%2$s (%3$d%%, %1$d vote)" msgstr[1] "%2$s (%3$d%%, %1$d votes)" msgstr[2] "%2$s (%3$d%%, %1$d vote)" -#: src/Model/Item.php:3284 +#: src/Model/Item.php:3401 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" @@ -3854,7 +3859,7 @@ msgstr[0] "%2$s (%1$d vote)" msgstr[1] "%2$s (%1$d votes)" msgstr[2] "%2$s (%1$d vote)" -#: src/Model/Item.php:3289 +#: src/Model/Item.php:3406 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" @@ -3862,7 +3867,7 @@ msgstr[0] "%d votant. Fin du sondage : %s" msgstr[1] "%d votants. Fin du sondage : %s" msgstr[2] "%d votant. Fin du sondage : %s" -#: src/Model/Item.php:3291 +#: src/Model/Item.php:3408 #, php-format msgid "%d voter." msgid_plural "%d voters." @@ -3870,12 +3875,12 @@ msgstr[0] "%d votant." msgstr[1] "%d votants." msgstr[2] "%d votant." -#: src/Model/Item.php:3293 +#: src/Model/Item.php:3410 #, php-format msgid "Poll end: %s" msgstr "Fin du sondage : %s" -#: src/Model/Item.php:3327 src/Model/Item.php:3328 +#: src/Model/Item.php:3444 src/Model/Item.php:3445 msgid "View on separate page" msgstr "Voir dans une nouvelle page" @@ -4270,12 +4275,12 @@ msgid "" "\t\t\tThank you and welcome to %2$s." msgstr "\n\t\tLes informations de connexion sont les suivantes :\n\n\t\tLocalisation du site :\t%3$s\n\t\tNom d'utilisateur :\t\t%1$s\n\t\tMot de passe :\t\t%5$s\n\n\t\tVous pouvez changer votre mot de passe depuis la page \"Paramètres\" de votre compte après vous être\n\t\tconnecté.\n\n\t\tMerci de prendre quelques instants pour contrôler les autres paramètres de compte sur cette page.\n\n\t\tVous pouvez également ajouter des informations basiques à votre profil par défaut\n\t\t(sur la page \"Profils\") ainsi les autres personnes pourront vous trouver plus facilement.\n\n\t\tNous vous recommandons de définir votre nom complet, d'ajouter une photo de profil,\n\t\tquelques mots clés de profil (très utiles pour se faire de nouveaux amis) - et\n\t\tpeut-être le pays où vous vivez; si vous ne désirez pas être plus spécifique\n\t\tque cela.\n\n\t\tNous respectons totalement votre droit à la vie privée et aucun de ces éléments n'est nécessaire.\n\t\tSi vous êtes nouveau et ne connaissez personne ici, ils peuvent vous aider\n\t\tà vous faire de nouveaux amis intéressants.\n\n\t\tSi jamais vous souhaitiez supprimer votre compte, vous pouvez le faire à %3$s/removeme\n\n\t\tMerci et bienvenue sur %2$s." -#: src/Moderation/DomainPatternBlocklist.php:218 +#: src/Moderation/DomainPatternBlocklist.php:228 #, php-format msgid "[%s] Notice of remote server domain pattern block list update" msgstr "[%s] Annonce de mise à jour de la liste de blocage de motif de domaine de serveur distant" -#: src/Moderation/DomainPatternBlocklist.php:220 +#: src/Moderation/DomainPatternBlocklist.php:230 #, php-format msgid "" "Dear %s,\n" @@ -4315,9 +4320,9 @@ msgstr "Activer" #: src/Module/Admin/Blocklist/Server/Add.php:121 #: src/Module/Admin/Blocklist/Server/Import.php:117 #: src/Module/Admin/Blocklist/Server/Index.php:93 -#: src/Module/Admin/Federation.php:200 src/Module/Admin/Item/Delete.php:64 +#: src/Module/Admin/Federation.php:201 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:84 -#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:433 +#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:431 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:233 #: src/Module/Admin/Themes/Details.php:90 #: src/Module/Admin/Themes/Index.php:111 src/Module/Admin/Tos.php:75 @@ -4382,8 +4387,8 @@ msgstr "Actif" msgid "List of active accounts" msgstr "Liste des comptes actifs" -#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:314 -#: src/Module/Contact.php:374 +#: src/Module/Admin/BaseUsers.php:67 src/Module/Contact.php:317 +#: src/Module/Contact.php:377 msgid "Pending" msgstr "En attente" @@ -4391,8 +4396,8 @@ msgstr "En attente" msgid "List of pending registrations" msgstr "Liste des inscriptions en attente" -#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:322 -#: src/Module/Contact.php:375 +#: src/Module/Admin/BaseUsers.php:75 src/Module/Contact.php:325 +#: src/Module/Contact.php:378 msgid "Blocked" msgstr "Bloqués" @@ -4408,19 +4413,19 @@ msgstr "Supprimé" msgid "List of pending user deletions" msgstr "Liste des utilisateurs en attente de suppression" -#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:493 +#: src/Module/Admin/BaseUsers.php:100 src/Module/Settings/Account.php:494 msgid "Normal Account Page" msgstr "Compte normal" -#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:500 +#: src/Module/Admin/BaseUsers.php:101 src/Module/Settings/Account.php:501 msgid "Soapbox Page" msgstr "Compte \"boîte à savon\"" -#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:507 +#: src/Module/Admin/BaseUsers.php:102 src/Module/Settings/Account.php:508 msgid "Public Forum" msgstr "Forum public" -#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:514 +#: src/Module/Admin/BaseUsers.php:103 src/Module/Settings/Account.php:515 msgid "Automatic Friend Page" msgstr "Abonnement réciproque" @@ -4428,19 +4433,19 @@ msgstr "Abonnement réciproque" msgid "Private Forum" msgstr "Forum Privé" -#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:465 +#: src/Module/Admin/BaseUsers.php:107 src/Module/Settings/Account.php:466 msgid "Personal Page" msgstr "Page personnelle" -#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:472 +#: src/Module/Admin/BaseUsers.php:108 src/Module/Settings/Account.php:473 msgid "Organisation Page" msgstr "Page Associative" -#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:479 +#: src/Module/Admin/BaseUsers.php:109 src/Module/Settings/Account.php:480 msgid "News Page" msgstr "Page d'informations" -#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:486 +#: src/Module/Admin/BaseUsers.php:110 src/Module/Settings/Account.php:487 msgid "Community Forum" msgstr "Forum Communautaire" @@ -4487,7 +4492,7 @@ msgstr "Sélectionner tous" #: src/Module/Admin/Blocklist/Contact.php:101 #: src/Module/Admin/Users/Blocked.php:142 src/Module/Admin/Users/Index.php:156 -#: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 +#: src/Module/Contact.php:401 src/Module/Contact/Profile.php:348 #: src/Module/Contact/Profile.php:449 msgid "Unblock" msgstr "Débloquer" @@ -4853,15 +4858,15 @@ msgstr "Verouiller la fonctionnalité %s" msgid "Manage Additional Features" msgstr "Gérer les fonctionnalités avancées" -#: src/Module/Admin/Federation.php:68 +#: src/Module/Admin/Federation.php:69 msgid "Other" msgstr "Autre" -#: src/Module/Admin/Federation.php:140 src/Module/Admin/Federation.php:389 +#: src/Module/Admin/Federation.php:141 src/Module/Admin/Federation.php:390 msgid "unknown" msgstr "inconnu" -#: src/Module/Admin/Federation.php:173 +#: src/Module/Admin/Federation.php:174 #, php-format msgid "%2$s total system" msgid_plural "%2$s total systems" @@ -4869,7 +4874,7 @@ msgstr[0] "%2$s système au total" msgstr[1] "%2$s systèmes au total" msgstr[2] "%2$s système au total" -#: src/Module/Admin/Federation.php:174 +#: src/Module/Admin/Federation.php:175 #, php-format msgid "%2$s active user last month" msgid_plural "%2$s active users last month" @@ -4877,7 +4882,7 @@ msgstr[0] "%2$s utilisateur actif le mois dernier" msgstr[1] "%2$s utilisateurs actifs le mois dernier" msgstr[2] "%2$s utilisateur actif le mois dernier" -#: src/Module/Admin/Federation.php:175 +#: src/Module/Admin/Federation.php:176 #, php-format msgid "%2$s active user last six months" msgid_plural "%2$s active users last six months" @@ -4885,7 +4890,7 @@ msgstr[0] "%2$s utilisateur actif ces six derniers mois" msgstr[1] "%2$s utilisateurs actifs ces six derniers mois" msgstr[2] "%2$s utilisateur actif ces six derniers mois" -#: src/Module/Admin/Federation.php:176 +#: src/Module/Admin/Federation.php:177 #, php-format msgid "%2$s registered user" msgid_plural "%2$s registered users" @@ -4893,7 +4898,7 @@ msgstr[0] "%2$s utilisateur enregistré" msgstr[1] "%2$s utilisateurs enregistrés" msgstr[2] "%2$s utilisateur enregistré" -#: src/Module/Admin/Federation.php:177 +#: src/Module/Admin/Federation.php:178 #, php-format msgid "%2$s locally created post or comment" msgid_plural "%2$s locally created posts and comments" @@ -4901,7 +4906,7 @@ msgstr[0] "%2$s publication ou commentaire créé localement" msgstr[1] "%2$s publications et commentaires créés localement" msgstr[2] "%2$s publication ou commentaire créé localement" -#: src/Module/Admin/Federation.php:180 +#: src/Module/Admin/Federation.php:181 #, php-format msgid "%2$s post per user" msgid_plural "%2$s posts per user" @@ -4909,7 +4914,7 @@ msgstr[0] "%2$s publication par utilisateur" msgstr[1] "%2$s publications par utilisateur" msgstr[2] "%2$s publication par utilisateur" -#: src/Module/Admin/Federation.php:185 +#: src/Module/Admin/Federation.php:186 #, php-format msgid "%2$s user per system" msgid_plural "%2$s users per system" @@ -4917,18 +4922,18 @@ msgstr[0] "%2$s utilisateur par système" msgstr[1] "%2$s utilisateurs par système" msgstr[2] "%2$s utilisateur par système" -#: src/Module/Admin/Federation.php:195 +#: src/Module/Admin/Federation.php:196 msgid "" "This page offers you some numbers to the known part of the federated social " "network your Friendica node is part of. These numbers are not complete but " "only reflect the part of the network your node is aware of." msgstr "Cette page montre quelques statistiques de la partie connue du réseau social fédéré dont votre instance Friendica fait partie. Ces chiffres sont partiels et ne reflètent que la portion du réseau dont votre instance a connaissance." -#: src/Module/Admin/Federation.php:201 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Federation.php:202 src/Module/BaseAdmin.php:90 msgid "Federation Statistics" msgstr "Statistiques Federation" -#: src/Module/Admin/Federation.php:205 +#: src/Module/Admin/Federation.php:206 #, php-format msgid "" "Currently this node is aware of %2$s node (%3$s active users last month, " @@ -5193,459 +5198,459 @@ msgstr "Paramètres de la tâche" msgid "Priority" msgstr "Priorité" -#: src/Module/Admin/Site.php:338 src/Module/Settings/Display.php:138 +#: src/Module/Admin/Site.php:336 src/Module/Settings/Display.php:138 msgid "No special theme for mobile devices" msgstr "Pas de thème particulier pour les terminaux mobiles" -#: src/Module/Admin/Site.php:355 src/Module/Settings/Display.php:148 +#: src/Module/Admin/Site.php:353 src/Module/Settings/Display.php:148 #, php-format msgid "%s - (Experimental)" msgstr "%s- (expérimental)" -#: src/Module/Admin/Site.php:367 -msgid "No community page for local users" -msgstr "Pas de page communauté pour les utilisateurs enregistrés" - -#: src/Module/Admin/Site.php:368 +#: src/Module/Admin/Site.php:365 msgid "No community page" msgstr "Aucune page de communauté" -#: src/Module/Admin/Site.php:369 +#: src/Module/Admin/Site.php:366 +msgid "No community page for visitors" +msgstr "Aucune page communautaire pour les visiteurs" + +#: src/Module/Admin/Site.php:367 msgid "Public postings from users of this site" msgstr "Publications publiques des utilisateurs de ce site" -#: src/Module/Admin/Site.php:370 +#: src/Module/Admin/Site.php:368 msgid "Public postings from the federated network" msgstr "Publications publiques du réseau fédéré" -#: src/Module/Admin/Site.php:371 +#: src/Module/Admin/Site.php:369 msgid "Public postings from local users and the federated network" msgstr "Publications publiques des utilisateurs du site et du réseau fédéré" -#: src/Module/Admin/Site.php:377 +#: src/Module/Admin/Site.php:375 msgid "Multi user instance" msgstr "Instance multi-utilisateurs" -#: src/Module/Admin/Site.php:404 +#: src/Module/Admin/Site.php:402 msgid "Closed" msgstr "Fermé" -#: src/Module/Admin/Site.php:405 +#: src/Module/Admin/Site.php:403 msgid "Requires approval" msgstr "Demande une apptrobation" -#: src/Module/Admin/Site.php:406 +#: src/Module/Admin/Site.php:404 msgid "Open" msgstr "Ouvert" -#: src/Module/Admin/Site.php:410 src/Module/Install.php:222 +#: src/Module/Admin/Site.php:408 src/Module/Install.php:222 msgid "No SSL policy, links will track page SSL state" msgstr "Pas de politique SSL, le liens conserveront l'état SSL de la page" -#: src/Module/Admin/Site.php:411 src/Module/Install.php:223 +#: src/Module/Admin/Site.php:409 src/Module/Install.php:223 msgid "Force all links to use SSL" msgstr "Forcer tous les liens à utiliser SSL" -#: src/Module/Admin/Site.php:412 src/Module/Install.php:224 +#: src/Module/Admin/Site.php:410 src/Module/Install.php:224 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "Certificat auto-signé, n'utiliser SSL que pour les liens locaux (non recommandé)" -#: src/Module/Admin/Site.php:416 +#: src/Module/Admin/Site.php:414 msgid "Don't check" msgstr "Ne pas rechercher" -#: src/Module/Admin/Site.php:417 +#: src/Module/Admin/Site.php:415 msgid "check the stable version" msgstr "Rechercher les versions stables" -#: src/Module/Admin/Site.php:418 +#: src/Module/Admin/Site.php:416 msgid "check the development version" msgstr "Rechercher les versions de développement" -#: src/Module/Admin/Site.php:422 +#: src/Module/Admin/Site.php:420 msgid "none" msgstr "aucun" -#: src/Module/Admin/Site.php:423 +#: src/Module/Admin/Site.php:421 msgid "Local contacts" msgstr "Contacts locaux" -#: src/Module/Admin/Site.php:424 +#: src/Module/Admin/Site.php:422 msgid "Interactors" msgstr "Interagisseurs" -#: src/Module/Admin/Site.php:434 src/Module/BaseAdmin.php:93 +#: src/Module/Admin/Site.php:432 src/Module/BaseAdmin.php:93 msgid "Site" msgstr "Site" -#: src/Module/Admin/Site.php:435 +#: src/Module/Admin/Site.php:433 msgid "General Information" msgstr "Information générale" -#: src/Module/Admin/Site.php:437 +#: src/Module/Admin/Site.php:435 msgid "Republish users to directory" msgstr "Republier les utilisateurs sur le répertoire" -#: src/Module/Admin/Site.php:438 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:436 src/Module/Register.php:152 msgid "Registration" msgstr "Inscription" -#: src/Module/Admin/Site.php:439 +#: src/Module/Admin/Site.php:437 msgid "File upload" msgstr "Téléversement de fichier" -#: src/Module/Admin/Site.php:440 +#: src/Module/Admin/Site.php:438 msgid "Policies" msgstr "Politiques" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:440 msgid "Auto Discovered Contact Directory" msgstr "Répertoire de Contacts Découverts Automatiquement" -#: src/Module/Admin/Site.php:443 +#: src/Module/Admin/Site.php:441 msgid "Performance" msgstr "Performance" -#: src/Module/Admin/Site.php:444 +#: src/Module/Admin/Site.php:442 msgid "Worker" msgstr "Worker" -#: src/Module/Admin/Site.php:445 +#: src/Module/Admin/Site.php:443 msgid "Message Relay" msgstr "Relai de publication" -#: src/Module/Admin/Site.php:446 +#: src/Module/Admin/Site.php:444 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "Utilisez la commande \"console relay\" en ligne de commande pour ajouter ou retirer des relais." -#: src/Module/Admin/Site.php:447 +#: src/Module/Admin/Site.php:445 msgid "The system is not subscribed to any relays at the moment." msgstr "Ce serveur n'est pas abonné à un relai pour le moment." -#: src/Module/Admin/Site.php:448 +#: src/Module/Admin/Site.php:446 msgid "The system is currently subscribed to the following relays:" msgstr "Ce serveur est actuellement abonné aux relais suivants:" -#: src/Module/Admin/Site.php:450 +#: src/Module/Admin/Site.php:448 msgid "Relocate Node" msgstr "Déplacer le nœud" -#: src/Module/Admin/Site.php:451 +#: src/Module/Admin/Site.php:449 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "Déplacer votre nœud vous permet de changer le domaine DNS de celui-ci et de conserver tous les utilisateurs existants ainsi que les publications. Ce processus prend un certain temps et ne peut être lancé que depuis la ligne de commande relocate de la façon suivante :" -#: src/Module/Admin/Site.php:452 +#: src/Module/Admin/Site.php:450 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "(Friendica directory)# bin/console relocate https://nouveaudomaine.fr" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:454 msgid "Site name" msgstr "Nom du site" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:455 msgid "Sender Email" msgstr "Courriel de l'émetteur" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:455 msgid "" "The email address your server shall use to send notification emails from." msgstr "L'adresse courriel à partir de laquelle votre serveur enverra des courriels." -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:456 msgid "Name of the system actor" msgstr "Nom du compte système" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:456 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "Nom du compte interne utilisé pour effectuer les requêtes ActivityPub. Ce nom doit être inutilisé actuellement. Une fois défini, ce nom ne peut pas être changé." -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:457 msgid "Banner/Logo" msgstr "Bannière/Logo" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:458 msgid "Email Banner/Logo" msgstr "Bannière/Logo d'email" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:459 msgid "Shortcut icon" msgstr "Icône de raccourci" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:459 msgid "Link to an icon that will be used for browsers." msgstr "Lien vers une icône qui sera utilisée pour les navigateurs." -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:460 msgid "Touch icon" msgstr "Icône pour systèmes tactiles" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:460 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "Lien vers une icône qui sera utilisée pour les tablettes et les mobiles." -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:461 msgid "Additional Info" msgstr "Informations supplémentaires" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:461 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "Description publique destinée au répertoire global de sites Friendica." -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:462 msgid "System language" msgstr "Langue du système" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:463 msgid "System theme" msgstr "Thème du système" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:463 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "Thème système par défaut - peut être modifié par profil utilisateur - Changer les paramètres de thème par défaut" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:464 msgid "Mobile system theme" msgstr "Thème mobile" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:464 msgid "Theme for mobile devices" msgstr "Thème pour les terminaux mobiles" -#: src/Module/Admin/Site.php:467 src/Module/Install.php:232 +#: src/Module/Admin/Site.php:465 src/Module/Install.php:232 msgid "SSL link policy" msgstr "Politique SSL pour les liens" -#: src/Module/Admin/Site.php:467 src/Module/Install.php:234 +#: src/Module/Admin/Site.php:465 src/Module/Install.php:234 msgid "Determines whether generated links should be forced to use SSL" msgstr "Détermine si les liens générés doivent forcer l'utilisation de SSL" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:466 msgid "Force SSL" msgstr "SSL obligatoire" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:466 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead" " to endless loops." msgstr "Redirige toutes les requêtes en clair vers des requêtes SSL. Attention : sur certains systèmes cela peut conduire à des boucles de redirection infinies." -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:467 msgid "Show help entry from navigation menu" msgstr "Montrer l'aide dans le menu de navigation" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:467 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "Montre l'Aide dans le menu de navigation. L'aide reste accessible en naviguant vers /help directement." -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:468 msgid "Single user instance" msgstr "Instance mono-utilisateur" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:468 msgid "Make this instance multi-user or single-user for the named user" msgstr "Transformer cette en instance en multi-utilisateur ou mono-utilisateur pour cet l'utilisateur." -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:470 msgid "Maximum image size" msgstr "Taille maximale des images" -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:470 msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " "limits." msgstr "Taille maximale des images envoyées (en octets). 0 par défaut, c'est à dire \"aucune limite\"." -#: src/Module/Admin/Site.php:473 +#: src/Module/Admin/Site.php:471 msgid "Maximum image length" msgstr "Longueur maximale des images" -#: src/Module/Admin/Site.php:473 +#: src/Module/Admin/Site.php:471 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "Longueur maximale en pixels du plus long côté des images téléversées. La valeur par défaut est -1 : absence de limite." -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:472 msgid "JPEG image quality" msgstr "Qualité JPEG des images" -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:472 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "Les JPEGs téléversés seront sauvegardés avec ce niveau de qualité [0-100]. La valeur par défaut est 100, soit la qualité maximale." -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:474 msgid "Register policy" msgstr "Politique d'inscription" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:475 msgid "Maximum Daily Registrations" msgstr "Inscriptions maximum par jour" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:475 msgid "" "If registration is permitted above, this sets the maximum number of new user" " registrations to accept per day. If register is set to closed, this " "setting has no effect." msgstr "Si les inscriptions sont permises ci-dessus, ceci fixe le nombre maximum d'inscriptions de nouveaux utilisateurs acceptées par jour. Si les inscriptions ne sont pas ouvertes, ce paramètre n'a aucun effet." -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:476 msgid "Register text" msgstr "Texte d'inscription" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:476 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "Ce texte est affiché sur la page d'inscription. Les BBCodes sont autorisés." -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:477 msgid "Forbidden Nicknames" msgstr "Identifiants réservés" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:477 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "Liste d'identifiants réservés séparés par des virgules. Ces identifiants ne peuvent pas être utilisés pour s'enregistrer. La liste de base provient de la RFC 2142." -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:478 msgid "Accounts abandoned after x days" msgstr "Les comptes sont abandonnés après x jours" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:478 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "Pour ne pas gaspiller les ressources système, on cesse d'interroger les sites distants pour les comptes abandonnés. Mettre 0 pour désactiver cette fonction." -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:479 msgid "Allowed friend domains" msgstr "Domaines autorisés" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:479 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "Une liste de domaines, séparés par des virgules, autorisés à établir des relations avec les utilisateurs de ce site. Les '*' sont acceptés. Laissez vide pour autoriser tous les domaines" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:480 msgid "Allowed email domains" msgstr "Domaines courriel autorisés" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:480 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "Liste de domaines - séparés par des virgules - dont les adresses e-mail sont autorisées à s'inscrire sur ce site. Les '*' sont acceptées. Laissez vide pour autoriser tous les domaines" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:481 msgid "No OEmbed rich content" msgstr "Désactiver le texte riche avec OEmbed" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:481 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "Evite le contenu riche avec OEmbed (comme un document PDF incrusté), sauf provenant des domaines autorisés listés ci-après." -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:482 msgid "Trusted third-party domains" msgstr "Domaines tierce-partie de confiance" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:482 msgid "" "Comma separated list of domains from which content is allowed to be embedded" " in posts like with OEmbed. All sub-domains of the listed domains are " "allowed as well." msgstr "Liste séparée par des virgules de domaines dont le contenu est autorisé à être intégré dans les publications comme avec OEmbed. Tous les sous-domaines des domains mentionnés sont autorisés également." -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:483 msgid "Block public" msgstr "Interdire la publication globale" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:483 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "Cocher pour bloquer les accès anonymes (non-connectés) à tout sauf aux pages personnelles publiques." -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "Force publish" msgstr "Forcer la publication globale" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "Cocher pour publier obligatoirement tous les profils locaux dans l'annuaire du site." -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:484 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "Activer cette option peut potentiellement enfreindre les lois sur la protection de la vie privée comme le RGPD." -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:485 msgid "Global directory URL" msgstr "URL de l'annuaire global" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:485 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "URL de l'annuaire global. Si ce champ n'est pas défini, l'annuaire global sera complètement indisponible pour l'application." -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:486 msgid "Private posts by default for new users" msgstr "Publications privées par défaut pour les nouveaux utilisateurs" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:486 msgid "" "Set default post permissions for all new members to the default privacy " "group rather than public." msgstr "Rendre les publications de tous les nouveaux utilisateurs accessibles seulement par le groupe de contacts par défaut, et non par tout le monde." -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:487 msgid "Don't include post content in email notifications" msgstr "Ne pas inclure le contenu posté dans l'e-mail de notification" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:487 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "Ne pas inclure le contenu de publication/commentaire/message privé/etc dans l'e-mail de notification qui est envoyé à partir du site, par mesure de confidentialité." -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:488 msgid "Disallow public access to addons listed in the apps menu." msgstr "Interdire l’accès public pour les greffons listées dans le menu apps." -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:488 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "Cocher cette case restreint la liste des greffons dans le menu des applications seulement aux membres." -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:489 msgid "Don't embed private images in posts" msgstr "Ne pas miniaturiser les images privées dans les publications" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:489 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " @@ -5653,11 +5658,11 @@ msgid "" "while." msgstr "Ne remplacez pas les images privées hébergées localement dans les publications avec une image attaché en copie, car cela signifie que le contact qui reçoit les publications contenant ces photos privées devra s’authentifier pour charger chaque image, ce qui peut prendre du temps." -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:490 msgid "Explicit Content" msgstr "Contenu adulte" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:490 msgid "" "Set this to announce that your node is used mostly for explicit content that" " might not be suited for minors. This information will be published in the " @@ -5666,257 +5671,257 @@ msgid "" "will be shown at the user registration page." msgstr "Activez cette option si votre site est principalement utilisé pour publier du contenu adulte. Cette information est publique et peut être utilisée pour filtrer votre site dans le répertoire de site global. Elle est également affichée sur la page d'inscription." -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:491 msgid "Proxify external content" msgstr "Faire transiter le contenu externe par un proxy" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:491 msgid "" "Route external content via the proxy functionality. This is used for example" " for some OEmbed accesses and in some other rare cases." msgstr "Dirige le contenu externe par la fonctionnalité proxy. Cela est utilisé par exemple pour certains accès OEmbed et dans certains autres cas rares." -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:492 msgid "Cache contact avatars" msgstr "Mettre en cache les avatars des contacts" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:492 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "Stocker localement les images d'avatar des contacts. Cela utilise beaucoup d'espace disque mais améliore les performances." -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:493 msgid "Allow Users to set remote_self" msgstr "Autoriser les utilisateurs à définir remote_self" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:493 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "Cocher cette case, permet à chaque utilisateur de marquer chaque contact comme un remote_self dans la boîte de dialogue de réparation des contacts. Activer cette fonction à un contact engendre la réplique de toutes les publications d'un contact dans le flux d'activités des utilisateurs." -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:494 msgid "Enable multiple registrations" msgstr "Autoriser les comptes multiples" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:494 msgid "Enable users to register additional accounts for use as pages." msgstr "Permet aux utilisateurs d'enregistrer des comptes supplémentaires pour être utilisés comme pages." -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:495 msgid "Enable OpenID" msgstr "Activer OpenID" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:495 msgid "Enable OpenID support for registration and logins." msgstr "Permet l'utilisation d'OpenID pour l'enregistrement de compte et l'identification." -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:496 msgid "Enable Fullname check" msgstr "Forcer l'utilisation de noms complets" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:496 msgid "" "Enable check to only allow users to register with a space between the first " "name and the last name in their full name." msgstr "Oblige les utilisateurs à include au moins un espace dans leur nom d'usage comme entre un prénom et un nom de famille." -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:497 msgid "Community pages for visitors" msgstr "Affichage de la page communauté pour les utilisateurs anonymes" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:497 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "Quelles pages communauté sont disponibles pour les utilisateurs anonymes." -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:498 msgid "Posts per user on community page" msgstr "Nombre de publications par utilisateur sur la page de la communauté (n'est pas valide pour " -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:498 msgid "" "The maximum number of posts per user on the community page. (Not valid for " "\"Global Community\")" msgstr "Le nombre maximum de publications par auteur par page dans le flux communautaire local." -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:500 msgid "Enable Mail support" msgstr "Activer la prise en charge e-mail" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:500 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "Permet de se connecter à un compte IMAP et de répondre directement aux e-mails via Friendica." -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:501 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "La prise en charge e-mail requiert le module PHP IMAP pour être activée." -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:502 msgid "Enable OStatus support" msgstr "Activer la prise en charge d'OStatus" -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:502 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "Permet la communication avec des comptes distants via OStatus (StatusNet, GNU Social, etc...). Toutes les publications OStatus sont publiques." -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:504 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub" " directory." msgstr "Le support de Diaspora ne peut pas être activé parce que Friendica a été installé dans un sous-répertoire." -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:505 msgid "Enable Diaspora support" msgstr "Activer le support de Diaspora" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:505 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "Permet la communication avec des comptes distants via Diaspora. Ce protocole est principalement utilisé par la plate-forme Diaspora." -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:506 msgid "Verify SSL" msgstr "Vérifier SSL" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:506 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you" " cannot connect (at all) to self-signed SSL sites." msgstr "Si vous le souhaitez, vous pouvez activier la vérification stricte des certificats. Cela signifie que vous ne pourrez pas vous connecter (du tout) aux sites SSL munis d'un certificat auto-signé." -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:507 msgid "Proxy user" msgstr "Utilisateur du proxy" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:507 msgid "User name for the proxy server." msgstr "Nom d'utilisateur pour le serveur proxy" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:508 msgid "Proxy URL" msgstr "URL du proxy" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:508 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "Si vous souhaitez utiliser un serveur proxy que Friendica devra employer pour se connecter au réseau, indiquez l'adresse du proxy ici." -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:509 msgid "Network timeout" msgstr "Dépassement du délai d'attente du réseau" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:509 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "Valeur en secondes. Mettre à 0 pour 'illimité' (pas recommandé)." -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:510 msgid "Maximum Load Average" msgstr "Plafond de la charge moyenne" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:510 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "La charge système maximal avant que les processus livraisons et de sondage de profils distants soient reportées. Défaut : %d." -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:511 msgid "Minimal Memory" msgstr "Mémoire minimum" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:511 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "Mémoire libre minimale pour les tâches de fond (en Mo). Requiert l'accès à /proc/meminfo. La valeur par défaut est 0 (désactivé)." -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:512 msgid "Periodically optimize tables" msgstr "Optimizer les tables régulièrement" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:512 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "Optimize régulièrement certaines tables de base de données très utilisées comme cache, locks, session, ou workerqueue." -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:514 msgid "Discover followers/followings from contacts" msgstr "Découvrir la liste de contacts des contacts" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:514 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "Si activé, ce serveur collecte la liste d'abonnés et d'abonnements des contacts suivants." -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:515 msgid "None - deactivated" msgstr "Aucun - désactivé" -#: src/Module/Admin/Site.php:518 +#: src/Module/Admin/Site.php:516 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "Contacts locaux : Les contacts des utilisateurs de ce serveur" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:517 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "Interagisseurs : Les contacts des utilisateurs de ce serveur et les contacts qui ont intéragit avec les conversations dont ce serveur a connaissance." -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:519 msgid "Synchronize the contacts with the directory server" msgstr "Synchroniser les contacts avec l'annuaire distant" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:519 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "Active l'ajout de nouveaux contacts depuis l'annuaire distant choisi." -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:521 msgid "Days between requery" msgstr "Nombre de jours entre les requêtes" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:521 msgid "Number of days after which a server is requeried for his contacts." msgstr "Nombre de jours avant qu'une requête de contacts soient envoyée à nouveau à un serveur." -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:522 msgid "Discover contacts from other servers" msgstr "Découvrir des contacts des autres serveurs" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:522 msgid "" "Periodically query other servers for contacts. The system queries Friendica," " Mastodon and Hubzilla servers." msgstr "Récupère périodiquement la liste des contacts connus par les serveurs distants. Concerne les serveurs Friendica, Mastodon et Hubzilla seulement." -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:523 msgid "Search the local directory" msgstr "Chercher dans le répertoire local" -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:523 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "Cherche dans le répertoire local au lieu du répertoire local. Quand une recherche locale est effectuée, la même recherche est effectuée dans le répertoire global en tâche de fond. Cela améliore les résultats de la recherche si elle est réitérée." -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:525 msgid "Publish server information" msgstr "Publier les informations du serveur" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:525 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -5924,50 +5929,50 @@ msgid "" " href=\"http://the-federation.info/\">the-federation.info for details." msgstr "Active la publication de données générales sur ce serveur et son utilisation. Contient entre autres le nom et la version du serveur, le nombre d'utilisateurs avec un profil public, le nombre de publications et la liste des connecteurs activés. Voir the-federation.info pour les détails." -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:527 msgid "Check upstream version" msgstr "Mises à jour" -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:527 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "Permet de vérifier la présence de nouvelles versions de Friendica sur github. Si une nouvelle version est disponible, vous recevrez une notification dans l'interface d'administration." -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:528 msgid "Suppress Tags" msgstr "Masquer les tags" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:528 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "Ne pas afficher la liste des hashtags à la fin d’un message." -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:529 msgid "Clean database" msgstr "Nettoyer la base de données" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:529 msgid "" "Remove old remote items, orphaned database records and old content from some" " other helper tables." msgstr "Supprime les conversations distantes anciennes, les enregistrements orphelins et le contenu obsolète de certaines tables de débogage." -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:530 msgid "Lifespan of remote items" msgstr "Durée de vie des conversations distantes" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:530 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "Si le nettoyage de la base de donnée est actif, cette valeur représente le délai en jours après lequel les conversations distantes sont supprimées. Les conversations démarrées par un utilisateur local, étoilées ou archivées sont toujours conservées. 0 pour désactiver." -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:531 msgid "Lifespan of unclaimed items" msgstr "Durée de vie des conversations relayées" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:531 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -5975,144 +5980,144 @@ msgid "" "items if set to 0." msgstr "Si le nettoyage de la base de donnée est actif, cette valeur représente le délai en jours après lequel les conversations relayées qui n'ont pas reçu d'interactions locales sont supprimées. La valeur par défaut est 90 jours. 0 pour aligner cette valeur sur la durée de vie des conversations distantes." -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:532 msgid "Lifespan of raw conversation data" msgstr "Durée de vie des méta-données de conversation" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:532 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "Cette valeur représente le délai en jours après lequel les méta-données de conversations sont supprimées. Ces méta-données sont utilisées par les protocoles ActivityPub et OStatus, et pour le débogage. Il est prudent de conserver ces meta-données pendant au moins 14 jours. La valeur par défaut est 90 jours." -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:533 msgid "Maximum numbers of comments per post" msgstr "Nombre maximum de commentaires par publication" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:533 msgid "How much comments should be shown for each post? Default value is 100." msgstr "Combien de commentaires doivent être affichés pour chaque publication? Valeur par défaut: 100." -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:534 msgid "Maximum numbers of comments per post on the display page" msgstr "Nombre maximum de commentaires par conversation dans leur page dédié (/display)" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:534 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "Valeur par défaut : 1 000." -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:535 msgid "Temp path" msgstr "Chemin des fichiers temporaires" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:535 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "Si vous n'avez pas la possibilité d'avoir accès au répertoire temp, entrez un autre répertoire ici." -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:536 msgid "Only search in tags" msgstr "Rechercher seulement dans les étiquettes" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:536 msgid "On large systems the text search can slow down the system extremely." msgstr "La recherche textuelle peut ralentir considérablement les systèmes de grande taille." -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:537 msgid "Generate counts per contact group when calculating network count" msgstr "Générer des comptes par groupe de contacts lors du calcul du nombre de réseaux." -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:537 msgid "" "On systems with users that heavily use contact groups the query can be very " "expensive." msgstr "Sur les systèmes avec des utilisateurs utilisant extensivement les groupes de contacts, cette requête peut être très coûteuse." -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:539 msgid "Maximum number of parallel workers" msgstr "Nombre maximum de processus simultanés" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:539 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great." " Default value is %d." msgstr "Sur un hébergement partagé, mettez %d. Sur des serveurs plus puissants, %d est optimal. La valeur par défaut est %d." -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:540 msgid "Enable fastlane" msgstr "Activer la file prioritaire" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:540 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes" " with higher priority are blocked by processes of lower priority." msgstr "La file prioritaire est un ouvrier additionel démarré quand des tâches de fondde grande importance sont bloquées par des tâches de moindre importance dans la file d'attente." -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:542 msgid "Direct relay transfer" msgstr "Relai direct" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:542 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "Soumet les conversations publiques aux serveurs distants sans passer par le serveur relai." -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "Relay scope" msgstr "Filtre du relai" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "\"Tous\" signifie que toutes les conversations publiques en provenance du relai sont acceptées. \"Tags\" signifie que seules les conversations comportant les tags suivants sont acceptées." -#: src/Module/Admin/Site.php:545 src/Module/Contact/Profile.php:273 +#: src/Module/Admin/Site.php:543 src/Module/Contact/Profile.php:273 #: src/Module/Settings/TwoFactor/Index.php:126 msgid "Disabled" msgstr "Désactivé" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "all" msgstr "Tous" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:543 msgid "tags" msgstr "Tags" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:544 msgid "Server tags" msgstr "Tags de filtre du relai" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:544 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "Liste séparée par des virgules de tags exclusivement autorisés en provenance des relais." -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:545 msgid "Deny Server tags" msgstr "Tags refusés" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:545 msgid "Comma separated list of tags that are rejected." msgstr "Liste séparée par des virgules de tags refusés en provenance des relais." -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:546 msgid "Allow user tags" msgstr "Inclure les tags des utilisateurs" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:546 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "ajoute les tags des recherches enregistrées des utilisateurs aux tags exclusivement autorisés en provenance des relais." -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:549 msgid "Start Relocation" msgstr "Démarrer le déménagement" @@ -6614,12 +6619,12 @@ msgstr "Message personnel" msgid "Deny" msgstr "Refuser" -#: src/Module/Api/ApiResponse.php:272 +#: src/Module/Api/ApiResponse.php:279 #, php-format msgid "API endpoint %s %s is not implemented" msgstr "La méthode d'API %s %s n'est pas implémentée" -#: src/Module/Api/ApiResponse.php:273 +#: src/Module/Api/ApiResponse.php:280 msgid "" "The API endpoint is currently not implemented but might be in the future." msgstr "Cette méthode d'API n'est pas encore implémentée." @@ -6787,7 +6792,7 @@ msgstr[0] "La limite du nombre de publications de %d publication a été atteint msgstr[1] "La limite du nombre de publications de %d publications a été atteinte. La publication a été refusée." msgstr[2] "La limite du nombre de publications de %d publication a été atteinte. La publication a été refusée." -#: src/Module/BaseProfile.php:51 src/Module/Contact.php:460 +#: src/Module/BaseProfile.php:51 src/Module/Contact.php:463 msgid "Profile Details" msgstr "Détails du profil" @@ -6862,110 +6867,110 @@ msgstr[0] "%d contact mis à jour." msgstr[1] "%d contacts mis à jour." msgstr[2] "%d contacts mis à jour." -#: src/Module/Contact.php:309 +#: src/Module/Contact.php:312 msgid "Show all contacts" msgstr "Montrer tous les contacts" -#: src/Module/Contact.php:317 +#: src/Module/Contact.php:320 msgid "Only show pending contacts" msgstr "Ne montrer que les demandes d'abonnement" -#: src/Module/Contact.php:325 +#: src/Module/Contact.php:328 msgid "Only show blocked contacts" msgstr "Ne montrer que les contacts bloqués" -#: src/Module/Contact.php:330 src/Module/Contact.php:377 +#: src/Module/Contact.php:333 src/Module/Contact.php:380 #: src/Object/Post.php:339 msgid "Ignored" msgstr "Ignorés" -#: src/Module/Contact.php:333 +#: src/Module/Contact.php:336 msgid "Only show ignored contacts" msgstr "Ne montrer que les contacts ignorés" -#: src/Module/Contact.php:338 src/Module/Contact.php:378 +#: src/Module/Contact.php:341 src/Module/Contact.php:381 msgid "Archived" msgstr "Archivés" -#: src/Module/Contact.php:341 +#: src/Module/Contact.php:344 msgid "Only show archived contacts" msgstr "Ne montrer que les contacts archivés" -#: src/Module/Contact.php:346 src/Module/Contact.php:376 +#: src/Module/Contact.php:349 src/Module/Contact.php:379 msgid "Hidden" msgstr "Cachés" -#: src/Module/Contact.php:349 +#: src/Module/Contact.php:352 msgid "Only show hidden contacts" msgstr "Ne montrer que les contacts masqués" -#: src/Module/Contact.php:357 +#: src/Module/Contact.php:360 msgid "Organize your contact groups" msgstr "Organisez vos groupes de contacts" -#: src/Module/Contact.php:389 +#: src/Module/Contact.php:392 msgid "Search your contacts" msgstr "Rechercher dans vos contacts" -#: src/Module/Contact.php:390 src/Module/Search/Index.php:207 +#: src/Module/Contact.php:393 src/Module/Search/Index.php:207 #, php-format msgid "Results for: %s" msgstr "Résultats pour : %s" -#: src/Module/Contact.php:397 +#: src/Module/Contact.php:400 msgid "Update" msgstr "Mises à jour" -#: src/Module/Contact.php:399 src/Module/Contact/Profile.php:349 +#: src/Module/Contact.php:402 src/Module/Contact/Profile.php:349 #: src/Module/Contact/Profile.php:457 msgid "Unignore" msgstr "Ne plus ignorer" -#: src/Module/Contact.php:401 +#: src/Module/Contact.php:404 msgid "Batch Actions" msgstr "Actions multiples" -#: src/Module/Contact.php:436 +#: src/Module/Contact.php:439 msgid "Conversations started by this contact" msgstr "Conversations entamées par ce contact" -#: src/Module/Contact.php:441 +#: src/Module/Contact.php:444 msgid "Posts and Comments" msgstr "Publications et commentaires" -#: src/Module/Contact.php:452 +#: src/Module/Contact.php:455 msgid "Posts containing media objects" msgstr "Publications contenant des objets média" -#: src/Module/Contact.php:467 +#: src/Module/Contact.php:470 msgid "View all known contacts" msgstr "Voir tous les contacts connus" -#: src/Module/Contact.php:477 +#: src/Module/Contact.php:480 msgid "Advanced Contact Settings" msgstr "Réglages avancés du contact" -#: src/Module/Contact.php:511 +#: src/Module/Contact.php:514 msgid "Mutual Friendship" msgstr "Relation réciproque" -#: src/Module/Contact.php:515 +#: src/Module/Contact.php:518 msgid "is a fan of yours" msgstr "Vous suit" -#: src/Module/Contact.php:519 +#: src/Module/Contact.php:522 msgid "you are a fan of" msgstr "Vous le/la suivez" -#: src/Module/Contact.php:537 +#: src/Module/Contact.php:540 msgid "Pending outgoing contact request" msgstr "Demande d'abonnement distant en attente" -#: src/Module/Contact.php:539 +#: src/Module/Contact.php:542 msgid "Pending incoming contact request" msgstr "Demande d'abonnement à votre compte en attente" -#: src/Module/Contact.php:552 src/Module/Contact/Profile.php:334 +#: src/Module/Contact.php:555 src/Module/Contact/Profile.php:334 #, php-format msgid "Visit %s's profile [%s]" msgstr "Visiter le profil de %s [%s]" @@ -7316,50 +7321,50 @@ msgstr "Voulez-vous vraiment révoquer l'abonnement de ce contact ? Cela ne peu msgid "Yes" msgstr "Oui" -#: src/Module/Conversation/Community.php:68 -msgid "Local Community" -msgstr "Communauté locale" - -#: src/Module/Conversation/Community.php:71 -msgid "Posts from local users on this server" -msgstr "Conversations publiques démarrées par des utilisateurs locaux" - -#: src/Module/Conversation/Community.php:79 -msgid "Global Community" -msgstr "Communauté globale" - -#: src/Module/Conversation/Community.php:82 -msgid "Posts from users of the whole federated network" -msgstr "Conversations publiques provenant du réseau fédéré global" - -#: src/Module/Conversation/Community.php:115 -msgid "Own Contacts" -msgstr "Publications de vos propres contacts" - -#: src/Module/Conversation/Community.php:119 -msgid "Include" -msgstr "Inclure" - -#: src/Module/Conversation/Community.php:120 -msgid "Hide" -msgstr "Masquer" - -#: src/Module/Conversation/Community.php:137 src/Module/Search/Index.php:152 -#: src/Module/Search/Index.php:194 -msgid "No results." -msgstr "Aucun résultat." - -#: src/Module/Conversation/Community.php:162 +#: src/Module/Conversation/Community.php:76 msgid "" "This community stream shows all public posts received by this node. They may" " not reflect the opinions of this node’s users." msgstr "Ce fil communautaire liste toutes les conversations publiques reçues par ce serveur. Elles ne reflètent pas nécessairement les opinions personelles des utilisateurs locaux." -#: src/Module/Conversation/Community.php:199 +#: src/Module/Conversation/Community.php:89 +msgid "Local Community" +msgstr "Communauté locale" + +#: src/Module/Conversation/Community.php:92 +msgid "Posts from local users on this server" +msgstr "Conversations publiques démarrées par des utilisateurs locaux" + +#: src/Module/Conversation/Community.php:100 +msgid "Global Community" +msgstr "Communauté globale" + +#: src/Module/Conversation/Community.php:103 +msgid "Posts from users of the whole federated network" +msgstr "Conversations publiques provenant du réseau fédéré global" + +#: src/Module/Conversation/Community.php:136 +msgid "Own Contacts" +msgstr "Publications de vos propres contacts" + +#: src/Module/Conversation/Community.php:140 +msgid "Include" +msgstr "Inclure" + +#: src/Module/Conversation/Community.php:141 +msgid "Hide" +msgstr "Masquer" + +#: src/Module/Conversation/Community.php:158 src/Module/Search/Index.php:152 +#: src/Module/Search/Index.php:194 +msgid "No results." +msgstr "Aucun résultat." + +#: src/Module/Conversation/Community.php:214 msgid "Community option not available." msgstr "L'option communauté n'est pas disponible" -#: src/Module/Conversation/Community.php:215 +#: src/Module/Conversation/Community.php:230 msgid "Not available." msgstr "Indisponible." @@ -7721,14 +7726,14 @@ msgstr "Résultats pour :" msgid "Site Directory" msgstr "Annuaire local" -#: src/Module/Filer/RemoveTag.php:68 -msgid "Item was not removed" -msgstr "L'élément n'a pas été retiré" - -#: src/Module/Filer/RemoveTag.php:71 +#: src/Module/Filer/RemoveTag.php:101 msgid "Item was not deleted" msgstr "L'élément n'a pas été supprimé" +#: src/Module/Filer/RemoveTag.php:111 +msgid "Item was not removed" +msgstr "L'élément n'a pas été retiré" + #: src/Module/Filer/SaveTag.php:72 msgid "- select -" msgstr "- choisir -" @@ -8155,40 +8160,46 @@ msgid "" "important, please visit http://friendi.ca" msgstr "Pour plus d'information sur Friendica et les valeurs que nous défendons, veuillez consulter http://friendi.ca" -#: src/Module/Item/Compose.php:50 +#: src/Module/Item/Compose.php:85 msgid "Please enter a post body." msgstr "Veuillez saisir un corps de texte." -#: src/Module/Item/Compose.php:63 +#: src/Module/Item/Compose.php:98 msgid "This feature is only available with the frio theme." msgstr "Cette page ne fonctionne qu'avec le thème \"frio\" activé." -#: src/Module/Item/Compose.php:90 +#: src/Module/Item/Compose.php:122 msgid "Compose new personal note" msgstr "Composer une nouvelle note personnelle" -#: src/Module/Item/Compose.php:99 +#: src/Module/Item/Compose.php:131 msgid "Compose new post" msgstr "Composer une nouvelle publication" -#: src/Module/Item/Compose.php:153 +#: src/Module/Item/Compose.php:187 msgid "Visibility" msgstr "Visibilité" -#: src/Module/Item/Compose.php:174 +#: src/Module/Item/Compose.php:201 msgid "Clear the location" msgstr "Effacer la localisation" -#: src/Module/Item/Compose.php:175 +#: src/Module/Item/Compose.php:202 msgid "Location services are unavailable on your device" msgstr "Les services de localisation ne sont pas disponibles sur votre appareil" -#: src/Module/Item/Compose.php:176 +#: src/Module/Item/Compose.php:203 msgid "" "Location services are disabled. Please check the website's permissions on " "your device" msgstr "Les services de localisation sont désactivés pour ce site. Veuillez vérifier les permissions de ce site sur votre appareil/navigateur." +#: src/Module/Item/Compose.php:209 +msgid "" +"You can make this page always open when you use the New Post button in the " +"Theme Customization settings." +msgstr "Vous pouvez faire en sorte que cette page s'ouvre systématiquement quand vous utilisez le bouton \"Nouvelle publication\" dans les paramètres de personnalisation des thèmes." + #: src/Module/Item/Follow.php:52 msgid "Unable to follow this item." msgstr "Erreur lors de l'abonnement à la conversation." @@ -8418,7 +8429,7 @@ msgid "" "class=\"btn btn-sm pull-right\">Cancel" msgstr "Vous êtes en train de consulter votre profil en tant que %s Annuler" -#: src/Module/Profile/Profile.php:144 src/Module/Settings/Account.php:578 +#: src/Module/Profile/Profile.php:144 src/Module/Settings/Account.php:579 msgid "Full Name:" msgstr "Nom complet :" @@ -8434,17 +8445,17 @@ msgstr "j F, Y" msgid "j F" msgstr "j F" -#: src/Module/Profile/Profile.php:164 src/Util/Temporal.php:163 +#: src/Module/Profile/Profile.php:164 src/Util/Temporal.php:166 msgid "Birthday:" msgstr "Anniversaire :" #: src/Module/Profile/Profile.php:167 -#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:165 +#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:168 msgid "Age: " msgstr "Age : " #: src/Module/Profile/Profile.php:167 -#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:165 +#: src/Module/Settings/Profile/Index.php:245 src/Util/Temporal.php:168 #, php-format msgid "%d year old" msgid_plural "%d years old" @@ -8466,19 +8477,19 @@ msgstr "Voir en tant que" #: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329 #: src/Module/Profile/Status.php:66 src/Module/Profile/Status.php:69 -#: src/Protocol/Feed.php:1025 src/Protocol/OStatus.php:1046 +#: src/Protocol/Feed.php:1026 src/Protocol/OStatus.php:1046 #, php-format msgid "%s's timeline" msgstr "Le flux de %s" #: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:67 -#: src/Protocol/Feed.php:1029 src/Protocol/OStatus.php:1051 +#: src/Protocol/Feed.php:1030 src/Protocol/OStatus.php:1051 #, php-format msgid "%s's posts" msgstr "Les publications originales de %s" #: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:68 -#: src/Protocol/Feed.php:1032 src/Protocol/OStatus.php:1055 +#: src/Protocol/Feed.php:1033 src/Protocol/OStatus.php:1055 #, php-format msgid "%s's comments" msgstr "Les commentaires de %s" @@ -8550,7 +8561,7 @@ msgid "Please repeat your e-mail address:" msgstr "Veuillez répéter votre adresse e-mail :" #: src/Module/Register.php:162 src/Module/Security/PasswordTooLong.php:97 -#: src/Module/Settings/Account.php:569 +#: src/Module/Settings/Account.php:570 msgid "New Password:" msgstr "Nouveau mot de passe :" @@ -8559,7 +8570,7 @@ msgid "Leave empty for an auto generated password." msgstr "Laisser ce champ libre pour obtenir un mot de passe généré automatiquement." #: src/Module/Register.php:163 src/Module/Security/PasswordTooLong.php:98 -#: src/Module/Settings/Account.php:570 +#: src/Module/Settings/Account.php:571 msgid "Confirm:" msgstr "Confirmer :" @@ -8780,7 +8791,7 @@ msgid "" msgstr "Compte non trouvé. Veuillez créer un nouveau compte ou vous connecter à votre compte existant pour y ajouter l'OpenID." #: src/Module/Security/PasswordTooLong.php:53 -#: src/Module/Settings/Account.php:66 +#: src/Module/Settings/Account.php:67 msgid "Passwords do not match." msgstr "Les mots de passe ne correspondent pas." @@ -8789,7 +8800,7 @@ msgid "Password does not need changing." msgstr "Le mot de passe n'a pas besoin d'être changé." #: src/Module/Security/PasswordTooLong.php:73 -#: src/Module/Settings/Account.php:80 +#: src/Module/Settings/Account.php:81 msgid "Password unchanged." msgstr "Mot de passe non changé." @@ -8809,24 +8820,24 @@ msgid "Update Password" msgstr "Mettre à jour le mot de passe" #: src/Module/Security/PasswordTooLong.php:96 -#: src/Module/Settings/Account.php:571 +#: src/Module/Settings/Account.php:572 msgid "Current Password:" msgstr "Mot de passe actuel :" #: src/Module/Security/PasswordTooLong.php:96 -#: src/Module/Settings/Account.php:571 +#: src/Module/Settings/Account.php:572 msgid "Your current password to confirm the changes" msgstr "Votre mot de passe actuel pour confirmer les modifications" #: src/Module/Security/PasswordTooLong.php:97 -#: src/Module/Settings/Account.php:554 +#: src/Module/Settings/Account.php:555 msgid "" "Allowed characters are a-z, A-Z, 0-9 and special characters except white " "spaces, accentuated letters and colon (:)." msgstr "Les caractères permis sont a-z, A-Z, 0-9 et les caractères de ponctuation sauf les espaces et les deux-points (:)." #: src/Module/Security/PasswordTooLong.php:97 -#: src/Module/Settings/Account.php:555 +#: src/Module/Settings/Account.php:556 msgid "Password length is limited to 72 characters." msgstr "La taille du mot de passe est limitée à 72 caractères." @@ -8930,119 +8941,119 @@ msgstr "Veuillez saisir le code fourni par votre application mobile d'authentifi msgid "Verify code and complete login" msgstr "Vérifier le code de récupération et compléter l'identification" -#: src/Module/Settings/Account.php:95 +#: src/Module/Settings/Account.php:96 msgid "Please use a shorter name." msgstr "Veuillez saisir un nom plus court." -#: src/Module/Settings/Account.php:98 +#: src/Module/Settings/Account.php:99 msgid "Name too short." msgstr "Le nom est trop court." -#: src/Module/Settings/Account.php:107 +#: src/Module/Settings/Account.php:108 msgid "Wrong Password." msgstr "Mot de passe erroné." -#: src/Module/Settings/Account.php:112 +#: src/Module/Settings/Account.php:113 msgid "Invalid email." msgstr "Courriel invalide." -#: src/Module/Settings/Account.php:118 +#: src/Module/Settings/Account.php:119 msgid "Cannot change to that email." msgstr "Ne peut pas changer vers ce courriel." -#: src/Module/Settings/Account.php:148 src/Module/Settings/Account.php:200 -#: src/Module/Settings/Account.php:220 src/Module/Settings/Account.php:304 -#: src/Module/Settings/Account.php:353 +#: src/Module/Settings/Account.php:149 src/Module/Settings/Account.php:201 +#: src/Module/Settings/Account.php:221 src/Module/Settings/Account.php:305 +#: src/Module/Settings/Account.php:354 msgid "Settings were not updated." msgstr "Les paramètres n'ont pas été mis à jour." -#: src/Module/Settings/Account.php:365 +#: src/Module/Settings/Account.php:366 msgid "Contact CSV file upload error" msgstr "Erreur de téléversement du fichier de contact CSV" -#: src/Module/Settings/Account.php:384 +#: src/Module/Settings/Account.php:385 msgid "Importing Contacts done" msgstr "Import des contacts effectué" -#: src/Module/Settings/Account.php:397 +#: src/Module/Settings/Account.php:398 msgid "Relocate message has been send to your contacts" msgstr "Un message de relocalisation a été envoyé à vos contacts." -#: src/Module/Settings/Account.php:414 +#: src/Module/Settings/Account.php:415 msgid "Unable to find your profile. Please contact your admin." msgstr "Impossible de trouver votre profile. Merci de contacter votre administrateur." -#: src/Module/Settings/Account.php:456 +#: src/Module/Settings/Account.php:457 msgid "Personal Page Subtypes" msgstr "Sous-catégories de page personnelle" -#: src/Module/Settings/Account.php:457 +#: src/Module/Settings/Account.php:458 msgid "Community Forum Subtypes" msgstr "Sous-catégories de forums communautaires" -#: src/Module/Settings/Account.php:467 +#: src/Module/Settings/Account.php:468 msgid "Account for a personal profile." msgstr "Compte pour profil personnel." -#: src/Module/Settings/Account.php:474 +#: src/Module/Settings/Account.php:475 msgid "" "Account for an organisation that automatically approves contact requests as " "\"Followers\"." msgstr "Compte pour une organisation qui accepte les demandes comme \"Abonnés\"." -#: src/Module/Settings/Account.php:481 +#: src/Module/Settings/Account.php:482 msgid "" "Account for a news reflector that automatically approves contact requests as" " \"Followers\"." msgstr "Compte pour les miroirs de nouvelles qui accepte automatiquement les de contact comme \"Abonnés\"." -#: src/Module/Settings/Account.php:488 +#: src/Module/Settings/Account.php:489 msgid "Account for community discussions." msgstr "Compte pour des discussions communautaires." -#: src/Module/Settings/Account.php:495 +#: src/Module/Settings/Account.php:496 msgid "" "Account for a regular personal profile that requires manual approval of " "\"Friends\" and \"Followers\"." msgstr "Les demandes d'abonnement doivent être acceptées manuellement." -#: src/Module/Settings/Account.php:502 +#: src/Module/Settings/Account.php:503 msgid "" "Account for a public profile that automatically approves contact requests as" " \"Followers\"." msgstr "Compte pour un profil public qui accepte les demandes de contact comme \"Abonnés\"." -#: src/Module/Settings/Account.php:509 +#: src/Module/Settings/Account.php:510 msgid "Automatically approves all contact requests." msgstr "Les demandes de participation au forum sont automatiquement acceptées." -#: src/Module/Settings/Account.php:516 +#: src/Module/Settings/Account.php:517 msgid "" "Account for a popular profile that automatically approves contact requests " "as \"Friends\"." msgstr "Les demandes d'abonnement sont automatiquement acceptées." -#: src/Module/Settings/Account.php:521 +#: src/Module/Settings/Account.php:522 msgid "Private Forum [Experimental]" msgstr "Forum privé [expérimental]" -#: src/Module/Settings/Account.php:523 +#: src/Module/Settings/Account.php:524 msgid "Requires manual approval of contact requests." msgstr "Les demandes de participation au forum nécessitent une approbation." -#: src/Module/Settings/Account.php:532 +#: src/Module/Settings/Account.php:533 msgid "OpenID:" msgstr "OpenID:" -#: src/Module/Settings/Account.php:532 +#: src/Module/Settings/Account.php:533 msgid "(Optional) Allow this OpenID to login to this account." msgstr "&nbsp;(Facultatif) Autoriser cet OpenID à se connecter à ce compte." -#: src/Module/Settings/Account.php:540 +#: src/Module/Settings/Account.php:541 msgid "Publish your profile in your local site directory?" msgstr "Publier votre profil dans le répertoire local" -#: src/Module/Settings/Account.php:540 +#: src/Module/Settings/Account.php:541 #, php-format msgid "" "Your profile will be published in this node's local " @@ -9050,89 +9061,89 @@ msgid "" " system settings." msgstr "Votre profil sera public sur l'annuaire local de cette instance. Les détails de votre profil pourront être visible publiquement selon les paramètres de votre système." -#: src/Module/Settings/Account.php:546 +#: src/Module/Settings/Account.php:547 #, php-format msgid "" "Your profile will also be published in the global friendica directories " "(e.g. %s)." msgstr "Votre profil sera aussi publié dans le répertoire Friendica global (%s)." -#: src/Module/Settings/Account.php:559 +#: src/Module/Settings/Account.php:560 msgid "Account Settings" msgstr "Compte" -#: src/Module/Settings/Account.php:560 +#: src/Module/Settings/Account.php:561 #, php-format msgid "Your Identity Address is '%s' or '%s'." msgstr "L’adresse de votre profil est '%s' ou '%s'." -#: src/Module/Settings/Account.php:568 +#: src/Module/Settings/Account.php:569 msgid "Password Settings" msgstr "Réglages de mot de passe" -#: src/Module/Settings/Account.php:570 +#: src/Module/Settings/Account.php:571 msgid "Leave password fields blank unless changing" msgstr "Laissez les champs de mot de passe vierges, sauf si vous désirez les changer" -#: src/Module/Settings/Account.php:572 +#: src/Module/Settings/Account.php:573 msgid "Password:" msgstr "Mot de passe :" -#: src/Module/Settings/Account.php:572 +#: src/Module/Settings/Account.php:573 msgid "Your current password to confirm the changes of the email address" msgstr "Votre mot de passe actuel pour confirmer les modifications de votre adresse email." -#: src/Module/Settings/Account.php:575 +#: src/Module/Settings/Account.php:576 msgid "Delete OpenID URL" msgstr "Supprimer l'URL OpenID" -#: src/Module/Settings/Account.php:577 +#: src/Module/Settings/Account.php:578 msgid "Basic Settings" msgstr "Réglages de base" -#: src/Module/Settings/Account.php:579 +#: src/Module/Settings/Account.php:580 msgid "Email Address:" msgstr "Adresse courriel :" -#: src/Module/Settings/Account.php:580 +#: src/Module/Settings/Account.php:581 msgid "Your Timezone:" msgstr "Votre fuseau horaire :" -#: src/Module/Settings/Account.php:581 +#: src/Module/Settings/Account.php:582 msgid "Your Language:" msgstr "Votre langue :" -#: src/Module/Settings/Account.php:581 +#: src/Module/Settings/Account.php:582 msgid "" "Set the language we use to show you friendica interface and to send you " "emails" msgstr "Détermine la langue que nous utilisons pour afficher votre interface Friendica et pour vous envoyer des courriels" -#: src/Module/Settings/Account.php:582 +#: src/Module/Settings/Account.php:583 msgid "Default Post Location:" msgstr "Emplacement de publication par défaut:" -#: src/Module/Settings/Account.php:583 +#: src/Module/Settings/Account.php:584 msgid "Use Browser Location:" msgstr "Utiliser la localisation géographique du navigateur:" -#: src/Module/Settings/Account.php:585 +#: src/Module/Settings/Account.php:586 msgid "Security and Privacy Settings" msgstr "Réglages de sécurité et vie privée" -#: src/Module/Settings/Account.php:587 +#: src/Module/Settings/Account.php:588 msgid "Maximum Friend Requests/Day:" msgstr "Nombre maximal de demandes d'abonnement par jour :" -#: src/Module/Settings/Account.php:587 src/Module/Settings/Account.php:597 +#: src/Module/Settings/Account.php:588 src/Module/Settings/Account.php:598 msgid "(to prevent spam abuse)" msgstr "(pour limiter l'impact du spam)" -#: src/Module/Settings/Account.php:589 +#: src/Module/Settings/Account.php:590 msgid "Allow your profile to be searchable globally?" msgstr "Publier votre profil publiquement" -#: src/Module/Settings/Account.php:589 +#: src/Module/Settings/Account.php:590 msgid "" "Activate this setting if you want others to easily find and follow you. Your" " profile will be searchable on remote systems. This setting also determines " @@ -9140,43 +9151,43 @@ msgid "" "indexed or not." msgstr "Permet à quiconque de trouver votre profil via une recherche sur n'importe quel site compatible ou un moteur de recherche." -#: src/Module/Settings/Account.php:590 +#: src/Module/Settings/Account.php:591 msgid "Hide your contact/friend list from viewers of your profile?" msgstr "Cacher votre liste de contacts/amis des visiteurs de votre profil?" -#: src/Module/Settings/Account.php:590 +#: src/Module/Settings/Account.php:591 msgid "" "A list of your contacts is displayed on your profile page. Activate this " "option to disable the display of your contact list." msgstr "La liste de vos contacts est affichée sur votre profil. Activer cette option pour désactiver son affichage." -#: src/Module/Settings/Account.php:591 +#: src/Module/Settings/Account.php:592 msgid "Hide your profile details from anonymous viewers?" msgstr "Cacher les détails de votre profil pour les lecteurs anonymes." -#: src/Module/Settings/Account.php:591 +#: src/Module/Settings/Account.php:592 msgid "" "Anonymous visitors will only see your profile picture, your display name and" " the nickname you are using on your profile page. Your public posts and " "replies will still be accessible by other means." msgstr "Les visiteurs anonymes ne verront que votre image de profil, votre nom affiché, et le surnom que vous utilisez sur votre page de profil. Vos publications publics et réponses seront toujours accessibles par d'autres moyens." -#: src/Module/Settings/Account.php:592 +#: src/Module/Settings/Account.php:593 msgid "Make public posts unlisted" msgstr "Délister vos publications publiques" -#: src/Module/Settings/Account.php:592 +#: src/Module/Settings/Account.php:593 msgid "" "Your public posts will not appear on the community pages or in search " "results, nor be sent to relay servers. However they can still appear on " "public feeds on remote servers." msgstr "Vos publications publiques n'apparaîtront pas dans les pages communautaires ni les résultats de recherche de ce site et ne seront pas diffusées via les serveurs de relai. Cependant, elles pourront quand même apparaître dans les fils publics de sites distants." -#: src/Module/Settings/Account.php:593 +#: src/Module/Settings/Account.php:594 msgid "Make all posted pictures accessible" msgstr "Rendre toutes les images envoyées accessibles." -#: src/Module/Settings/Account.php:593 +#: src/Module/Settings/Account.php:594 msgid "" "This option makes every posted picture accessible via the direct link. This " "is a workaround for the problem that most other networks can't handle " @@ -9184,233 +9195,233 @@ msgid "" "public on your photo albums though." msgstr "Cette option rend chaque image envoyée accessible par un lien direct. C'est un contournement pour prendre en compte que la pluplart des autres réseaux ne gèrent pas les droits sur les images. Cependant les images non publiques ne seront pas visibles sur votre album photo." -#: src/Module/Settings/Account.php:594 +#: src/Module/Settings/Account.php:595 msgid "Allow friends to post to your profile page?" msgstr "Autoriser vos contacts à publier sur votre profil ?" -#: src/Module/Settings/Account.php:594 +#: src/Module/Settings/Account.php:595 msgid "" "Your contacts may write posts on your profile wall. These posts will be " "distributed to your contacts" msgstr "Vos contacts peuvent partager des publications sur votre mur. Ces publication seront visibles par vos abonnés." -#: src/Module/Settings/Account.php:595 +#: src/Module/Settings/Account.php:596 msgid "Allow friends to tag your posts?" msgstr "Autoriser vos contacts à ajouter des tags à vos publications?" -#: src/Module/Settings/Account.php:595 +#: src/Module/Settings/Account.php:596 msgid "Your contacts can add additional tags to your posts." msgstr "Vos contacts peuvent ajouter des tag à vos publications." -#: src/Module/Settings/Account.php:596 +#: src/Module/Settings/Account.php:597 msgid "Permit unknown people to send you private mail?" msgstr "Autoriser les messages privés d'inconnus?" -#: src/Module/Settings/Account.php:596 +#: src/Module/Settings/Account.php:597 msgid "" "Friendica network users may send you private messages even if they are not " "in your contact list." msgstr "Les utilisateurs de Friendica peuvent vous envoyer des messages privés même s'ils ne sont pas dans vos contacts." -#: src/Module/Settings/Account.php:597 +#: src/Module/Settings/Account.php:598 msgid "Maximum private messages per day from unknown people:" msgstr "Maximum de messages privés d'inconnus par jour :" -#: src/Module/Settings/Account.php:599 +#: src/Module/Settings/Account.php:600 msgid "Default Post Permissions" msgstr "Permissions de publication par défaut" -#: src/Module/Settings/Account.php:603 +#: src/Module/Settings/Account.php:604 msgid "Expiration settings" msgstr "Réglages d'expiration" -#: src/Module/Settings/Account.php:604 +#: src/Module/Settings/Account.php:605 msgid "Automatically expire posts after this many days:" msgstr "Les publications expirent automatiquement après (en jours) :" -#: src/Module/Settings/Account.php:604 +#: src/Module/Settings/Account.php:605 msgid "If empty, posts will not expire. Expired posts will be deleted" msgstr "Si ce champ est vide, les publications n'expireront pas. Les publications expirées seront supprimées" -#: src/Module/Settings/Account.php:605 +#: src/Module/Settings/Account.php:606 msgid "Expire posts" msgstr "Faire expirer les publications" -#: src/Module/Settings/Account.php:605 +#: src/Module/Settings/Account.php:606 msgid "When activated, posts and comments will be expired." msgstr "Les publications originales et commentaires expireront." -#: src/Module/Settings/Account.php:606 +#: src/Module/Settings/Account.php:607 msgid "Expire personal notes" msgstr "Faire expirer les notes personnelles" -#: src/Module/Settings/Account.php:606 +#: src/Module/Settings/Account.php:607 msgid "" "When activated, the personal notes on your profile page will be expired." msgstr " " -#: src/Module/Settings/Account.php:607 +#: src/Module/Settings/Account.php:608 msgid "Expire starred posts" msgstr "Faire expirer les publications marquées" -#: src/Module/Settings/Account.php:607 +#: src/Module/Settings/Account.php:608 msgid "" "Starring posts keeps them from being expired. That behaviour is overwritten " "by this setting." msgstr "Par défaut, marquer une publication empêche leur expiration." -#: src/Module/Settings/Account.php:608 +#: src/Module/Settings/Account.php:609 msgid "Only expire posts by others" msgstr "Faire expirer uniquement les contenu reçus" -#: src/Module/Settings/Account.php:608 +#: src/Module/Settings/Account.php:609 msgid "" "When activated, your own posts never expire. Then the settings above are " "only valid for posts you received." msgstr "Empêche vos propres publications d'expirer. S'applique à tous les choix précédents." -#: src/Module/Settings/Account.php:611 +#: src/Module/Settings/Account.php:612 msgid "Notification Settings" msgstr "Réglages de notification" -#: src/Module/Settings/Account.php:612 +#: src/Module/Settings/Account.php:613 msgid "Send a notification email when:" msgstr "Envoyer un courriel de notification quand:" -#: src/Module/Settings/Account.php:613 +#: src/Module/Settings/Account.php:614 msgid "You receive an introduction" msgstr "Vous recevez une introduction" -#: src/Module/Settings/Account.php:614 +#: src/Module/Settings/Account.php:615 msgid "Your introductions are confirmed" msgstr "Vos introductions sont confirmées" -#: src/Module/Settings/Account.php:615 +#: src/Module/Settings/Account.php:616 msgid "Someone writes on your profile wall" msgstr "Quelqu'un écrit sur votre mur" -#: src/Module/Settings/Account.php:616 +#: src/Module/Settings/Account.php:617 msgid "Someone writes a followup comment" msgstr "Quelqu'un vous commente" -#: src/Module/Settings/Account.php:617 +#: src/Module/Settings/Account.php:618 msgid "You receive a private message" msgstr "Vous recevez un message privé" -#: src/Module/Settings/Account.php:618 +#: src/Module/Settings/Account.php:619 msgid "You receive a friend suggestion" msgstr "Vous avez reçu une suggestion d'abonnement" -#: src/Module/Settings/Account.php:619 +#: src/Module/Settings/Account.php:620 msgid "You are tagged in a post" msgstr "Vous avez été mentionné•e dans une publication" -#: src/Module/Settings/Account.php:621 +#: src/Module/Settings/Account.php:622 msgid "Create a desktop notification when:" msgstr "Créer une notification de bureau quand :" -#: src/Module/Settings/Account.php:622 +#: src/Module/Settings/Account.php:623 msgid "Someone tagged you" msgstr "Quelqu'un vous a mentionné" -#: src/Module/Settings/Account.php:623 +#: src/Module/Settings/Account.php:624 msgid "Someone directly commented on your post" msgstr "Quelqu'un a commenté directement sur votre publication" -#: src/Module/Settings/Account.php:624 +#: src/Module/Settings/Account.php:625 msgid "Someone liked your content" msgstr "Quelqu'un a aimé votre contenu" -#: src/Module/Settings/Account.php:624 src/Module/Settings/Account.php:625 +#: src/Module/Settings/Account.php:625 src/Module/Settings/Account.php:626 msgid "Can only be enabled, when the direct comment notification is enabled." msgstr "Peut uniquement être activé quand la notification des commentaires directs est activée." -#: src/Module/Settings/Account.php:625 +#: src/Module/Settings/Account.php:626 msgid "Someone shared your content" msgstr "Quelqu'un a partagé votre contenu" -#: src/Module/Settings/Account.php:626 +#: src/Module/Settings/Account.php:627 msgid "Someone commented in your thread" msgstr "Quelqu'un a commenté dans votre conversation" -#: src/Module/Settings/Account.php:627 +#: src/Module/Settings/Account.php:628 msgid "Someone commented in a thread where you commented" msgstr "Quelqu'un a commenté dans une conversation où vous avez commenté" -#: src/Module/Settings/Account.php:628 +#: src/Module/Settings/Account.php:629 msgid "Someone commented in a thread where you interacted" msgstr "Quelqu'un a commenté dans une conversation avec laquelle vous avez interagi" -#: src/Module/Settings/Account.php:630 +#: src/Module/Settings/Account.php:631 msgid "Activate desktop notifications" msgstr "Activer les notifications de bureau" -#: src/Module/Settings/Account.php:630 +#: src/Module/Settings/Account.php:631 msgid "Show desktop popup on new notifications" msgstr "Afficher dans des pop-ups les nouvelles notifications" -#: src/Module/Settings/Account.php:634 +#: src/Module/Settings/Account.php:635 msgid "Text-only notification emails" msgstr "Courriels de notification en format texte" -#: src/Module/Settings/Account.php:636 +#: src/Module/Settings/Account.php:637 msgid "Send text only notification emails, without the html part" msgstr "Envoyer le texte des courriels de notification, sans la composante html" -#: src/Module/Settings/Account.php:640 +#: src/Module/Settings/Account.php:641 msgid "Show detailled notifications" msgstr "Notifications détaillées" -#: src/Module/Settings/Account.php:642 +#: src/Module/Settings/Account.php:643 msgid "" "Per default, notifications are condensed to a single notification per item. " "When enabled every notification is displayed." msgstr "Par défaut seule la notification la plus récente par conversation est affichée. Ce réglage affiche toutes les notifications." -#: src/Module/Settings/Account.php:646 +#: src/Module/Settings/Account.php:647 msgid "Show notifications of ignored contacts" msgstr "Montrer les notifications des contacts ignorés" -#: src/Module/Settings/Account.php:648 +#: src/Module/Settings/Account.php:649 msgid "" "You don't see posts from ignored contacts. But you still see their comments." " This setting controls if you want to still receive regular notifications " "that are caused by ignored contacts or not." msgstr "Par défaut les notifications de vos contacts ignorés sont également ignorées." -#: src/Module/Settings/Account.php:651 +#: src/Module/Settings/Account.php:652 msgid "Advanced Account/Page Type Settings" msgstr "Paramètres avancés de compte/page" -#: src/Module/Settings/Account.php:652 +#: src/Module/Settings/Account.php:653 msgid "Change the behaviour of this account for special situations" msgstr "Modifier le comportement de ce compte dans certaines situations" -#: src/Module/Settings/Account.php:655 +#: src/Module/Settings/Account.php:656 msgid "Import Contacts" msgstr "Importer des contacts" -#: src/Module/Settings/Account.php:656 +#: src/Module/Settings/Account.php:657 msgid "" "Upload a CSV file that contains the handle of your followed accounts in the " "first column you exported from the old account." msgstr "Téléversez un fichier CSV contenant des identifiants de contacts dans la première colonne." -#: src/Module/Settings/Account.php:657 +#: src/Module/Settings/Account.php:658 msgid "Upload File" msgstr "Téléverser le fichier" -#: src/Module/Settings/Account.php:660 +#: src/Module/Settings/Account.php:661 msgid "Relocate" msgstr "Relocaliser" -#: src/Module/Settings/Account.php:661 +#: src/Module/Settings/Account.php:662 msgid "" "If you have moved this profile from another server, and some of your " "contacts don't receive your updates, try pushing this button." msgstr "Si vous avez migré ce profil depuis un autre serveur et que vos contacts ne reçoivent plus vos mises à jour, essayez ce bouton." -#: src/Module/Settings/Account.php:662 +#: src/Module/Settings/Account.php:663 msgid "Resend relocate message to contacts" msgstr "Renvoyer un message de relocalisation aux contacts." @@ -9501,121 +9512,121 @@ msgstr "Le thème que vous avez choisi n'est pas disponible." msgid "%s - (Unsupported)" msgstr "%s- (non supporté)" -#: src/Module/Settings/Display.php:192 +#: src/Module/Settings/Display.php:200 msgid "Display Settings" msgstr "Affichage" -#: src/Module/Settings/Display.php:194 +#: src/Module/Settings/Display.php:202 msgid "General Theme Settings" msgstr "Paramètres généraux de thème" -#: src/Module/Settings/Display.php:195 +#: src/Module/Settings/Display.php:203 msgid "Custom Theme Settings" msgstr "Paramètres personnalisés de thème" -#: src/Module/Settings/Display.php:196 +#: src/Module/Settings/Display.php:204 msgid "Content Settings" msgstr "Paramètres de contenu" -#: src/Module/Settings/Display.php:197 view/theme/duepuntozero/config.php:70 -#: view/theme/frio/config.php:161 view/theme/quattro/config.php:72 +#: src/Module/Settings/Display.php:205 view/theme/duepuntozero/config.php:70 +#: view/theme/frio/config.php:172 view/theme/quattro/config.php:72 #: view/theme/vier/config.php:120 msgid "Theme settings" msgstr "Réglages du thème graphique" -#: src/Module/Settings/Display.php:198 +#: src/Module/Settings/Display.php:206 msgid "Calendar" msgstr "Calendrier" -#: src/Module/Settings/Display.php:204 +#: src/Module/Settings/Display.php:212 msgid "Display Theme:" msgstr "Thème d'affichage:" -#: src/Module/Settings/Display.php:205 +#: src/Module/Settings/Display.php:213 msgid "Mobile Theme:" msgstr "Thème mobile:" -#: src/Module/Settings/Display.php:208 +#: src/Module/Settings/Display.php:216 msgid "Number of items to display per page:" msgstr "Nombre d’éléments par page :" -#: src/Module/Settings/Display.php:208 src/Module/Settings/Display.php:209 +#: src/Module/Settings/Display.php:216 src/Module/Settings/Display.php:217 msgid "Maximum of 100 items" msgstr "Maximum de 100 éléments" -#: src/Module/Settings/Display.php:209 +#: src/Module/Settings/Display.php:217 msgid "Number of items to display per page when viewed from mobile device:" msgstr "Nombre d'éléments à afficher par page pour un appareil mobile" -#: src/Module/Settings/Display.php:210 +#: src/Module/Settings/Display.php:218 msgid "Update browser every xx seconds" msgstr "Mettre à jour l'affichage toutes les xx secondes" -#: src/Module/Settings/Display.php:210 +#: src/Module/Settings/Display.php:218 msgid "Minimum of 10 seconds. Enter -1 to disable it." msgstr "Minimum de 10 secondes. Saisir -1 pour désactiver." -#: src/Module/Settings/Display.php:211 +#: src/Module/Settings/Display.php:219 msgid "Automatic updates only at the top of the post stream pages" msgstr "Rafraîchir le flux uniquement en haut de la page" -#: src/Module/Settings/Display.php:211 +#: src/Module/Settings/Display.php:219 msgid "" "Auto update may add new posts at the top of the post stream pages, which can" " affect the scroll position and perturb normal reading if it happens " "anywhere else the top of the page." msgstr "Le rafraîchissement automatique du flux peut ajouter de nouveaux contenus en haut de la liste, ce qui peut affecter le défilement de la page et gêner la lecture s'il s'effectue ailleurs qu'en haut de la page." -#: src/Module/Settings/Display.php:212 +#: src/Module/Settings/Display.php:220 msgid "Display emoticons" msgstr "Afficher les émoticônes" -#: src/Module/Settings/Display.php:212 +#: src/Module/Settings/Display.php:220 msgid "When enabled, emoticons are replaced with matching symbols." msgstr "Quand activé, les émoticônes sont remplacées par les symboles correspondants." -#: src/Module/Settings/Display.php:213 +#: src/Module/Settings/Display.php:221 msgid "Infinite scroll" msgstr "Défilement infini" -#: src/Module/Settings/Display.php:213 +#: src/Module/Settings/Display.php:221 msgid "Automatic fetch new items when reaching the page end." msgstr "Charge automatiquement de nouveaux contenus en bas de la page." -#: src/Module/Settings/Display.php:214 +#: src/Module/Settings/Display.php:222 msgid "Enable Smart Threading" msgstr "Activer le fil de discussion intelligent" -#: src/Module/Settings/Display.php:214 +#: src/Module/Settings/Display.php:222 msgid "Enable the automatic suppression of extraneous thread indentation." msgstr "Activer la suppression automatique de l'indentation excédentaire des fils de discussion." -#: src/Module/Settings/Display.php:215 +#: src/Module/Settings/Display.php:223 msgid "Display the Dislike feature" msgstr "Afficher la fonctionnalité \"Je n'aime pas\"" -#: src/Module/Settings/Display.php:215 +#: src/Module/Settings/Display.php:223 msgid "" "Display the Dislike button and dislike reactions on posts and comments." msgstr "Afficher le bouton \"Je n'aime pas\" et les réactions \"Je n'aime pas\" sur les publications et les commentaires." -#: src/Module/Settings/Display.php:216 +#: src/Module/Settings/Display.php:224 msgid "Display the resharer" msgstr "Afficher le repartageur" -#: src/Module/Settings/Display.php:216 +#: src/Module/Settings/Display.php:224 msgid "Display the first resharer as icon and text on a reshared item." msgstr "Afficher le premier repartageur en tant qu'icône et texte sur un élément repartagé." -#: src/Module/Settings/Display.php:217 +#: src/Module/Settings/Display.php:225 msgid "Stay local" msgstr "Rester local" -#: src/Module/Settings/Display.php:217 +#: src/Module/Settings/Display.php:225 msgid "Don't go to a remote system when following a contact link." msgstr "Ne pas aller sur un système distant lors du suivi du lien d'un contact." -#: src/Module/Settings/Display.php:219 +#: src/Module/Settings/Display.php:227 msgid "Beginning of week:" msgstr "Début de la semaine :" @@ -9671,8 +9682,8 @@ msgstr "Image de profil" msgid "Location" msgstr "Localisation" -#: src/Module/Settings/Profile/Index.php:230 src/Util/Temporal.php:93 -#: src/Util/Temporal.php:95 +#: src/Module/Settings/Profile/Index.php:230 src/Util/Temporal.php:95 +#: src/Util/Temporal.php:97 msgid "Miscellaneous" msgstr "Divers" @@ -10542,190 +10553,190 @@ msgstr "%1$s a commenté dans la conversation de %3$s" msgid "%1$s commented on your thread %2$s" msgstr "%1$s a commenté dans votre conversation %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:222 -#: src/Navigation/Notifications/Repository/Notify.php:717 +#: src/Navigation/Notifications/Repository/Notify.php:225 +#: src/Navigation/Notifications/Repository/Notify.php:721 msgid "[Friendica:Notify]" msgstr "[Friendica:Notification]" -#: src/Navigation/Notifications/Repository/Notify.php:286 +#: src/Navigation/Notifications/Repository/Notify.php:289 #, php-format msgid "%s New mail received at %s" msgstr "%s Nouveau message privé reçu sur %s" -#: src/Navigation/Notifications/Repository/Notify.php:288 +#: src/Navigation/Notifications/Repository/Notify.php:291 #, php-format msgid "%1$s sent you a new private message at %2$s." msgstr "%1$s vous a envoyé un nouveau message privé sur %2$s." -#: src/Navigation/Notifications/Repository/Notify.php:289 +#: src/Navigation/Notifications/Repository/Notify.php:292 msgid "a private message" msgstr "un message privé" -#: src/Navigation/Notifications/Repository/Notify.php:289 +#: src/Navigation/Notifications/Repository/Notify.php:292 #, php-format msgid "%1$s sent you %2$s." msgstr "%1$s vous a envoyé %2$s." -#: src/Navigation/Notifications/Repository/Notify.php:291 +#: src/Navigation/Notifications/Repository/Notify.php:294 #, php-format msgid "Please visit %s to view and/or reply to your private messages." msgstr "Merci de visiter %s pour voir vos messages privés et/ou y répondre." -#: src/Navigation/Notifications/Repository/Notify.php:321 +#: src/Navigation/Notifications/Repository/Notify.php:324 #, php-format msgid "%1$s commented on %2$s's %3$s %4$s" msgstr "%1$s a commenté sur %3$s de %2$s %4$s" -#: src/Navigation/Notifications/Repository/Notify.php:326 +#: src/Navigation/Notifications/Repository/Notify.php:329 #, php-format msgid "%1$s commented on your %2$s %3$s" msgstr "%1$s a commenté sur votre %2$s %3$s" -#: src/Navigation/Notifications/Repository/Notify.php:330 +#: src/Navigation/Notifications/Repository/Notify.php:333 #, php-format msgid "%1$s commented on their %2$s %3$s" msgstr "%1$s a commenté sur son %2$s %3$s" -#: src/Navigation/Notifications/Repository/Notify.php:334 -#: src/Navigation/Notifications/Repository/Notify.php:751 +#: src/Navigation/Notifications/Repository/Notify.php:337 +#: src/Navigation/Notifications/Repository/Notify.php:755 #, php-format msgid "%1$s Comment to conversation #%2$d by %3$s" msgstr "%1$s Nouveau commentaire dans la conversation #%2$d par %3$s" -#: src/Navigation/Notifications/Repository/Notify.php:336 +#: src/Navigation/Notifications/Repository/Notify.php:339 #, php-format msgid "%s commented on an item/conversation you have been following." msgstr "%s a commenté un élément que vous suivez." -#: src/Navigation/Notifications/Repository/Notify.php:340 -#: src/Navigation/Notifications/Repository/Notify.php:355 -#: src/Navigation/Notifications/Repository/Notify.php:766 +#: src/Navigation/Notifications/Repository/Notify.php:343 +#: src/Navigation/Notifications/Repository/Notify.php:358 +#: src/Navigation/Notifications/Repository/Notify.php:770 #, php-format msgid "Please visit %s to view and/or reply to the conversation." msgstr "Merci de visiter %s pour voir la conversation et/ou y répondre." -#: src/Navigation/Notifications/Repository/Notify.php:347 +#: src/Navigation/Notifications/Repository/Notify.php:350 #, php-format msgid "%s %s posted to your profile wall" msgstr "%s %s a posté sur votre mur" -#: src/Navigation/Notifications/Repository/Notify.php:349 +#: src/Navigation/Notifications/Repository/Notify.php:352 #, php-format msgid "%1$s posted to your profile wall at %2$s" msgstr "%1$s a publié sur votre mur à %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:350 +#: src/Navigation/Notifications/Repository/Notify.php:353 #, php-format msgid "%1$s posted to [url=%2$s]your wall[/url]" msgstr "%1$s a posté sur [url=%2$s]votre mur[/url]" -#: src/Navigation/Notifications/Repository/Notify.php:363 +#: src/Navigation/Notifications/Repository/Notify.php:366 #, php-format msgid "%s Introduction received" msgstr "%s Demande de mise en contact reçue" -#: src/Navigation/Notifications/Repository/Notify.php:365 +#: src/Navigation/Notifications/Repository/Notify.php:368 #, php-format msgid "You've received an introduction from '%1$s' at %2$s" msgstr "Vous avez reçu une introduction de '%1$s' sur %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:366 +#: src/Navigation/Notifications/Repository/Notify.php:369 #, php-format msgid "You've received [url=%1$s]an introduction[/url] from %2$s." msgstr "Vous avez reçu [url=%1$s]une introduction[/url] de %2$s." -#: src/Navigation/Notifications/Repository/Notify.php:371 -#: src/Navigation/Notifications/Repository/Notify.php:417 +#: src/Navigation/Notifications/Repository/Notify.php:374 +#: src/Navigation/Notifications/Repository/Notify.php:420 #, php-format msgid "You may visit their profile at %s" msgstr "Vous pouvez visiter son profil sur %s" -#: src/Navigation/Notifications/Repository/Notify.php:373 +#: src/Navigation/Notifications/Repository/Notify.php:376 #, php-format msgid "Please visit %s to approve or reject the introduction." msgstr "Merci de visiter %s pour approuver ou rejeter l'introduction." -#: src/Navigation/Notifications/Repository/Notify.php:380 +#: src/Navigation/Notifications/Repository/Notify.php:383 #, php-format msgid "%s A new person is sharing with you" msgstr "%s Quelqu'un a commencé à partager avec vous" -#: src/Navigation/Notifications/Repository/Notify.php:382 -#: src/Navigation/Notifications/Repository/Notify.php:383 +#: src/Navigation/Notifications/Repository/Notify.php:385 +#: src/Navigation/Notifications/Repository/Notify.php:386 #, php-format msgid "%1$s is sharing with you at %2$s" msgstr "%1$s partage avec vous sur %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:390 +#: src/Navigation/Notifications/Repository/Notify.php:393 #, php-format msgid "%s You have a new follower" msgstr "%s Vous avez un nouvel abonné" -#: src/Navigation/Notifications/Repository/Notify.php:392 -#: src/Navigation/Notifications/Repository/Notify.php:393 +#: src/Navigation/Notifications/Repository/Notify.php:395 +#: src/Navigation/Notifications/Repository/Notify.php:396 #, php-format msgid "You have a new follower at %2$s : %1$s" msgstr "Vous avez un nouvel abonné à %2$s : %1$s" -#: src/Navigation/Notifications/Repository/Notify.php:406 +#: src/Navigation/Notifications/Repository/Notify.php:409 #, php-format msgid "%s Friend suggestion received" msgstr "%s Suggestion de mise en contact reçue" -#: src/Navigation/Notifications/Repository/Notify.php:408 +#: src/Navigation/Notifications/Repository/Notify.php:411 #, php-format msgid "You've received a friend suggestion from '%1$s' at %2$s" msgstr "Vous avez reçu une suggestion de '%1$s' sur %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:409 +#: src/Navigation/Notifications/Repository/Notify.php:412 #, php-format msgid "" "You've received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s." msgstr "Vous avez reçu [url=%1$s]une suggestion[/url] de %3$s pour %2$s." -#: src/Navigation/Notifications/Repository/Notify.php:415 +#: src/Navigation/Notifications/Repository/Notify.php:418 msgid "Name:" msgstr "Nom :" -#: src/Navigation/Notifications/Repository/Notify.php:416 +#: src/Navigation/Notifications/Repository/Notify.php:419 msgid "Photo:" msgstr "Photo :" -#: src/Navigation/Notifications/Repository/Notify.php:419 +#: src/Navigation/Notifications/Repository/Notify.php:422 #, php-format msgid "Please visit %s to approve or reject the suggestion." msgstr "Merci de visiter %s pour approuver ou rejeter la suggestion." -#: src/Navigation/Notifications/Repository/Notify.php:427 -#: src/Navigation/Notifications/Repository/Notify.php:442 +#: src/Navigation/Notifications/Repository/Notify.php:430 +#: src/Navigation/Notifications/Repository/Notify.php:445 #, php-format msgid "%s Connection accepted" msgstr "%s Demande d'abonnement acceptée" -#: src/Navigation/Notifications/Repository/Notify.php:429 -#: src/Navigation/Notifications/Repository/Notify.php:444 +#: src/Navigation/Notifications/Repository/Notify.php:432 +#: src/Navigation/Notifications/Repository/Notify.php:447 #, php-format msgid "'%1$s' has accepted your connection request at %2$s" msgstr "'%1$s' a accepté votre demande de connexion à %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:430 -#: src/Navigation/Notifications/Repository/Notify.php:445 +#: src/Navigation/Notifications/Repository/Notify.php:433 +#: src/Navigation/Notifications/Repository/Notify.php:448 #, php-format msgid "%2$s has accepted your [url=%1$s]connection request[/url]." msgstr "%2$s a accepté votre [url=%1$s]demande de connexion[/url]." -#: src/Navigation/Notifications/Repository/Notify.php:435 +#: src/Navigation/Notifications/Repository/Notify.php:438 msgid "" "You are now mutual friends and may exchange status updates, photos, and " "email without restriction." msgstr "Vous êtes désormais mutuellement amis, et pouvez échanger des mises-à-jour d'état, des photos, et des messages sans restriction." -#: src/Navigation/Notifications/Repository/Notify.php:437 +#: src/Navigation/Notifications/Repository/Notify.php:440 #, php-format msgid "Please visit %s if you wish to make any changes to this relationship." msgstr "Veuillez visiter %s si vous souhaitez modifier cette relation." -#: src/Navigation/Notifications/Repository/Notify.php:450 +#: src/Navigation/Notifications/Repository/Notify.php:453 #, php-format msgid "" "'%1$s' has chosen to accept you a fan, which restricts some forms of " @@ -10734,33 +10745,33 @@ msgid "" "automatically." msgstr "'%1$s' a choisi de vous accepter comme fan ce qui empêche certains canaux de communication tel les messages privés et certaines interactions de profil. Ceci est une page de célébrité ou de communauté, ces paramètres ont été appliqués automatiquement." -#: src/Navigation/Notifications/Repository/Notify.php:452 +#: src/Navigation/Notifications/Repository/Notify.php:455 #, php-format msgid "" "'%1$s' may choose to extend this into a two-way or more permissive " "relationship in the future." msgstr "%1$s peut choisir à l'avenir de rendre cette relation réciproque ou au moins plus permissive." -#: src/Navigation/Notifications/Repository/Notify.php:454 +#: src/Navigation/Notifications/Repository/Notify.php:457 #, php-format msgid "Please visit %s if you wish to make any changes to this relationship." msgstr "Veuillez visiter %s si vous souhaitez modifier cette relation." -#: src/Navigation/Notifications/Repository/Notify.php:464 +#: src/Navigation/Notifications/Repository/Notify.php:467 msgid "registration request" msgstr "demande d'inscription" -#: src/Navigation/Notifications/Repository/Notify.php:466 +#: src/Navigation/Notifications/Repository/Notify.php:469 #, php-format msgid "You've received a registration request from '%1$s' at %2$s" msgstr "Vous avez reçu une demande d'inscription de %1$s sur %2$s" -#: src/Navigation/Notifications/Repository/Notify.php:467 +#: src/Navigation/Notifications/Repository/Notify.php:470 #, php-format msgid "You've received a [url=%1$s]registration request[/url] from %2$s." msgstr "%2$s vous a envoyé une [url=%1$s]demande de création de compte[/url]." -#: src/Navigation/Notifications/Repository/Notify.php:472 +#: src/Navigation/Notifications/Repository/Notify.php:475 #, php-format msgid "" "Full Name:\t%s\n" @@ -10768,17 +10779,17 @@ msgid "" "Login Name:\t%s (%s)" msgstr "Nom complet :\t%s\nAdresse du site :\t%s\nIdentifiant :\t%s (%s)" -#: src/Navigation/Notifications/Repository/Notify.php:478 +#: src/Navigation/Notifications/Repository/Notify.php:481 #, php-format msgid "Please visit %s to approve or reject the request." msgstr "Veuillez visiter %s pour approuver ou rejeter la demande." -#: src/Navigation/Notifications/Repository/Notify.php:745 +#: src/Navigation/Notifications/Repository/Notify.php:749 #, php-format msgid "%s %s tagged you" msgstr "%s%s vous a mentionné•e" -#: src/Navigation/Notifications/Repository/Notify.php:748 +#: src/Navigation/Notifications/Repository/Notify.php:752 #, php-format msgid "%s %s shared a new post" msgstr "%s %s a partagé une nouvelle publication" @@ -11009,25 +11020,25 @@ msgstr "Montrer plus" msgid "Show fewer" msgstr "Montrer moins" -#: src/Protocol/OStatus.php:1475 +#: src/Protocol/OStatus.php:1471 #, php-format msgid "%s is now following %s." msgstr "%s suit désormais %s." -#: src/Protocol/OStatus.php:1476 +#: src/Protocol/OStatus.php:1472 msgid "following" msgstr "following" -#: src/Protocol/OStatus.php:1479 +#: src/Protocol/OStatus.php:1475 #, php-format msgid "%s stopped following %s." msgstr "%s ne suit plus %s." -#: src/Protocol/OStatus.php:1480 +#: src/Protocol/OStatus.php:1476 msgid "stopped following" msgstr "retiré de la liste de suivi" -#: src/Render/FriendicaSmartyEngine.php:53 +#: src/Render/FriendicaSmartyEngine.php:56 #, php-format msgid "The folder %s must be writable by webserver." msgstr "Le répertoire %s doit être accessible en écriture par le serveur web." @@ -11072,73 +11083,73 @@ msgstr "L'administrateur de %s" msgid "thanks" msgstr "merci" -#: src/Util/Temporal.php:167 +#: src/Util/Temporal.php:170 msgid "YYYY-MM-DD or MM-DD" msgstr "AAAA-MM-JJ ou MM-JJ" -#: src/Util/Temporal.php:275 +#: src/Util/Temporal.php:278 #, php-format msgid "Time zone: %s Change in Settings" msgstr "Fuseau horaire : %s Le changer dans les paramètres" -#: src/Util/Temporal.php:318 +#: src/Util/Temporal.php:321 msgid "never" msgstr "jamais" -#: src/Util/Temporal.php:325 +#: src/Util/Temporal.php:328 msgid "less than a second ago" msgstr "il y a moins d'une seconde" -#: src/Util/Temporal.php:333 +#: src/Util/Temporal.php:337 msgid "year" msgstr "année" -#: src/Util/Temporal.php:333 +#: src/Util/Temporal.php:337 msgid "years" msgstr "années" -#: src/Util/Temporal.php:334 +#: src/Util/Temporal.php:338 msgid "months" msgstr "mois" -#: src/Util/Temporal.php:335 +#: src/Util/Temporal.php:339 msgid "weeks" msgstr "semaines" -#: src/Util/Temporal.php:336 +#: src/Util/Temporal.php:340 msgid "days" msgstr "jours" -#: src/Util/Temporal.php:337 +#: src/Util/Temporal.php:341 msgid "hour" msgstr "heure" -#: src/Util/Temporal.php:337 +#: src/Util/Temporal.php:341 msgid "hours" msgstr "heures" -#: src/Util/Temporal.php:338 +#: src/Util/Temporal.php:342 msgid "minute" msgstr "minute" -#: src/Util/Temporal.php:338 +#: src/Util/Temporal.php:342 msgid "minutes" msgstr "minutes" -#: src/Util/Temporal.php:339 +#: src/Util/Temporal.php:343 msgid "second" msgstr "seconde" -#: src/Util/Temporal.php:339 +#: src/Util/Temporal.php:343 msgid "seconds" msgstr "secondes" -#: src/Util/Temporal.php:349 +#: src/Util/Temporal.php:353 #, php-format msgid "in %1$d %2$s" msgstr "dans %1$d %2$s" -#: src/Util/Temporal.php:352 +#: src/Util/Temporal.php:356 #, php-format msgid "%1$d %2$s ago" msgstr "Il y a %1$d %2$s" @@ -11147,11 +11158,11 @@ msgstr "Il y a %1$d %2$s" msgid "(no subject)" msgstr "(aucun sujet)" -#: src/Worker/PushSubscription.php:111 +#: src/Worker/PushSubscription.php:110 msgid "Notification from Friendica" msgstr "Notification de Friendica" -#: src/Worker/PushSubscription.php:112 +#: src/Worker/PushSubscription.php:111 msgid "Empty Post" msgstr "Publication vide" @@ -11187,113 +11198,124 @@ msgstr "slackr" msgid "Variations" msgstr "Variations" -#: view/theme/frio/config.php:142 +#: view/theme/frio/config.php:153 msgid "Light (Accented)" msgstr "Clair (Accentué)" -#: view/theme/frio/config.php:143 +#: view/theme/frio/config.php:154 msgid "Dark (Accented)" msgstr "Sombre (Accentué)" -#: view/theme/frio/config.php:144 +#: view/theme/frio/config.php:155 msgid "Black (Accented)" msgstr "Noir (Accentué)" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Note" msgstr "Note" -#: view/theme/frio/config.php:156 +#: view/theme/frio/config.php:167 msgid "Check image permissions if all users are allowed to see the image" msgstr "Vérifier les permissions des images si tous les utilisateurs sont autorisés à voir l'image" -#: view/theme/frio/config.php:162 +#: view/theme/frio/config.php:173 msgid "Custom" msgstr "Personnalisé" -#: view/theme/frio/config.php:163 +#: view/theme/frio/config.php:174 msgid "Legacy" msgstr "Original" -#: view/theme/frio/config.php:164 +#: view/theme/frio/config.php:175 msgid "Accented" msgstr "Accentué" -#: view/theme/frio/config.php:165 +#: view/theme/frio/config.php:176 msgid "Select color scheme" msgstr "Sélectionner le schéma de couleurs" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Select scheme accent" msgstr "Sélectionner l'accent du schéma de couleurs" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Blue" msgstr "Bleu" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Red" msgstr "Rouge" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Purple" msgstr "Violet" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Green" msgstr "Vert" -#: view/theme/frio/config.php:166 +#: view/theme/frio/config.php:177 msgid "Pink" msgstr "Rose" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "Copy or paste schemestring" msgstr "Copier ou coller le fil conducteur" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:178 msgid "" "You can copy this string to share your theme with others. Pasting here " "applies the schemestring" msgstr "Vous pouvez copier le contenu de ce champ pour partager votre thème. Vous pouvez également y coller une définition de palette différente pour l'appliquer à votre thème." -#: view/theme/frio/config.php:168 +#: view/theme/frio/config.php:179 msgid "Navigation bar background color" msgstr "Couleur d'arrière-plan de la barre de navigation" -#: view/theme/frio/config.php:169 +#: view/theme/frio/config.php:180 msgid "Navigation bar icon color " msgstr "Couleur des icônes de la barre de navigation" -#: view/theme/frio/config.php:170 +#: view/theme/frio/config.php:181 msgid "Link color" msgstr "Couleur des liens" -#: view/theme/frio/config.php:171 +#: view/theme/frio/config.php:182 msgid "Set the background color" msgstr "Paramétrer la couleur d'arrière-plan" -#: view/theme/frio/config.php:172 +#: view/theme/frio/config.php:183 msgid "Content background opacity" msgstr "Opacité du contenu d'arrière-plan" -#: view/theme/frio/config.php:173 +#: view/theme/frio/config.php:184 msgid "Set the background image" msgstr "Paramétrer l'image d'arrière-plan" -#: view/theme/frio/config.php:174 +#: view/theme/frio/config.php:185 msgid "Background image style" msgstr "Style de l'image de fond" -#: view/theme/frio/config.php:179 +#: view/theme/frio/config.php:188 +msgid "Always open Compose page" +msgstr "Toujours ouvrir la page Compose" + +#: view/theme/frio/config.php:188 +msgid "" +"The New Post button always open the Compose page " +"instead of the modal form. When this is disabled, the Compose page can be " +"accessed with a middle click on the link or from the modal." +msgstr "Le bouton Nouvelle publication ouvre systématiquement la page Compose à la place du formulaire modal. Quand désactivé, la page Compose peut être ouverte via un clic milieu sur le lien ou à partir du modal." + +#: view/theme/frio/config.php:192 msgid "Login page background image" msgstr "Image de fond de la page de login" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Login page background color" msgstr "Couleur d'arrière-plan de la page de login" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:196 msgid "Leave background image and color empty for theme defaults" msgstr "Laisser l'image et la couleur de fond vides pour les paramètres par défaut du thème" @@ -11341,11 +11363,11 @@ msgstr "Aller au contenu principal" msgid "Back to top" msgstr "Retour en haut" -#: view/theme/frio/theme.php:202 +#: view/theme/frio/theme.php:218 msgid "Guest" msgstr "Invité" -#: view/theme/frio/theme.php:205 +#: view/theme/frio/theme.php:221 msgid "Visitor" msgstr "Visiteur" diff --git a/view/lang/fr/strings.php b/view/lang/fr/strings.php index 59cca96c1..89dd29da3 100644 --- a/view/lang/fr/strings.php +++ b/view/lang/fr/strings.php @@ -1422,8 +1422,8 @@ $a->strings['Job Parameters'] = 'Paramètres de la tâche'; $a->strings['Priority'] = 'Priorité'; $a->strings['No special theme for mobile devices'] = 'Pas de thème particulier pour les terminaux mobiles'; $a->strings['%s - (Experimental)'] = '%s- (expérimental)'; -$a->strings['No community page for local users'] = 'Pas de page communauté pour les utilisateurs enregistrés'; $a->strings['No community page'] = 'Aucune page de communauté'; +$a->strings['No community page for visitors'] = 'Aucune page communautaire pour les visiteurs'; $a->strings['Public postings from users of this site'] = 'Publications publiques des utilisateurs de ce site'; $a->strings['Public postings from the federated network'] = 'Publications publiques du réseau fédéré'; $a->strings['Public postings from local users and the federated network'] = 'Publications publiques des utilisateurs du site et du réseau fédéré'; @@ -1922,6 +1922,7 @@ $a->strings['Contact is being deleted.'] = 'Le contact est en cours de suppressi $a->strings['Follow was successfully revoked.'] = 'Le suivi a été révoqué avec succès.'; $a->strings['Do you really want to revoke this contact\'s follow? This cannot be undone and they will have to manually follow you back again.'] = 'Voulez-vous vraiment révoquer l\'abonnement de ce contact ? Cela ne peut être annulé et il devra se réabonner à vous manuellement.'; $a->strings['Yes'] = 'Oui'; +$a->strings['This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.'] = 'Ce fil communautaire liste toutes les conversations publiques reçues par ce serveur. Elles ne reflètent pas nécessairement les opinions personelles des utilisateurs locaux.'; $a->strings['Local Community'] = 'Communauté locale'; $a->strings['Posts from local users on this server'] = 'Conversations publiques démarrées par des utilisateurs locaux'; $a->strings['Global Community'] = 'Communauté globale'; @@ -1930,7 +1931,6 @@ $a->strings['Own Contacts'] = 'Publications de vos propres contacts'; $a->strings['Include'] = 'Inclure'; $a->strings['Hide'] = 'Masquer'; $a->strings['No results.'] = 'Aucun résultat.'; -$a->strings['This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.'] = 'Ce fil communautaire liste toutes les conversations publiques reçues par ce serveur. Elles ne reflètent pas nécessairement les opinions personelles des utilisateurs locaux.'; $a->strings['Community option not available.'] = 'L\'option communauté n\'est pas disponible'; $a->strings['Not available.'] = 'Indisponible.'; $a->strings['No such group'] = 'Groupe inexistant'; @@ -2019,8 +2019,8 @@ $a->strings['No entries (some entries may be hidden).'] = 'Aucune entrée (certa $a->strings['Find on this site'] = 'Trouver sur ce site'; $a->strings['Results for:'] = 'Résultats pour :'; $a->strings['Site Directory'] = 'Annuaire local'; -$a->strings['Item was not removed'] = 'L\'élément n\'a pas été retiré'; $a->strings['Item was not deleted'] = 'L\'élément n\'a pas été supprimé'; +$a->strings['Item was not removed'] = 'L\'élément n\'a pas été retiré'; $a->strings['- select -'] = '- choisir -'; $a->strings['Suggested contact not found.'] = 'Contact suggéré non trouvé'; $a->strings['Friend suggestion sent.'] = 'Suggestion d\'abonnement envoyée.'; @@ -2124,6 +2124,7 @@ $a->strings['Visibility'] = 'Visibilité'; $a->strings['Clear the location'] = 'Effacer la localisation'; $a->strings['Location services are unavailable on your device'] = 'Les services de localisation ne sont pas disponibles sur votre appareil'; $a->strings['Location services are disabled. Please check the website\'s permissions on your device'] = 'Les services de localisation sont désactivés pour ce site. Veuillez vérifier les permissions de ce site sur votre appareil/navigateur.'; +$a->strings['You can make this page always open when you use the New Post button in the Theme Customization settings.'] = 'Vous pouvez faire en sorte que cette page s\'ouvre systématiquement quand vous utilisez le bouton "Nouvelle publication" dans les paramètres de personnalisation des thèmes.'; $a->strings['Unable to follow this item.'] = 'Erreur lors de l\'abonnement à la conversation.'; $a->strings['System down for maintenance'] = 'Système indisponible pour cause de maintenance'; $a->strings['This Friendica node is currently in maintenance mode, either automatically because it is self-updating or manually by the node administrator. This condition should be temporary, please come back in a few minutes.'] = 'Ce serveur Friendica est actuellement en maintenance, soit automatiquement pendant la mise à jour ou manuellement par un administrateur. Cet état devrait être temporaire, merci de réessayer dans quelques minutes.'; @@ -2833,6 +2834,8 @@ $a->strings['Set the background color'] = 'Paramétrer la couleur d\'arrière-pl $a->strings['Content background opacity'] = 'Opacité du contenu d\'arrière-plan'; $a->strings['Set the background image'] = 'Paramétrer l\'image d\'arrière-plan'; $a->strings['Background image style'] = 'Style de l\'image de fond'; +$a->strings['Always open Compose page'] = 'Toujours ouvrir la page Compose'; +$a->strings['The New Post button always open the Compose page instead of the modal form. When this is disabled, the Compose page can be accessed with a middle click on the link or from the modal.'] = 'Le bouton Nouvelle publication ouvre systématiquement la page Compose à la place du formulaire modal. Quand désactivé, la page Compose peut être ouverte via un clic milieu sur le lien ou à partir du modal.'; $a->strings['Login page background image'] = 'Image de fond de la page de login'; $a->strings['Login page background color'] = 'Couleur d\'arrière-plan de la page de login'; $a->strings['Leave background image and color empty for theme defaults'] = 'Laisser l\'image et la couleur de fond vides pour les paramètres par défaut du thème'; From 5874de47431c4eb9b04bbc02bd333e35c1879dcf Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Oct 2022 04:14:42 +0000 Subject: [PATCH 068/641] old boot.functions replaced in /mod --- mod/cal.php | 4 ++-- mod/display.php | 50 +++++++++++++++++++-------------------- mod/editpost.php | 11 +++++---- mod/events.php | 29 ++++++++++++----------- mod/fbrowser.php | 9 +++---- mod/follow.php | 9 +++---- mod/item.php | 46 +++++++++++++++++------------------ mod/match.php | 13 +++++----- mod/message.php | 27 +++++++++++---------- mod/notes.php | 15 ++++++------ mod/oexchange.php | 5 ++-- mod/ostatus_subscribe.php | 5 ++-- mod/photos.php | 34 +++++++++++++------------- mod/redir.php | 10 ++++---- mod/removeme.php | 7 +++--- mod/repair_ostatus.php | 5 ++-- mod/settings.php | 49 +++++++++++++++++++------------------- mod/share.php | 3 ++- mod/suggest.php | 5 ++-- mod/tagger.php | 6 ++--- mod/tagrm.php | 9 +++---- mod/unfollow.php | 11 +++++---- mod/update_contact.php | 3 ++- mod/wall_attach.php | 2 +- mod/wall_upload.php | 2 +- 25 files changed, 193 insertions(+), 176 deletions(-) diff --git a/mod/cal.php b/mod/cal.php index ec6df1f16..ef2063d0a 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -116,7 +116,7 @@ function cal_content(App $a) $remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]); - $is_owner = local_user() == $owner['uid']; + $is_owner = Session::getLocalUser() == $owner['uid']; if ($owner['hidewall'] && !$is_owner && !$remote_contact) { DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.')); @@ -278,7 +278,7 @@ function cal_content(App $a) // If it the own calendar return to the events page // otherwise to the profile calendar page - if (local_user() === $owner_uid) { + if (Session::getLocalUser() === $owner_uid) { $return_path = "events"; } else { $return_path = "cal/" . $nick; diff --git a/mod/display.php b/mod/display.php index c1b7746e2..1a024c768 100644 --- a/mod/display.php +++ b/mod/display.php @@ -53,7 +53,7 @@ function display_init(App $a) $nick = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : ''); $item = null; - $item_user = local_user(); + $item_user = Session::getLocalUser(); $fields = ['uri-id', 'parent-uri-id', 'author-id', 'author-link', 'body', 'uid', 'guid', 'gravity']; @@ -62,18 +62,18 @@ function display_init(App $a) $nick = ''; // Does the local user have this item? - if (local_user()) { - $item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => local_user()]); + if (Session::getLocalUser()) { + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => Session::getLocalUser()]); if (DBA::isResult($item)) { $nick = $a->getLoggedInUserNickname(); } } // Is this item private but could be visible to the remove visitor? - if (!DBA::isResult($item) && remote_user()) { + if (!DBA::isResult($item) && Session::getRemoteUser()) { $item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]); if (DBA::isResult($item)) { - if (!Contact::isFollower(remote_user(), $item['uid'])) { + if (!Contact::isFollower(Session::getRemoteUser(), $item['uid'])) { $item = null; } else { $item_user = $item['uid']; @@ -83,14 +83,14 @@ function display_init(App $a) // Is it an item with uid=0? if (!DBA::isResult($item)) { - $item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]); + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]); } } elseif (DI::args()->getArgc() >= 3 && $nick == 'feed-item') { $uri_id = DI::args()->getArgv()[2]; if (substr($uri_id, -5) == '.atom') { $uri_id = substr($uri_id, 0, -5); } - $item = Post::selectFirstForUser(local_user(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]); + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]); } if (!DBA::isResult($item)) { @@ -126,7 +126,7 @@ function display_fetchauthor($item) if (Diaspora::isReshare($item['body'], true)) { $shared = Item::getShareArray($item); if (!empty($shared['profile'])) { - $contact = Contact::getByURLForUser($shared['profile'], local_user()); + $contact = Contact::getByURLForUser($shared['profile'], Session::getLocalUser()); } } @@ -181,18 +181,18 @@ function display_content(App $a, $update = false, $update_uid = 0) if (DI::args()->getArgc() == 2) { $fields = ['uri-id', 'parent-uri-id', 'uid']; - if (local_user()) { - $condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, local_user()]]; - $item = Post::selectFirstForUser(local_user(), $fields, $condition, ['order' => ['uid' => true]]); + if (Session::getLocalUser()) { + $condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, Session::getLocalUser()]]; + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, $condition, ['order' => ['uid' => true]]); if (DBA::isResult($item)) { $uri_id = $item['uri-id']; $parent_uri_id = $item['parent-uri-id']; } } - if (($parent_uri_id == 0) && remote_user()) { + if (($parent_uri_id == 0) && Session::getRemoteUser()) { $item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]); - if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) { + if (DBA::isResult($item) && Contact::isFollower(Session::getRemoteUser(), $item['uid'])) { $uri_id = $item['uri-id']; $parent_uri_id = $item['parent-uri-id']; } @@ -200,7 +200,7 @@ function display_content(App $a, $update = false, $update_uid = 0) if ($parent_uri_id == 0) { $condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => DI::args()->getArgv()[1], 'uid' => 0]; - $item = Post::selectFirstForUser(local_user(), $fields, $condition); + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, $condition); if (DBA::isResult($item)) { $uri_id = $item['uri-id']; $parent_uri_id = $item['parent-uri-id']; @@ -213,9 +213,9 @@ function display_content(App $a, $update = false, $update_uid = 0) throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.')); } - if (!DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) { - DI::notification()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]); - DI::notify()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]); + if (!DI::pConfig()->get(Session::getLocalUser(), 'system', 'detailed_notif')) { + DI::notification()->setAllSeenForUser(Session::getLocalUser(), ['parent-uri-id' => $item['parent-uri-id']]); + DI::notify()->setAllSeenForUser(Session::getLocalUser(), ['parent-uri-id' => $item['parent-uri-id']]); } // We are displaying an "alternate" link if that post was public. See issue 2864 @@ -234,11 +234,11 @@ function display_content(App $a, $update = false, $update_uid = 0) '$conversation' => $conversation]); $is_remote_contact = false; - $item_uid = local_user(); + $item_uid = Session::getLocalUser(); $page_uid = 0; $parent = null; - if (!local_user() && !empty($parent_uri_id)) { + if (!Session::getLocalUser() && !empty($parent_uri_id)) { $parent = Post::selectFirst(['uid'], ['uri-id' => $parent_uri_id, 'wall' => true]); } @@ -252,11 +252,11 @@ function display_content(App $a, $update = false, $update_uid = 0) $page_uid = $item['uid']; } - if (!empty($page_uid) && ($page_uid != local_user())) { + if (!empty($page_uid) && ($page_uid != Session::getLocalUser())) { $page_user = User::getById($page_uid); } - $is_owner = local_user() && (in_array($page_uid, [local_user(), 0])); + $is_owner = Session::getLocalUser() && (in_array($page_uid, [Session::getLocalUser(), 0])); if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.')); @@ -268,8 +268,8 @@ function display_content(App $a, $update = false, $update_uid = 0) } $sql_extra = Item::getPermissionsSQLByUserId($page_uid); - if (local_user() && (local_user() == $page_uid)) { - $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true]; + if (Session::getLocalUser() && (Session::getLocalUser() == $page_uid)) { + $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => Session::getLocalUser(), 'unseen' => true]; $unseen = Post::exists($condition); } else { $unseen = false; @@ -290,11 +290,11 @@ function display_content(App $a, $update = false, $update_uid = 0) $item['uri-id'] = $item['parent-uri-id']; if ($unseen) { - $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true]; + $condition = ['parent-uri-id' => $parent_uri_id, 'uid' => Session::getLocalUser(), 'unseen' => true]; Item::update(['unseen' => false], $condition); } - if (!$update && local_user()) { + if (!$update && Session::getLocalUser()) { $o .= ""; } diff --git a/mod/editpost.php b/mod/editpost.php index 8d2160fde..8b25f66be 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -23,6 +23,7 @@ use Friendica\App; use Friendica\Content\Feature; use Friendica\Core\Hook; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -34,7 +35,7 @@ function editpost_content(App $a) { $o = ''; - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -49,14 +50,14 @@ function editpost_content(App $a) $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid']; - $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]); + $item = Post::selectFirstForUser(Session::getLocalUser(), $fields, ['id' => $post_id, 'uid' => Session::getLocalUser()]); if (!DBA::isResult($item)) { DI::sysmsg()->addNotice(DI::l10n()->t('Item not found')); return; } - $user = User::getById(local_user()); + $user = User::getById(Session::getLocalUser()); $geotag = ''; @@ -118,8 +119,8 @@ function editpost_content(App $a) '$jotnets' => $jotnets, '$title' => $item['title'], '$placeholdertitle' => DI::l10n()->t('Set title'), - '$category' => Post\Category::getCSVByURIId($item['uri-id'], local_user(), Post\Category::CATEGORY), - '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''), + '$category' => Post\Category::getCSVByURIId($item['uri-id'], Session::getLocalUser(), Post\Category::CATEGORY), + '$placeholdercategory' => (Feature::isEnabled(Session::getLocalUser(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''), '$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), diff --git a/mod/events.php b/mod/events.php index a9a2e47fe..ac2a08afc 100644 --- a/mod/events.php +++ b/mod/events.php @@ -27,6 +27,7 @@ use Friendica\Core\ACL; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Core\Worker; @@ -46,7 +47,7 @@ use Friendica\Worker\Delivery; function events_init(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } @@ -54,7 +55,7 @@ function events_init(App $a) DI::page()['aside'] = ''; } - $cal_widget = CalendarExport::getHTML(local_user()); + $cal_widget = CalendarExport::getHTML(Session::getLocalUser()); DI::page()['aside'] .= $cal_widget; @@ -64,13 +65,13 @@ function events_init(App $a) function events_post(App $a) { Logger::debug('post', ['request' => $_REQUEST]); - if (!local_user()) { + if (!Session::getLocalUser()) { return; } $event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0; $cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0; - $uid = local_user(); + $uid = Session::getLocalUser(); $start_text = Strings::escapeHtml($_REQUEST['start_text'] ?? ''); $finish_text = Strings::escapeHtml($_REQUEST['finish_text'] ?? ''); @@ -214,7 +215,7 @@ function events_post(App $a) function events_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -224,11 +225,11 @@ function events_content(App $a) } if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'ignore') && intval(DI::args()->getArgv()[2])) { - DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); + DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]); } if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'unignore') && intval(DI::args()->getArgv()[2])) { - DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); + DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]); } if ($a->getThemeInfoValue('events_in_profile')) { @@ -323,9 +324,9 @@ function events_content(App $a) // get events by id or by date if ($event_params['event_id']) { - $r = Event::getListById(local_user(), $event_params['event_id']); + $r = Event::getListById(Session::getLocalUser(), $event_params['event_id']); } else { - $r = Event::getListByDate(local_user(), $event_params); + $r = Event::getListByDate(Session::getLocalUser(), $event_params); } $links = []; @@ -396,7 +397,7 @@ function events_content(App $a) } if (($mode === 'edit' || $mode === 'copy') && $event_id) { - $orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => local_user()]); + $orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => Session::getLocalUser()]); } // Passed parameters overrides anything found in the DB @@ -405,8 +406,8 @@ function events_content(App $a) $share_disabled = ''; if (empty($orig_event)) { - $orig_event = User::getById(local_user(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);; - } elseif ($orig_event['allow_cid'] !== '<' . local_user() . '>' + $orig_event = User::getById(Session::getLocalUser(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);; + } elseif ($orig_event['allow_cid'] !== '<' . Session::getLocalUser() . '>' || $orig_event['allow_gid'] || $orig_event['deny_cid'] || $orig_event['deny_gid']) { @@ -524,11 +525,11 @@ function events_content(App $a) // Remove an event from the calendar and its related items if ($mode === 'drop' && $event_id) { - $ev = Event::getListById(local_user(), $event_id); + $ev = Event::getListById(Session::getLocalUser(), $event_id); // Delete only real events (no birthdays) if (DBA::isResult($ev) && $ev[0]['type'] == 'event') { - Item::deleteForUser(['id' => $ev[0]['itemid']], local_user()); + Item::deleteForUser(['id' => $ev[0]['itemid']], Session::getLocalUser()); } if (Post::exists(['id' => $ev[0]['itemid']])) { diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 2f1181a85..a2457575a 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -24,6 +24,7 @@ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; @@ -38,7 +39,7 @@ use Friendica\Util\Strings; */ function fbrowser_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { System::exit(); } @@ -65,7 +66,7 @@ function fbrowser_content(App $a) if (DI::args()->getArgc() == 2) { $photos = DBA::toArray(DBA::p("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)", - local_user(), + Session::getLocalUser(), Photo::CONTACT_AVATAR, Photo::CONTACT_BANNER )); @@ -84,7 +85,7 @@ function fbrowser_content(App $a) min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created` FROM `photo` WHERE `uid` = ? $sql_extra AND NOT `photo-type` IN (?, ?) GROUP BY `resource-id` $sql_extra2", - local_user(), + Session::getLocalUser(), Photo::CONTACT_AVATAR, Photo::CONTACT_BANNER )); @@ -124,7 +125,7 @@ function fbrowser_content(App $a) break; case "file": if (DI::args()->getArgc()==2) { - $files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => local_user()]); + $files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => Session::getLocalUser()]); function _map_files2($rr) { diff --git a/mod/follow.php b/mod/follow.php index b6ffe2ef0..8e08d7a72 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -23,6 +23,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Profile; @@ -35,7 +36,7 @@ use Friendica\Util\Strings; function follow_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.')); } @@ -52,13 +53,13 @@ function follow_content(App $a) { $return_path = 'contact'; - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect($return_path); // NOTREACHED } - $uid = local_user(); + $uid = Session::getLocalUser(); $url = Probe::cleanURI(trim($_REQUEST['url'] ?? '')); @@ -195,7 +196,7 @@ function follow_process(App $a, string $url) function follow_remote_item($url) { - $item_id = Item::fetchByLink($url, local_user()); + $item_id = Item::fetchByLink($url, Session::getLocalUser()); if (!$item_id) { // If the user-specific search failed, we search and probe a public post $item_id = Item::fetchByLink($url); diff --git a/mod/item.php b/mod/item.php index 799d1b888..e36853acc 100644 --- a/mod/item.php +++ b/mod/item.php @@ -62,7 +62,7 @@ function item_post(App $a) { throw new HTTPException\ForbiddenException(); } - $uid = local_user(); + $uid = Session::getLocalUser(); if (!empty($_REQUEST['dropitems'])) { $arr_drop = explode(',', $_REQUEST['dropitems']); @@ -107,7 +107,7 @@ function item_post(App $a) { $toplevel_user_id = null; $objecttype = null; - $profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: local_user(); + $profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: Session::getLocalUser(); $posttype = ($_REQUEST['post_type'] ?? '') ?: Item::PT_ARTICLE; if ($parent_item_id || $thr_parent_uri) { @@ -139,7 +139,7 @@ function item_post(App $a) { // When commenting on a public post then store the post for the current user // This enables interaction like starring and saving into folders if ($toplevel_item['uid'] == 0) { - $stored = Item::storeForUserByUriId($toplevel_item['uri-id'], local_user(), ['post-reason' => Item::PR_ACTIVITY]); + $stored = Item::storeForUserByUriId($toplevel_item['uri-id'], Session::getLocalUser(), ['post-reason' => Item::PR_ACTIVITY]); Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $uid, 'stored' => $stored]); if ($stored) { $toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $stored]); @@ -169,16 +169,16 @@ function item_post(App $a) { } // Ensure that the user id in a thread always stay the same - if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [local_user(), 0])) { + if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [Session::getLocalUser(), 0])) { $profile_uid = $toplevel_user_id; } // Allow commenting if it is an answer to a public post - $allow_comment = local_user() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED); + $allow_comment = Session::getLocalUser() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED); // Now check that valid personal details have been provided if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) { - Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]); + Logger::warning('Permission denied.', ['local' => Session::getLocalUser(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]); DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); if ($return_path) { DI::baseUrl()->redirect($return_path); @@ -324,9 +324,9 @@ function item_post(App $a) { $pubmail_enabled = ($_REQUEST['pubmail_enable'] ?? false) && !$private; // if using the API, we won't see pubmail_enable - figure out if it should be set - if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) { + if ($api_source && $profile_uid && $profile_uid == Session::getLocalUser() && !$private) { if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) { - $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']); + $pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", Session::getLocalUser(), '']); } } @@ -363,9 +363,9 @@ function item_post(App $a) { $self = false; $contact_id = 0; - if (local_user() && ((local_user() == $profile_uid) || $allow_comment)) { + if (Session::getLocalUser() && ((Session::getLocalUser() == $profile_uid) || $allow_comment)) { $self = true; - $author = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]); + $author = DBA::selectFirst('contact', [], ['uid' => Session::getLocalUser(), 'self' => true]); } elseif (!empty(Session::getRemoteContactID($profile_uid))) { $author = DBA::selectFirst('contact', [], ['id' => Session::getRemoteContactID($profile_uid)]); } @@ -375,7 +375,7 @@ function item_post(App $a) { } // get contact info for owner - if ($profile_uid == local_user() || $allow_comment) { + if ($profile_uid == Session::getLocalUser() || $allow_comment) { $contact_record = $author ?: []; } else { $contact_record = DBA::selectFirst('contact', [], ['uid' => $profile_uid, 'self' => true]) ?: []; @@ -385,7 +385,7 @@ function item_post(App $a) { if ($posttype != Item::PT_PERSONAL_NOTE) { // Look for any tags and linkify them $item = [ - 'uid' => local_user() ? local_user() : $profile_uid, + 'uid' => Session::getLocalUser() ? Session::getLocalUser() : $profile_uid, 'gravity' => $toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT, 'network' => $network, 'body' => $body, @@ -734,7 +734,7 @@ function item_post(App $a) { Hook::callAll('post_local_end', $datarray); - if (strlen($emailcc) && $profile_uid == local_user()) { + if (strlen($emailcc) && $profile_uid == Session::getLocalUser()) { $recipients = explode(',', $emailcc); if (count($recipients)) { foreach ($recipients as $recipient) { @@ -794,9 +794,9 @@ function item_content(App $a) switch ($args->get(1)) { case 'drop': if (DI::mode()->isAjax()) { - Item::deleteForUser(['id' => $args->get(2)], local_user()); + Item::deleteForUser(['id' => $args->get(2)], Session::getLocalUser()); // ajax return: [, 0 (no perm) | ] - System::jsonExit([intval($args->get(2)), local_user()]); + System::jsonExit([intval($args->get(2)), Session::getLocalUser()]); } else { if (!empty($args->get(3))) { $o = drop_item($args->get(2), $args->get(3)); @@ -807,16 +807,16 @@ function item_content(App $a) break; case 'block': - $item = Post::selectFirstForUser(local_user(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]); + $item = Post::selectFirstForUser(Session::getLocalUser(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]); if (empty($item['author-id'])) { throw new HTTPException\NotFoundException('Item not found'); } - Contact\User::setBlocked($item['author-id'], local_user(), true); + Contact\User::setBlocked($item['author-id'], Session::getLocalUser(), true); if (DI::mode()->isAjax()) { // ajax return: [, 0 (no perm) | ] - System::jsonExit([intval($args->get(2)), local_user()]); + System::jsonExit([intval($args->get(2)), Session::getLocalUser()]); } else { item_redirect_after_action($item, $args->get(3)); } @@ -835,7 +835,7 @@ function item_content(App $a) function drop_item(int $id, string $return = ''): string { // Locate item to be deleted - $item = Post::selectFirstForUser(local_user(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]); + $item = Post::selectFirstForUser(Session::getLocalUser(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]); if (!DBA::isResult($item)) { DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.')); @@ -854,14 +854,14 @@ function drop_item(int $id, string $return = ''): string $contact_id = $item['contact-id']; } - if ((local_user() == $item['uid']) || $contact_id) { + if ((Session::getLocalUser() == $item['uid']) || $contact_id) { // delete the item - Item::deleteForUser(['id' => $item['id']], local_user()); + Item::deleteForUser(['id' => $item['id']], Session::getLocalUser()); item_redirect_after_action($item, $return); //NOTREACHED } else { - Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]); + Logger::warning('Permission denied.', ['local' => Session::getLocalUser(), 'uid' => $item['uid'], 'cid' => $contact_id]); DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('display/' . $item['guid']); //NOTREACHED @@ -880,7 +880,7 @@ function item_redirect_after_action(array $item, string $returnUrlHex) // Check if delete a comment if ($item['gravity'] == Item::GRAVITY_COMMENT) { if (!empty($item['parent'])) { - $parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]); + $parentitem = Post::selectFirstForUser(Session::getLocalUser(), ['guid'], ['id' => $item['parent']]); } // Return to parent guid diff --git a/mod/match.php b/mod/match.php index a1f7be77c..860d60f56 100644 --- a/mod/match.php +++ b/mod/match.php @@ -23,6 +23,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\Renderer; use Friendica\Core\Search; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -44,7 +45,7 @@ use Friendica\Module\Contact as ModuleContact; */ function match_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return ''; } @@ -53,7 +54,7 @@ function match_content(App $a) $_SESSION['return_path'] = DI::args()->getCommand(); - $profile = Profile::getByUID(local_user()); + $profile = Profile::getByUID(Session::getLocalUser()); if (!DBA::isResult($profile)) { return ''; @@ -67,10 +68,10 @@ function match_content(App $a) $tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']); if (DI::mode()->isMobile()) { - $limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network', + $limit = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network', DI::config()->get('system', 'itemspage_network_mobile')); } else { - $limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_network', + $limit = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network', DI::config()->get('system', 'itemspage_network')); } @@ -114,12 +115,12 @@ function match_get_contacts($msearch, $entries, $limit) } // Already known contact - $contact = Contact::getByURL($profile->url, null, ['rel'], local_user()); + $contact = Contact::getByURL($profile->url, null, ['rel'], Session::getLocalUser()); if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) { continue; } - $contact = Contact::getByURLForUser($profile->url, local_user()); + $contact = Contact::getByURLForUser($profile->url, Session::getLocalUser()); if (!empty($contact)) { $entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact); } diff --git a/mod/message.php b/mod/message.php index 4b6f5b31b..8d379f4e9 100644 --- a/mod/message.php +++ b/mod/message.php @@ -25,6 +25,7 @@ use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Core\ACL; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -39,7 +40,7 @@ function message_init(App $a) $tabs = ''; if (DI::args()->getArgc() > 1 && is_numeric(DI::args()->getArgv()[1])) { - $tabs = render_messages(get_messages(local_user(), 0, 5), 'mail_list.tpl'); + $tabs = render_messages(get_messages(Session::getLocalUser(), 0, 5), 'mail_list.tpl'); } $new = [ @@ -65,7 +66,7 @@ function message_init(App $a) function message_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -110,7 +111,7 @@ function message_content(App $a) $o = ''; Nav::setSelected('messages'); - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -144,28 +145,28 @@ function message_content(App $a) $cmd = DI::args()->getArgv()[1]; if ($cmd === 'drop') { - $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); + $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]); if(!DBA::isResult($message)){ DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.')); DI::baseUrl()->redirect('message'); } - if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) { + if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()])) { DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.')); } - $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]); + $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => Session::getLocalUser()]); if(!DBA::isResult($conversation)){ DI::baseUrl()->redirect('message'); } DI::baseUrl()->redirect('message/' . $conversation['id'] ); } else { - $parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); + $parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => Session::getLocalUser()]); if (DBA::isResult($parentmail)) { $parent = $parentmail['parent-uri']; - if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { + if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => Session::getLocalUser()])) { DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.')); } } @@ -215,11 +216,11 @@ function message_content(App $a) $o .= $header; - $total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']); + $total = DBA::count('mail', ['uid' => Session::getLocalUser()], ['distinct' => true, 'expression' => 'parent-uri']); $pager = new Pager(DI::l10n(), DI::args()->getQueryString()); - $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage()); + $r = get_messages(Session::getLocalUser(), $pager->getStart(), $pager->getItemsPerPage()); if (!DBA::isResult($r)) { DI::sysmsg()->addNotice(DI::l10n()->t('No messages.')); @@ -243,14 +244,14 @@ function message_content(App $a) LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` WHERE `mail`.`uid` = ? AND `mail`.`id` = ? LIMIT 1", - local_user(), + Session::getLocalUser(), DI::args()->getArgv()[1] ); if (DBA::isResult($message)) { $contact_id = $message['contact-id']; $params = [ - local_user(), + Session::getLocalUser(), $message['parent-uri'] ]; @@ -272,7 +273,7 @@ function message_content(App $a) $messages = DBA::toArray($messages_stmt); - DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]); + DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => Session::getLocalUser()]); } else { $messages = false; } diff --git a/mod/notes.php b/mod/notes.php index 2c23e7aaa..9363e51b8 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -22,6 +22,7 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Pager; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; @@ -30,7 +31,7 @@ use Friendica\Module\BaseProfile; function notes_init(App $a) { - if (! local_user()) { + if (! Session::getLocalUser()) { return; } @@ -40,7 +41,7 @@ function notes_init(App $a) function notes_content(App $a, bool $update = false) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -52,7 +53,7 @@ function notes_content(App $a, bool $update = false) $x = [ 'lockstate' => 'lock', - 'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(local_user(), DI::l10n()->t('Personal notes are visible only by yourself.')), + 'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(Session::getLocalUser(), DI::l10n()->t('Personal notes are visible only by yourself.')), 'button' => DI::l10n()->t('Save'), 'acl_data' => '', ]; @@ -60,14 +61,14 @@ function notes_content(App $a, bool $update = false) $o .= DI::conversation()->statusEditor($x, $a->getContactId()); } - $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT, + $condition = ['uid' => Session::getLocalUser(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT, 'contact-id'=> $a->getContactId()]; if (DI::mode()->isMobile()) { - $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network', + $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network', DI::config()->get('system', 'itemspage_network_mobile')); } else { - $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network', + $itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network', DI::config()->get('system', 'itemspage_network')); } @@ -75,7 +76,7 @@ function notes_content(App $a, bool $update = false) $params = ['order' => ['created' => true], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]]; - $r = Post::selectThreadForUser(local_user(), ['uri-id'], $condition, $params); + $r = Post::selectThreadForUser(Session::getLocalUser(), ['uri-id'], $condition, $params); $count = 0; diff --git a/mod/oexchange.php b/mod/oexchange.php index f914e1e17..0970af2fd 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -22,6 +22,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\DI; use Friendica\Module\Response; @@ -97,7 +98,7 @@ function oexchange_init(App $a) function oexchange_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { $o = Login::form(); return $o; } @@ -119,7 +120,7 @@ function oexchange_content(App $a) $post = []; - $post['profile_uid'] = local_user(); + $post['profile_uid'] = Session::getLocalUser(); $post['return'] = '/oexchange/done'; $post['body'] = HTML::toBBCode($s); diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 0dbce59f2..50ff44569 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\DI; use Friendica\Model\APContact; use Friendica\Model\Contact; @@ -29,7 +30,7 @@ use Friendica\Protocol\ActivityPub; function ostatus_subscribe_content(App $a): string { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('ostatus_subscribe'); // NOTREACHED @@ -37,7 +38,7 @@ function ostatus_subscribe_content(App $a): string $o = '

' . DI::l10n()->t('Subscribing to contacts') . '

'; - $uid = local_user(); + $uid = Session::getLocalUser(); $counter = intval($_REQUEST['counter'] ?? 0); diff --git a/mod/photos.php b/mod/photos.php index 8111fffa3..f47456a0b 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -69,7 +69,7 @@ function photos_init(App $a) throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); } - $is_owner = (local_user() && (local_user() == $owner['uid'])); + $is_owner = (Session::getLocalUser() && (Session::getLocalUser() == $owner['uid'])); $albums = Photo::getAlbums($owner['uid']); @@ -96,7 +96,7 @@ function photos_init(App $a) } } - if (local_user() && $owner['uid'] == local_user()) { + if (Session::getLocalUser() && $owner['uid'] == Session::getLocalUser()) { $can_post = true; } else { $can_post = false; @@ -148,7 +148,7 @@ function photos_post(App $a) $page_owner_uid = intval($user['uid']); $community_page = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY; - if (local_user() && (local_user() == $page_owner_uid)) { + if (Session::getLocalUser() && (Session::getLocalUser() == $page_owner_uid)) { $can_post = true; } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) { $contact_id = Session::getRemoteContactID($page_owner_uid); @@ -229,7 +229,7 @@ function photos_post(App $a) )); } else { $r = DBA::toArray(DBA::p("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = ? AND `album` = ?", - local_user(), + Session::getLocalUser(), $album )); } @@ -268,7 +268,7 @@ function photos_post(App $a) $condition = ['contact-id' => $visitor, 'uid' => $page_owner_uid, 'resource-id' => DI::args()->getArgv()[3]]; } else { - $condition = ['uid' => local_user(), 'resource-id' => DI::args()->getArgv()[3]]; + $condition = ['uid' => Session::getLocalUser(), 'resource-id' => DI::args()->getArgv()[3]]; } $photo = DBA::selectFirst('photo', ['resource-id'], $condition); @@ -840,7 +840,7 @@ function photos_content(App $a) $community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false); - if (local_user() && (local_user() == $owner_uid)) { + if (Session::getLocalUser() && (Session::getLocalUser() == $owner_uid)) { $can_post = true; } elseif ($community_page && !empty(Session::getRemoteContactID($owner_uid))) { $contact_id = Session::getRemoteContactID($owner_uid); @@ -862,13 +862,13 @@ function photos_content(App $a) $remote_contact = DBA::isResult($contact); } - if (!$remote_contact && local_user()) { + if (!$remote_contact && Session::getLocalUser()) { $contact_id = $_SESSION['cid']; $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]); } - if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) { + if ($user['hidewall'] && (Session::getLocalUser() != $owner_uid) && !$remote_contact) { DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.')); return; } @@ -878,7 +878,7 @@ function photos_content(App $a) $o = ""; // tabs - $is_owner = (local_user() && (local_user() == $owner_uid)); + $is_owner = (Session::getLocalUser() && (Session::getLocalUser() == $owner_uid)); $o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']); // Display upload form @@ -1197,7 +1197,7 @@ function photos_content(App $a) } if ( - $ph[0]['uid'] == local_user() + $ph[0]['uid'] == Session::getLocalUser() && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) ) { $tools['lock'] = DI::l10n()->t('Private Photo'); @@ -1237,7 +1237,7 @@ function photos_content(App $a) $params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]]; $items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params)); - if (local_user() == $link_item['uid']) { + if (Session::getLocalUser() == $link_item['uid']) { Item::update(['unseen' => false], ['parent' => $link_item['parent']]); } } @@ -1315,7 +1315,7 @@ function photos_content(App $a) */ $qcomment = null; if (Addon::isEnabled('qcomment')) { - $words = DI::pConfig()->get(local_user(), 'qcomment', 'words'); + $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words'); $qcomment = $words ? explode("\n", $words) : []; } @@ -1346,7 +1346,7 @@ function photos_content(App $a) 'attendmaybe' => [] ]; - if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) { + if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike')) { unset($conv_responses['dislike']); } @@ -1371,7 +1371,7 @@ function photos_content(App $a) */ $qcomment = null; if (Addon::isEnabled('qcomment')) { - $words = DI::pConfig()->get(local_user(), 'qcomment', 'words'); + $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words'); $qcomment = $words ? explode("\n", $words) : []; } @@ -1413,7 +1413,7 @@ function photos_content(App $a) $sparkle = ''; } - $dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == local_user())); + $dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == Session::getLocalUser())); $drop = [ 'dropping' => $dropping, 'pagedrop' => false, @@ -1445,7 +1445,7 @@ function photos_content(App $a) */ $qcomment = null; if (Addon::isEnabled('qcomment')) { - $words = DI::pConfig()->get(local_user(), 'qcomment', 'words'); + $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words'); $qcomment = $words ? explode("\n", $words) : []; } @@ -1484,7 +1484,7 @@ function photos_content(App $a) '$dislike' => DI::l10n()->t('Dislike'), '$wait' => DI::l10n()->t('Please wait'), '$dislike_title' => DI::l10n()->t('I don\'t like this (toggle)'), - '$hide_dislike' => DI::pConfig()->get(local_user(), 'system', 'hide_dislike'), + '$hide_dislike' => DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike'), '$responses' => $responses, '$return_path' => DI::args()->getQueryString(), ]); diff --git a/mod/redir.php b/mod/redir.php index ba1b7e13b..6243710b2 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -52,7 +52,7 @@ function redir_init(App $a) { } $fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name']; - $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]); + $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, Session::getLocalUser()]]); if (!DBA::isResult($contact)) { throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.')); } @@ -65,10 +65,10 @@ function redir_init(App $a) { $a->redirect($url ?: $contact_url); } - if ($contact['uid'] == 0 && local_user()) { + if ($contact['uid'] == 0 && Session::getLocalUser()) { // Let's have a look if there is an established connection // between the public contact we have found and the local user. - $contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]); + $contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => Session::getLocalUser()]); if (DBA::isResult($contact)) { $cid = $contact['id']; @@ -83,7 +83,7 @@ function redir_init(App $a) { } } - if (remote_user()) { + if (Session::getRemoteUser()) { $host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3); $remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1); @@ -91,7 +91,7 @@ function redir_init(App $a) { // with the local contact. Otherwise the local user would ask the local contact // for authentification everytime he/she is visiting a profile page of the local // contact. - if (($host == $remotehost) && (Session::getRemoteContactID(Session::get('visitor_visiting')) == Session::get('visitor_id'))) { + if (($host == $remotehost) && (Session::getRemoteContactID(DI::session()->get('visitor_visiting')) == DI::session()->get('visitor_id'))) { // Remote user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; diff --git a/mod/removeme.php b/mod/removeme.php index e86e56467..5555fcbb7 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\User; @@ -28,7 +29,7 @@ use Friendica\Util\Strings; function removeme_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } @@ -64,7 +65,7 @@ function removeme_post(App $a) ->withMessage( $l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'), $l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'), - $l10n->t('The user id is %d', local_user())) + $l10n->t('The user id is %d', Session::getLocalUser())) ->forUser($admin) ->withRecipient($admin['email']) ->build(); @@ -83,7 +84,7 @@ function removeme_post(App $a) function removeme_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::baseUrl()->redirect(); } diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php index bc2c8bba2..8ae294a0a 100644 --- a/mod/repair_ostatus.php +++ b/mod/repair_ostatus.php @@ -21,13 +21,14 @@ use Friendica\App; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; function repair_ostatus_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('ostatus_repair'); // NOTREACHED @@ -35,7 +36,7 @@ function repair_ostatus_content(App $a) { $o = '

' . DI::l10n()->t('Resubscribing to OStatus contacts') . '

'; - $uid = local_user(); + $uid = Session::getLocalUser(); $counter = intval($_REQUEST['counter'] ?? 0); diff --git a/mod/settings.php b/mod/settings.php index 093572f18..5f3be2767 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -26,6 +26,7 @@ use Friendica\Content\Nav; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; @@ -36,7 +37,7 @@ use Friendica\Protocol\Email; function settings_init(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return; } @@ -69,12 +70,12 @@ function settings_post(App $a) BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_connectors'); if (!empty($_POST['general-submit'])) { - DI::pConfig()->set(local_user(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer'])); - DI::pConfig()->set(local_user(), 'system', 'disable_cw', !intval($_POST['enable_cw'])); - DI::pConfig()->set(local_user(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening'])); - DI::pConfig()->set(local_user(), 'system', 'simple_shortening', intval($_POST['simple_shortening'])); - DI::pConfig()->set(local_user(), 'system', 'attach_link_title', intval($_POST['attach_link_title'])); - DI::pConfig()->set(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']); + DI::pConfig()->set(Session::getLocalUser(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer'])); + DI::pConfig()->set(Session::getLocalUser(), 'system', 'disable_cw', !intval($_POST['enable_cw'])); + DI::pConfig()->set(Session::getLocalUser(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening'])); + DI::pConfig()->set(Session::getLocalUser(), 'system', 'simple_shortening', intval($_POST['simple_shortening'])); + DI::pConfig()->set(Session::getLocalUser(), 'system', 'attach_link_title', intval($_POST['attach_link_title'])); + DI::pConfig()->set(Session::getLocalUser(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']); } elseif (!empty($_POST['mail-submit'])) { $mail_server = $_POST['mail_server'] ?? ''; $mail_port = $_POST['mail_port'] ?? ''; @@ -87,13 +88,13 @@ function settings_post(App $a) $mail_pubmail = $_POST['mail_pubmail'] ?? ''; if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) { - if (!DBA::exists('mailacct', ['uid' => local_user()])) { - DBA::insert('mailacct', ['uid' => local_user()]); + if (!DBA::exists('mailacct', ['uid' => Session::getLocalUser()])) { + DBA::insert('mailacct', ['uid' => Session::getLocalUser()]); } if (strlen($mail_pass)) { $pass = ''; openssl_public_encrypt($mail_pass, $pass, $user['pubkey']); - DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]); + DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => Session::getLocalUser()]); } $r = DBA::update('mailacct', [ @@ -106,10 +107,10 @@ function settings_post(App $a) 'mailbox' => 'INBOX', 'reply_to' => $mail_replyto, 'pubmail' => $mail_pubmail - ], ['uid' => local_user()]); + ], ['uid' => Session::getLocalUser()]); Logger::debug('updating mailaccount', ['response' => $r]); - $mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]); + $mailacct = DBA::selectFirst('mailacct', [], ['uid' => Session::getLocalUser()]); if (DBA::isResult($mailacct)) { $mb = Email::constructMailboxName($mailacct); @@ -135,7 +136,7 @@ function settings_post(App $a) BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features'); foreach ($_POST as $k => $v) { if (strpos($k, 'feature_') === 0) { - DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0)); + DI::pConfig()->set(Session::getLocalUser(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0)); } } return; @@ -147,7 +148,7 @@ function settings_content(App $a) $o = ''; Nav::setSelected('settings'); - if (!local_user()) { + if (!Session::getLocalUser()) { //DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -161,12 +162,12 @@ function settings_content(App $a) if ((DI::args()->getArgc() > 3) && (DI::args()->getArgv()[2] === 'delete')) { BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't'); - DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => local_user()]); + DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => Session::getLocalUser()]); DI::baseUrl()->redirect('settings/oauth/', true); return ''; } - $applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => local_user()]); + $applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => Session::getLocalUser()]); $tpl = Renderer::getMarkupTemplate('settings/oauth.tpl'); $o .= Renderer::replaceMacros($tpl, [ @@ -225,7 +226,7 @@ function settings_content(App $a) $arr[$fname] = []; $arr[$fname][0] = $fdata[0]; foreach (array_slice($fdata,1) as $f) { - $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(local_user(), $f[0]), $f[2]]; + $arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(Session::getLocalUser(), $f[0]), $f[2]]; } } @@ -240,12 +241,12 @@ function settings_content(App $a) } if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors')) { - $accept_only_sharer = intval(DI::pConfig()->get(local_user(), 'system', 'accept_only_sharer')); - $enable_cw = !intval(DI::pConfig()->get(local_user(), 'system', 'disable_cw')); - $enable_smart_shortening = !intval(DI::pConfig()->get(local_user(), 'system', 'no_intelligent_shortening')); - $simple_shortening = intval(DI::pConfig()->get(local_user(), 'system', 'simple_shortening')); - $attach_link_title = intval(DI::pConfig()->get(local_user(), 'system', 'attach_link_title')); - $legacy_contact = DI::pConfig()->get(local_user(), 'ostatus', 'legacy_contact'); + $accept_only_sharer = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'accept_only_sharer')); + $enable_cw = !intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'disable_cw')); + $enable_smart_shortening = !intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_intelligent_shortening')); + $simple_shortening = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'simple_shortening')); + $attach_link_title = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'attach_link_title')); + $legacy_contact = DI::pConfig()->get(Session::getLocalUser(), 'ostatus', 'legacy_contact'); if (!empty($legacy_contact)) { /// @todo Isn't it supposed to be a $a->internalRedirect() call? @@ -279,7 +280,7 @@ function settings_content(App $a) $mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1); if (!$mail_disabled) { - $mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]); + $mailacct = DBA::selectFirst('mailacct', [], ['uid' => Session::getLocalUser()]); } else { $mailacct = null; } diff --git a/mod/share.php b/mod/share.php index de0159df7..1ebce5291 100644 --- a/mod/share.php +++ b/mod/share.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; @@ -30,7 +31,7 @@ use Friendica\Model\Post; function share_init(App $a) { $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); - if (!$post_id || !local_user()) { + if (!$post_id || !Session::getLocalUser()) { System::exit(); } diff --git a/mod/suggest.php b/mod/suggest.php index adf41c0c6..207a49e88 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -22,6 +22,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -30,7 +31,7 @@ use Friendica\Network\HTTPException; function suggest_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); } @@ -39,7 +40,7 @@ function suggest_content(App $a) DI::page()['aside'] .= Widget::findPeople(); DI::page()['aside'] .= Widget::follow(); - $contacts = Contact\Relation::getSuggestions(local_user()); + $contacts = Contact\Relation::getSuggestions(Session::getLocalUser()); if (!DBA::isResult($contacts)) { return DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.'); } diff --git a/mod/tagger.php b/mod/tagger.php index b3f5f9af1..5e209ec94 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -63,13 +63,13 @@ function tagger_content(App $a) $owner_uid = $item['uid']; - if (local_user() != $owner_uid) { + if (Session::getLocalUser() != $owner_uid) { return; } - $contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]); + $contact = Contact::selectFirst([], ['self' => true, 'uid' => Session::getLocalUser()]); if (!DBA::isResult($contact)) { - Logger::warning('Self contact not found.', ['uid' => local_user()]); + Logger::warning('Self contact not found.', ['uid' => Session::getLocalUser()]); return; } diff --git a/mod/tagrm.php b/mod/tagrm.php index fdf3ef4f8..7ffa7616b 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Post; @@ -28,7 +29,7 @@ use Friendica\Model\Tag; function tagrm_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::baseUrl()->redirect($_SESSION['photo_return']); } @@ -61,7 +62,7 @@ function update_tags($item_id, $tags) return; } - $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); + $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => Session::getLocalUser()]); if (!DBA::isResult($item)) { return; } @@ -81,7 +82,7 @@ function tagrm_content(App $a) $photo_return = $_SESSION['photo_return'] ?? ''; - if (!local_user()) { + if (!Session::getLocalUser()) { DI::baseUrl()->redirect($photo_return); // NOTREACHED } @@ -97,7 +98,7 @@ function tagrm_content(App $a) // NOTREACHED } - $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); + $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => Session::getLocalUser()]); if (!DBA::isResult($item)) { DI::baseUrl()->redirect($photo_return); } diff --git a/mod/unfollow.php b/mod/unfollow.php index 61c88ee9e..ec8cd4506 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -23,6 +23,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -31,7 +32,7 @@ use Friendica\Util\Strings; function unfollow_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('login'); // NOTREACHED @@ -46,17 +47,17 @@ function unfollow_content(App $a) { $base_return_path = 'contact'; - if (!local_user()) { + if (!Session::getLocalUser()) { DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::baseUrl()->redirect('login'); // NOTREACHED } - $uid = local_user(); + $uid = Session::getLocalUser(); $url = trim($_REQUEST['url']); $condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)", - local_user(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url), + Session::getLocalUser(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url), Strings::normaliseLink($url), $url]; $contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition); @@ -118,7 +119,7 @@ function unfollow_process(string $url) { $base_return_path = 'contact'; - $uid = local_user(); + $uid = Session::getLocalUser(); $owner = User::getOwnerDataById($uid); if (!$owner) { diff --git a/mod/update_contact.php b/mod/update_contact.php index 51c7562ef..21e46b19d 100644 --- a/mod/update_contact.php +++ b/mod/update_contact.php @@ -22,6 +22,7 @@ */ use Friendica\App; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; @@ -30,7 +31,7 @@ use Friendica\Model\Contact; function update_contact_content(App $a) { - if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update'))) { + if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_auto_update'))) { $contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']); if (DBA::isResult($contact) && empty($contact['deleted'])) { DI::page()['aside'] = ''; diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 8a3ed7606..7f12d15e6 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -55,7 +55,7 @@ function wall_attach_post(App $a) { $page_owner_cid = $owner['id']; $community_page = $owner['page-flags'] == User::PAGE_FLAGS_COMMUNITY; - if (local_user() && (local_user() == $page_owner_uid)) { + if (Session::getLocalUser() && (Session::getLocalUser() == $page_owner_uid)) { $can_post = true; } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) { $contact_id = Session::getRemoteContactID($page_owner_uid); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index efea196fd..d66e2af8f 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -76,7 +76,7 @@ function wall_upload_post(App $a, $desktopmode = true) $page_owner_nick = $user['nickname']; $community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false); - if ((local_user()) && (local_user() == $page_owner_uid)) { + if ((Session::getLocalUser()) && (Session::getLocalUser() == $page_owner_uid)) { $can_post = true; } elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) { $contact_id = Session::getRemoteContactID($page_owner_uid); From 196dda948773a7076633bd2d1bdc05219fa571f2 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Oct 2022 04:49:57 +0000 Subject: [PATCH 069/641] Suppress warning on load check --- src/Core/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/System.php b/src/Core/System.php index 8a8f273a8..b2da78f1b 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -442,7 +442,7 @@ class System */ public static function getLoadAvg(): array { - if (is_readable('/proc/loadavg')) { + if (@is_readable('/proc/loadavg')) { $content = @file_get_contents('/proc/loadavg'); if (empty($content)) { $content = shell_exec('cat /proc/loadavg'); From 692566d93b265a79e1d06d612edc68e6936c9b74 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 19 Oct 2022 08:07:12 +0200 Subject: [PATCH 070/641] Fix ERROR IHandleSessions --- src/Content/Conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index ede7a56b6..caab02247 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -32,6 +32,7 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Core\Theme; use Friendica\Database\DBA; use Friendica\Model\Contact; @@ -76,10 +77,10 @@ class Conversation private $page; /** @var App\Mode */ private $mode; - /** @var Session\Capability\IHandleSessions */ + /** @var IHandleSessions */ private $session; - public function __construct(LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app, Session\Capability\IHandleSessions $session) + public function __construct(LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app, IHandleSessions $session) { $this->activity = $activity; $this->item = $item; From 11944dda3241c0a015944b6a82147ba5e5755998 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Oct 2022 05:06:28 +0000 Subject: [PATCH 071/641] old boot.php functions replaced in various places --- doc/Addons.md | 2 +- doc/Developer-Domain-Driven-Design.md | 4 +- doc/themes.md | 6 +-- .../Factory/FormattedNavNotification.php | 3 +- .../Notifications/Factory/FormattedNotify.php | 15 ++++--- .../Notifications/Factory/Introduction.php | 5 ++- src/Network/Probe.php | 3 +- src/Object/Post.php | 44 +++++++++---------- src/Object/Thread.php | 7 +-- src/Security/BasicAuth.php | 2 +- src/Security/Security.php | 6 +-- src/Util/Temporal.php | 3 +- view/theme/duepuntozero/config.php | 29 +++++++++--- view/theme/duepuntozero/theme.php | 3 +- view/theme/frio/config.php | 33 +++++++------- view/theme/frio/php/scheme.php | 3 +- view/theme/frio/theme.php | 10 ++--- view/theme/quattro/config.php | 39 +++++++++++----- view/theme/vier/config.php | 39 +++++++++++----- view/theme/vier/theme.php | 32 +++++++++++--- 20 files changed, 183 insertions(+), 105 deletions(-) diff --git a/doc/Addons.md b/doc/Addons.md index 91765ec48..b43a8a915 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -281,7 +281,7 @@ $data = [ 'submit' => [ 'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'), 'catavatar-morecat' => DI::l10n()->t('Another random Cat!'), - 'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null, + 'catavatar-emailcat' => DI::pConfig()->get(Session::getLocalUser(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null, ], ]; ``` diff --git a/doc/Developer-Domain-Driven-Design.md b/doc/Developer-Domain-Driven-Design.md index 1e77dd2f0..a4af43688 100644 --- a/doc/Developer-Domain-Driven-Design.md +++ b/doc/Developer-Domain-Driven-Design.md @@ -30,7 +30,7 @@ function doSomething(array $intros) } } -$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => local_user()]); +$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => Session::getLocalUser()]); doSomething($intros); ``` @@ -47,7 +47,7 @@ function doSomething(\Friendica\Contact\Introductions\Collection\Introductions $ } /** @var $intros \Friendica\Contact\Introductions\Collection\Introductions */ -$intros = \Friendica\DI::intro()->selecForUser(local_user()); +$intros = \Friendica\DI::intro()->selecForUser(Session::getLocalUser()); doSomething($intros); ``` diff --git a/doc/themes.md b/doc/themes.md index 7abd787e6..e578d7f74 100644 --- a/doc/themes.md +++ b/doc/themes.md @@ -123,13 +123,13 @@ The selected 1st part will be saved in the database by the theme_post function. function theme_post(App $a){ // non local users shall not pass - if (! local_user()) { + if (! Session::getLocalUser()) { return; } // if the one specific submit button was pressed then proceed if (isset($_POST['duepuntozero-settings-submit'])){ // and save the selection key into the personal config of the user - DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); + DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); } } @@ -137,7 +137,7 @@ Now that this information is set in the database, what should friendica do with For this, have a look at the theme.php file of the *duepunto zero*. There you'll find somethink alike - $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset'); + $colorset = DI::pConfig()->get( Session::getLocalUser(), 'duepuntozero','colorset'); if (!$colorset) $colorset = DI::config()->get('duepuntozero', 'colorset'); if ($colorset) { diff --git a/src/Navigation/Notifications/Factory/FormattedNavNotification.php b/src/Navigation/Notifications/Factory/FormattedNavNotification.php index dbd808ba7..8457b9256 100644 --- a/src/Navigation/Notifications/Factory/FormattedNavNotification.php +++ b/src/Navigation/Notifications/Factory/FormattedNavNotification.php @@ -23,6 +23,7 @@ namespace Friendica\Navigation\Notifications\Factory; use Friendica\BaseFactory; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Model\Contact; use Friendica\Navigation\Notifications\Entity; use Friendica\Navigation\Notifications\Exception\NoMessageException; @@ -71,7 +72,7 @@ class FormattedNavNotification extends BaseFactory */ public function createFromParams(array $contact, string $message, \DateTime $date, Uri $href, bool $seen = false): ValueObject\FormattedNavNotification { - $contact['photo'] = Contact::getAvatarUrlForUrl($contact['url'], local_user(), Proxy::SIZE_MICRO); + $contact['photo'] = Contact::getAvatarUrlForUrl($contact['url'], Session::getLocalUser(), Proxy::SIZE_MICRO); $dateMySQL = $date->format(DateTimeFormat::MYSQL); diff --git a/src/Navigation/Notifications/Factory/FormattedNotify.php b/src/Navigation/Notifications/Factory/FormattedNotify.php index 8f0fc5bb1..4868ce1b9 100644 --- a/src/Navigation/Notifications/Factory/FormattedNotify.php +++ b/src/Navigation/Notifications/Factory/FormattedNotify.php @@ -27,6 +27,7 @@ use Friendica\BaseFactory; use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\Database\Database; use Friendica\Model\Contact; use Friendica\Model\Item; @@ -210,7 +211,7 @@ class FormattedNotify extends BaseFactory $formattedNotifications = new FormattedNotifies(); try { - $Notifies = $this->notify->selectForUser(local_user(), $conditions, $params); + $Notifies = $this->notify->selectForUser(Session::getLocalUser(), $conditions, $params); foreach ($Notifies as $Notify) { $formattedNotifications[] = new ValueObject\FormattedNotify( @@ -243,7 +244,7 @@ class FormattedNotify extends BaseFactory */ public function getNetworkList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies { - $condition = ['wall' => false, 'uid' => local_user()]; + $condition = ['wall' => false, 'uid' => Session::getLocalUser()]; if (!$seen) { $condition['unseen'] = true; @@ -256,7 +257,7 @@ class FormattedNotify extends BaseFactory $formattedNotifications = new FormattedNotifies(); try { - $userPosts = Post::selectForUser(local_user(), $fields, $condition, $params); + $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params); while ($userPost = $this->dba->fetch($userPosts)) { $formattedNotifications[] = $this->createFromFormattedItem($this->formatItem($userPost)); } @@ -279,7 +280,7 @@ class FormattedNotify extends BaseFactory */ public function getPersonalList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies { - $condition = ['wall' => false, 'uid' => local_user(), 'author-id' => public_contact()]; + $condition = ['wall' => false, 'uid' => Session::getLocalUser(), 'author-id' => Session::getPublicContact()]; if (!$seen) { $condition['unseen'] = true; @@ -292,7 +293,7 @@ class FormattedNotify extends BaseFactory $formattedNotifications = new FormattedNotifies(); try { - $userPosts = Post::selectForUser(local_user(), $fields, $condition, $params); + $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params); while ($userPost = $this->dba->fetch($userPosts)) { $formattedNotifications[] = $this->createFromFormattedItem($this->formatItem($userPost)); } @@ -315,7 +316,7 @@ class FormattedNotify extends BaseFactory */ public function getHomeList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT): FormattedNotifies { - $condition = ['wall' => true, 'uid' => local_user()]; + $condition = ['wall' => true, 'uid' => Session::getLocalUser()]; if (!$seen) { $condition['unseen'] = true; @@ -328,7 +329,7 @@ class FormattedNotify extends BaseFactory $formattedNotifications = new FormattedNotifies(); try { - $userPosts = Post::selectForUser(local_user(), $fields, $condition, $params); + $userPosts = Post::selectForUser(Session::getLocalUser(), $fields, $condition, $params); while ($userPost = $this->dba->fetch($userPosts)) { $formattedItem = $this->formatItem($userPost); diff --git a/src/Navigation/Notifications/Factory/Introduction.php b/src/Navigation/Notifications/Factory/Introduction.php index cfadce5a8..1b718ad1a 100644 --- a/src/Navigation/Notifications/Factory/Introduction.php +++ b/src/Navigation/Notifications/Factory/Introduction.php @@ -29,6 +29,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Database\Database; use Friendica\Model\Contact; @@ -142,7 +143,7 @@ class Introduction extends BaseFactory 'url' => $intro['furl'], 'zrl' => Contact::magicLink($intro['furl']), 'hidden' => $intro['hidden'] == 1, - 'post_newfriend' => (intval($this->pConfig->get(local_user(), 'system', 'post_newfriend')) ? '1' : 0), + 'post_newfriend' => (intval($this->pConfig->get(Session::getLocalUser(), 'system', 'post_newfriend')) ? '1' : 0), 'note' => $intro['note'], 'request' => $intro['frequest'] . '?addr=' . $return_addr]); @@ -167,7 +168,7 @@ class Introduction extends BaseFactory 'about' => BBCode::convert($intro['about'], false), 'keywords' => $intro['keywords'], 'hidden' => $intro['hidden'] == 1, - 'post_newfriend' => (intval($this->pConfig->get(local_user(), 'system', 'post_newfriend')) ? '1' : 0), + 'post_newfriend' => (intval($this->pConfig->get(Session::getLocalUser(), 'system', 'post_newfriend')) ? '1' : 0), 'url' => $intro['url'], 'zrl' => Contact::magicLink($intro['url']), 'addr' => $intro['addr'], diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 98d195ca1..4261ad84e 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -27,6 +27,7 @@ use Exception; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; @@ -316,7 +317,7 @@ class Probe } if ($uid == -1) { - $uid = local_user(); + $uid = Session::getLocalUser(); } if (empty($network) || ($network == Protocol::ACTIVITYPUB)) { diff --git a/src/Object/Post.php b/src/Object/Post.php index bbce29672..a86539f1d 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -104,14 +104,14 @@ class Post if (!empty($data['children'])) { foreach ($data['children'] as $item) { // Only add will be displayed - if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) { + if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) { continue; } elseif (!DI::contentItem()->isVisibleActivity($item)) { continue; } // You can always comment on Diaspora and OStatus items - if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (local_user() == $item['uid'])) { + if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (Session::getLocalUser() == $item['uid'])) { $item['writable'] = true; } @@ -206,7 +206,7 @@ class Post $lock = ($item['private'] == Item::PRIVATE) ? $privacy : false; $connector = !in_array($item['network'], Protocol::NATIVE_SUPPORT) ? DI::l10n()->t('Connector Message') : false; - $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE; + $shareable = in_array($conv->getProfileOwner(), [0, Session::getLocalUser()]) && $item['private'] != Item::PRIVATE; $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]); // On Diaspora only toplevel posts can be reshared @@ -216,7 +216,7 @@ class Post $edpost = false; - if (local_user()) { + if (Session::getLocalUser()) { if (Strings::compareLink(DI::session()->get('my_url'), $item['author-link'])) { if ($item['event-id'] != 0) { $edpost = ['events/event/' . $item['event-id'], DI::l10n()->t('Edit')]; @@ -224,7 +224,7 @@ class Post $edpost = ['editpost/' . $item['id'], DI::l10n()->t('Edit')]; } } - $dropping = in_array($item['uid'], [0, local_user()]); + $dropping = in_array($item['uid'], [0, Session::getLocalUser()]); } // Editing on items of not subscribed users isn't currently possible @@ -234,7 +234,7 @@ class Post $edpost = false; } - if (($this->getDataValue('uid') == local_user()) || $this->isVisiting()) { + if (($this->getDataValue('uid') == Session::getLocalUser()) || $this->isVisiting()) { $dropping = true; } @@ -249,7 +249,7 @@ class Post $drop = false; $block = false; - if (local_user()) { + if (Session::getLocalUser()) { $drop = [ 'dropping' => $dropping, 'pagedrop' => $item['pagedrop'], @@ -258,7 +258,7 @@ class Post ]; } - if (!$item['self'] && local_user()) { + if (!$item['self'] && Session::getLocalUser()) { $block = [ 'blocking' => true, 'block' => DI::l10n()->t('Block %s', $item['author-name']), @@ -266,7 +266,7 @@ class Post ]; } - $filer = local_user() ? DI::l10n()->t('Save to folder') : false; + $filer = Session::getLocalUser() ? DI::l10n()->t('Save to folder') : false; $profile_name = $item['author-name']; if (!empty($item['author-link']) && empty($item['author-name'])) { @@ -327,8 +327,8 @@ class Post $tagger = ''; if ($this->isToplevel()) { - if (local_user()) { - $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], local_user()); + if (Session::getLocalUser()) { + $ignored = PostModel\ThreadUser::getIgnored($item['uri-id'], Session::getLocalUser()); if ($item['mention'] || $ignored) { $ignore = [ 'do' => DI::l10n()->t('Ignore thread'), @@ -351,7 +351,7 @@ class Post 'starred' => DI::l10n()->t('Starred'), ]; - if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) { + if ($conv->getProfileOwner() == Session::getLocalUser() && ($item['uid'] != 0)) { if ($origin && in_array($item['private'], [Item::PUBLIC, Item::UNLISTED])) { $ispinned = ($item['featured'] ? 'pinned' : 'unpinned'); @@ -397,17 +397,17 @@ class Post $body_html = Item::prepareBody($item, true); - list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user()); + list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, Session::getLocalUser()); if (!empty($item['title'])) { $title = $item['title']; - } elseif (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { + } elseif (!empty($item['content-warning']) && DI::pConfig()->get(Session::getLocalUser(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); } else { $title = ''; } - if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) { + if (DI::pConfig()->get(Session::getLocalUser(), 'system', 'hide_dislike')) { $buttons['dislike'] = false; } @@ -434,7 +434,7 @@ class Post } // Fetching of Diaspora posts doesn't always work. There are issues with reshares and possibly comments - if (!local_user() && ($item['network'] != Protocol::DIASPORA) && !empty(DI::session()->get('remote_comment'))) { + if (!Session::getLocalUser() && ($item['network'] != Protocol::DIASPORA) && !empty(DI::session()->get('remote_comment'))) { $remote_comment = [DI::l10n()->t('Comment this item on your system'), DI::l10n()->t('Remote comment'), str_replace('{uri}', urlencode($item['uri']), DI::session()->get('remote_comment'))]; @@ -642,7 +642,7 @@ class Post /* * Only add what will be displayed */ - if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) { + if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) { return false; } elseif ($activity->match($item->getDataValue('verb'), Activity::LIKE) || $activity->match($item->getDataValue('verb'), Activity::DISLIKE)) { @@ -850,7 +850,7 @@ class Post // This will allow us to comment on wall-to-wall items owned by our friends // and community forums even if somebody else wrote the post. // bug #517 - this fixes for conversation owner - if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == local_user()) { + if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == Session::getLocalUser()) { return true; } @@ -898,20 +898,20 @@ class Post { $a = DI::app(); - if (!local_user()) { + if (!Session::getLocalUser()) { return ''; } $owner = User::getOwnerDataById($a->getLoggedInUserId()); $item = $this->getData(); - if (!empty($item['content-warning']) && Feature::isEnabled(local_user(), 'add_abstract')) { + if (!empty($item['content-warning']) && Feature::isEnabled(Session::getLocalUser(), 'add_abstract')) { $text = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $item['content-warning'] . "[/abstract]\n"; } else { $text = ''; } - if (!Feature::isEnabled(local_user(), 'explicit_mentions')) { + if (!Feature::isEnabled(Session::getLocalUser(), 'explicit_mentions')) { return $text; } @@ -958,7 +958,7 @@ class Post */ $qcomment = null; if (Addon::isEnabled('qcomment')) { - $words = DI::pConfig()->get(local_user(), 'qcomment', 'words'); + $words = DI::pConfig()->get(Session::getLocalUser(), 'qcomment', 'words'); $qcomment = $words ? explode("\n", $words) : []; } diff --git a/src/Object/Thread.php b/src/Object/Thread.php index dd10a6aec..a62874900 100644 --- a/src/Object/Thread.php +++ b/src/Object/Thread.php @@ -23,6 +23,7 @@ namespace Friendica\Object; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\DI; use Friendica\Protocol\Activity; use Friendica\Security\Security; @@ -75,7 +76,7 @@ class Thread switch ($mode) { case 'network': case 'notes': - $this->profile_owner = local_user(); + $this->profile_owner = Session::getLocalUser(); $this->writable = true; break; case 'profile': @@ -168,7 +169,7 @@ class Thread /* * Only add will be displayed */ - if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) { + if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) { Logger::info('[WARN] Conversation::addThread : Thread is a mail ('. $item->getId() .').'); return false; } @@ -201,7 +202,7 @@ class Thread $result = []; foreach ($this->parents as $item) { - if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) { + if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) { continue; } diff --git a/src/Security/BasicAuth.php b/src/Security/BasicAuth.php index fc31d34b0..257e52d46 100644 --- a/src/Security/BasicAuth.php +++ b/src/Security/BasicAuth.php @@ -191,7 +191,7 @@ class BasicAuth Hook::callAll('logged_in', $record); - self::$current_user_id = local_user(); + self::$current_user_id = Session::getLocalUser(); return self::$current_user_id; } diff --git a/src/Security/Security.php b/src/Security/Security.php index 5fda54d46..f0b33501f 100644 --- a/src/Security/Security.php +++ b/src/Security/Security.php @@ -40,12 +40,12 @@ class Security return false; } - $uid = local_user(); + $uid = Session::getLocalUser(); if ($uid == $owner) { return true; } - if (local_user() && ($owner == 0)) { + if (Session::getLocalUser() && ($owner == 0)) { return true; } @@ -93,7 +93,7 @@ class Security */ public static function getPermissionsSQLByUserId(int $owner_id, bool $accessible = false) { - $local_user = local_user(); + $local_user = Session::getLocalUser(); $remote_contact = Session::getRemoteContactID($owner_id); $acc_sql = ''; diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index cc6a078fe..72271c06f 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -24,6 +24,7 @@ namespace Friendica\Util; use DateTime; use DateTimeZone; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; @@ -238,7 +239,7 @@ class Temporal bool $required = false): string { // First day of the week (0 = Sunday) - $firstDay = DI::pConfig()->get(local_user(), 'system', 'first_day_of_week', 0); + $firstDay = DI::pConfig()->get(Session::getLocalUser(), 'system', 'first_day_of_week', 0); $lang = substr(DI::l10n()->getCurrentLang(), 0, 2); diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index 7d2c3f425..1a2d231f4 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -1,19 +1,36 @@ . + * */ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; function theme_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } - $colorset = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset'); + $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset'); $user = true; return clean_form($a, $colorset, $user); @@ -21,12 +38,12 @@ function theme_content(App $a) function theme_post(App $a) { - if (! local_user()) { + if (! Session::getLocalUser()) { return; } if (isset($_POST['duepuntozero-settings-submit'])) { - DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); + DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); } } @@ -59,7 +76,7 @@ function clean_form(App $a, &$colorset, $user) ]; if ($user) { - $color = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset'); + $color = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset'); } else { $color = DI::config()->get('duepuntozero', 'colorset'); } diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php index 327a1e73b..70190eb02 100644 --- a/view/theme/duepuntozero/theme.php +++ b/view/theme/duepuntozero/theme.php @@ -21,6 +21,7 @@ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; /* @@ -34,7 +35,7 @@ function duepuntozero_init(App $a) { $colorset = null; if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { - $colorset = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset'); + $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset'); if (!$colorset) $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings } diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 2dcf00204..4c7a13542 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -21,13 +21,14 @@ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; require_once 'view/theme/frio/php/Image.php'; function theme_post(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } @@ -47,12 +48,12 @@ function theme_post(App $a) 'always_open_compose', ] as $field) { if (isset($_POST['frio_' . $field])) { - DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]); + DI::pConfig()->set(Session::getLocalUser(), 'frio', $field, $_POST['frio_' . $field]); } } - DI::pConfig()->set(local_user(), 'frio', 'css_modified', time()); + DI::pConfig()->set(Session::getLocalUser(), 'frio', 'css_modified', time()); } } @@ -88,13 +89,13 @@ function theme_admin_post(App $a) function theme_content(): string { - if (!local_user()) { + if (!Session::getLocalUser()) { return ''; } $arr = [ - 'scheme' => DI::pConfig()->get(local_user(), 'frio', 'scheme', - DI::pConfig()->get(local_user(), 'frio', 'schema', + 'scheme' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme', + DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema', DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema') ) @@ -102,15 +103,15 @@ function theme_content(): string ), 'share_string' => '', - 'scheme_accent' => DI::pConfig()->get(local_user(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')), - 'nav_bg' => DI::pConfig()->get(local_user(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')), - 'nav_icon_color' => DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')), - 'link_color' => DI::pConfig()->get(local_user(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')), - 'background_color' => DI::pConfig()->get(local_user(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')), - 'contentbg_transp' => DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')), - 'background_image' => DI::pConfig()->get(local_user(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')), - 'bg_image_option' => DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')), - 'always_open_compose' => DI::pConfig()->get(local_user(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)), + 'scheme_accent' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')), + 'nav_bg' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')), + 'nav_icon_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')), + 'link_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')), + 'background_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')), + 'contentbg_transp' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')), + 'background_image' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')), + 'bg_image_option' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')), + 'always_open_compose' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)), ]; return frio_form($arr); @@ -118,7 +119,7 @@ function theme_content(): string function theme_admin(): string { - if (!local_user()) { + if (!Session::getLocalUser()) { return ''; } diff --git a/view/theme/frio/php/scheme.php b/view/theme/frio/php/scheme.php index 994f2eb14..26c358877 100644 --- a/view/theme/frio/php/scheme.php +++ b/view/theme/frio/php/scheme.php @@ -34,6 +34,7 @@ * 'overwrites' => Variables which overwriting custom settings */ +use Friendica\Core\Session; use Friendica\DI; use Friendica\Util\Strings; @@ -42,7 +43,7 @@ function get_scheme_info($scheme) $theme = DI::app()->getCurrentTheme(); $themepath = 'view/theme/' . $theme . '/'; if (empty($scheme)) { - $scheme = DI::pConfig()->get(local_user(), 'frio', 'scheme', DI::pConfig()->get(local_user(), 'frio', 'schema', '---')); + $scheme = DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme', DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema', '---')); } $scheme = Strings::sanitizeFilePathItem($scheme); diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 2913a1553..ce1e376e6 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -215,8 +215,8 @@ function frio_remote_nav(App $a, array &$nav_info) $fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated']; if ($a->isLoggedIn()) { $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]); - } elseif (!local_user() && remote_user()) { - $remoteUser = Contact::getById(remote_user(), $fields); + } elseif (!Session::getLocalUser() && Session::getRemoteUser()) { + $remoteUser = Contact::getById(Session::getRemoteUser(), $fields); $nav_info['nav']['remote'] = DI::l10n()->t('Guest'); } elseif (Profile::getMyURL()) { $remoteUser = Contact::getByURL($homelink, null, $fields); @@ -233,7 +233,7 @@ function frio_remote_nav(App $a, array &$nav_info) $server_url = $remoteUser['baseurl']; } - if (!local_user() && !empty($server_url) && !is_null($remoteUser)) { + if (!Session::getLocalUser() && !empty($server_url) && !is_null($remoteUser)) { // user menu $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')]; $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')]; @@ -257,8 +257,8 @@ function frio_display_item(App $a, &$arr) // Add follow to the item menu $followThread = []; if ( - local_user() - && in_array($arr['item']['uid'], [0, local_user()]) + Session::getLocalUser() + && in_array($arr['item']['uid'], [0, Session::getLocalUser()]) && $arr['item']['gravity'] == Item::GRAVITY_PARENT && !$arr['item']['self'] && !$arr['item']['mention'] diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 64284eaa0..48ef298f9 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -1,35 +1,52 @@ . + * */ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; function theme_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } - $align = DI::pConfig()->get(local_user(), 'quattro', 'align' ); - $color = DI::pConfig()->get(local_user(), 'quattro', 'color' ); - $tfs = DI::pConfig()->get(local_user(),"quattro","tfs"); - $pfs = DI::pConfig()->get(local_user(),"quattro","pfs"); + $align = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'align' ); + $color = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'color' ); + $tfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","tfs"); + $pfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","pfs"); return quattro_form($a,$align, $color, $tfs, $pfs); } function theme_post(App $a) { - if (! local_user()) { + if (! Session::getLocalUser()) { return; } if (isset($_POST['quattro-settings-submit'])){ - DI::pConfig()->set(local_user(), 'quattro', 'align', $_POST['quattro_align']); - DI::pConfig()->set(local_user(), 'quattro', 'color', $_POST['quattro_color']); - DI::pConfig()->set(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']); - DI::pConfig()->set(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']); + DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'align', $_POST['quattro_align']); + DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'color', $_POST['quattro_color']); + DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'tfs', $_POST['quattro_tfs']); + DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'pfs', $_POST['quattro_pfs']); } } diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index 5891aa32f..28aebf970 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -1,17 +1,34 @@ . + * */ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\DI; require_once __DIR__ . '/theme.php'; function theme_content(App $a) { - if (!local_user()) { + if (!Session::getLocalUser()) { return; } @@ -19,7 +36,7 @@ function theme_content(App $a) return; } - $style = DI::pConfig()->get(local_user(), 'vier', 'style'); + $style = DI::pConfig()->get(Session::getLocalUser(), 'vier', 'style'); if ($style == "") { $style = DI::config()->get('vier', 'style'); @@ -42,18 +59,18 @@ function theme_content(App $a) function theme_post(App $a) { - if (! local_user()) { + if (! Session::getLocalUser()) { return; } if (isset($_POST['vier-settings-submit'])) { - DI::pConfig()->set(local_user(), 'vier', 'style', $_POST['vier_style']); - DI::pConfig()->set(local_user(), 'vier', 'show_pages', $_POST['vier_show_pages']); - DI::pConfig()->set(local_user(), 'vier', 'show_profiles', $_POST['vier_show_profiles']); - DI::pConfig()->set(local_user(), 'vier', 'show_helpers', $_POST['vier_show_helpers']); - DI::pConfig()->set(local_user(), 'vier', 'show_services', $_POST['vier_show_services']); - DI::pConfig()->set(local_user(), 'vier', 'show_friends', $_POST['vier_show_friends']); - DI::pConfig()->set(local_user(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'style', $_POST['vier_style']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_pages', $_POST['vier_show_pages']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_profiles', $_POST['vier_show_profiles']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_helpers', $_POST['vier_show_helpers']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_services', $_POST['vier_show_services']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_friends', $_POST['vier_show_friends']); + DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']); } } diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index a548d0a7d..ec82cf428 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -1,5 +1,22 @@ . + * * Name: Vier * Version: 1.2 * Author: Fabio @@ -14,6 +31,7 @@ use Friendica\Content\ForumManager; use Friendica\Core\Addon; use Friendica\Core\Renderer; use Friendica\Core\Search; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -35,7 +53,7 @@ function vier_init(App $a) DI::mode()->has(App\Mode::MAINTENANCEDISABLED) && ( $args->get(0) === 'profile' && $args->get(1) === ($a->getLoggedInUserNickname() ?? '') - || $args->get(0) === 'network' && local_user() + || $args->get(0) === 'network' && Session::getLocalUser() ) ) { vier_community_info(); @@ -97,8 +115,8 @@ EOT; function get_vier_config($key, $default = false, $admin = false) { - if (local_user() && !$admin) { - $result = DI::pConfig()->get(local_user(), "vier", $key); + if (Session::getLocalUser() && !$admin) { + $result = DI::pConfig()->get(Session::getLocalUser(), "vier", $key); if (!is_null($result)) { return $result; } @@ -127,7 +145,7 @@ function vier_community_info() // comunity_profiles if ($show_profiles) { - $contacts = Contact\Relation::getSuggestions(local_user(), 0, 9); + $contacts = Contact\Relation::getSuggestions(Session::getLocalUser(), 0, 9); $tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl'); if (DBA::isResult($contacts)) { @@ -174,7 +192,7 @@ function vier_community_info() } //right_aside FIND FRIENDS - if ($show_friends && local_user()) { + if ($show_friends && Session::getLocalUser()) { $nv = []; $nv['findpeople'] = DI::l10n()->t('Find People'); $nv['desc'] = DI::l10n()->t('Enter name or interest'); @@ -193,8 +211,8 @@ function vier_community_info() } //Community_Pages at right_aside - if ($show_pages && local_user()) { - $aside['$page'] = ForumManager::widget('network/forum', local_user());; + if ($show_pages && Session::getLocalUser()) { + $aside['$page'] = ForumManager::widget('network/forum', Session::getLocalUser());; } // END Community Page From 429b2e09926dd67076b16e769bf6d3ad13083fc0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 19 Oct 2022 07:50:28 -0400 Subject: [PATCH 072/641] Apply code standards in documentation --- doc/themes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/themes.md b/doc/themes.md index e578d7f74..60f4fdb96 100644 --- a/doc/themes.md +++ b/doc/themes.md @@ -123,7 +123,7 @@ The selected 1st part will be saved in the database by the theme_post function. function theme_post(App $a){ // non local users shall not pass - if (! Session::getLocalUser()) { + if (!Session::getLocalUser()) { return; } // if the one specific submit button was pressed then proceed @@ -137,7 +137,7 @@ Now that this information is set in the database, what should friendica do with For this, have a look at the theme.php file of the *duepunto zero*. There you'll find somethink alike - $colorset = DI::pConfig()->get( Session::getLocalUser(), 'duepuntozero','colorset'); + $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero','colorset'); if (!$colorset) $colorset = DI::config()->get('duepuntozero', 'colorset'); if ($colorset) { From ee1acba9eba1f8bc00c3252cdf9f13096219b2d8 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Oct 2022 04:26:41 +0000 Subject: [PATCH 073/641] old boot.php functions replaced in /src --- src/App.php | 15 ++++++----- src/App/Page.php | 5 ++-- src/App/Router.php | 3 ++- src/Content/Conversation.php | 38 ++++++++++++++-------------- src/Content/ForumManager.php | 3 ++- src/Content/Item.php | 15 ++++++----- src/Content/Nav.php | 16 ++++++------ src/Content/Smilies.php | 3 ++- src/Content/Widget.php | 21 +++++++-------- src/Content/Widget/SavedSearches.php | 3 ++- src/Content/Widget/VCard.php | 5 ++-- src/Core/ACL.php | 2 +- src/Core/Search.php | 4 +-- src/Model/Contact.php | 28 ++++++++++---------- src/Model/Contact/Group.php | 3 ++- src/Model/Event.php | 7 ++--- src/Model/Group.php | 9 ++++--- src/Model/Item.php | 12 ++++----- src/Model/Mail.php | 15 ++++++----- src/Model/Photo.php | 10 ++++---- src/Model/Post.php | 3 ++- src/Model/Profile.php | 26 +++++++++---------- 22 files changed, 130 insertions(+), 116 deletions(-) diff --git a/src/App.php b/src/App.php index 95b0716e2..081767cfd 100644 --- a/src/App.php +++ b/src/App.php @@ -33,6 +33,7 @@ use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\L10n; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Database\Database; @@ -157,7 +158,7 @@ class App public function isLoggedIn(): bool { - return local_user() && $this->user_id && ($this->user_id == local_user()); + return Session::getLocalUser() && $this->user_id && ($this->user_id == Session::getLocalUser()); } /** @@ -171,7 +172,7 @@ class App $adminlist = explode(',', str_replace(' ', '', $admin_email)); - return local_user() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]); + return Session::getLocalUser() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]); } /** @@ -495,11 +496,11 @@ class App $page_theme = null; // Find the theme that belongs to the user whose stuff we are looking at - if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) { + if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) { // Allow folks to override user themes and always use their own on their own site. // This works only if the user is on the same server $user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]); - if ($this->database->isResult($user) && !local_user()) { + if ($this->database->isResult($user) && !Session::getLocalUser()) { $page_theme = $user['theme']; } } @@ -528,10 +529,10 @@ class App $page_mobile_theme = null; // Find the theme that belongs to the user whose stuff we are looking at - if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) { + if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) { // Allow folks to override user themes and always use their own on their own site. // This works only if the user is on the same server - if (!local_user()) { + if (!Session::getLocalUser()) { $page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme'); } } @@ -628,7 +629,7 @@ class App } // ZRL - if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !local_user()) { + if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !Session::getLocalUser()) { // Only continue when the given profile link seems valid // Valid profile links contain a path with "/profile/" and no query parameters if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') && diff --git a/src/App/Page.php b/src/App/Page.php index dcd2e8832..d1aa17ad0 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -32,6 +32,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Module\Response; @@ -231,7 +232,7 @@ class Page implements ArrayAccess */ private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig) { - $interval = ((local_user()) ? $pConfig->get(local_user(), 'system', 'update_interval') : 40000); + $interval = ((Session::getLocalUser()) ? $pConfig->get(Session::getLocalUser(), 'system', 'update_interval') : 40000); // If the update is 'deactivated' set it to the highest integer number (~24 days) if ($interval < 0) { @@ -276,7 +277,7 @@ class Page implements ArrayAccess * being first */ $this->page['htmlhead'] = Renderer::replaceMacros($tpl, [ - '$local_user' => local_user(), + '$local_user' => Session::getLocalUser(), '$generator' => 'Friendica' . ' ' . App::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.'), diff --git a/src/App/Router.php b/src/App/Router.php index a4fe4f941..356279e49 100644 --- a/src/App/Router.php +++ b/src/App/Router.php @@ -34,6 +34,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Lock\Capability\ICanLock; +use Friendica\Core\Session; use Friendica\LegacyModule; use Friendica\Module\HTTPException\MethodNotAllowed; use Friendica\Module\HTTPException\PageNotFound; @@ -308,7 +309,7 @@ class Router if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) { //Check if module is an app and if public access to apps is allowed or not $privateapps = $this->config->get('config', 'private_addons', false); - if ((!local_user()) && Hook::isAddonApp($moduleName) && $privateapps) { + if (!Session::getLocalUser() && Hook::isAddonApp($moduleName) && $privateapps) { throw new MethodNotAllowedException($this->l10n->t("You must be logged in to use addons. ")); } else { include_once "addon/{$moduleName}/{$moduleName}.php"; diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index caab02247..c727ea2fa 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -171,7 +171,7 @@ class Conversation continue; } - if (public_contact() == $activity['author-id']) { + if (Session::getPublicContact() == $activity['author-id']) { $conv_responses[$mode][$activity['thr-parent-id']]['self'] = 1; } @@ -296,7 +296,7 @@ class Conversation $x['bang'] = $x['bang'] ?? ''; $x['visitor'] = $x['visitor'] ?? 'block'; $x['is_owner'] = $x['is_owner'] ?? true; - $x['profile_uid'] = $x['profile_uid'] ?? local_user(); + $x['profile_uid'] = $x['profile_uid'] ?? Session::getLocalUser(); $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : ''; @@ -359,7 +359,7 @@ class Conversation '$title' => $x['title'] ?? '', '$placeholdertitle' => $this->l10n->t('Set title'), '$category' => $x['category'] ?? '', - '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? $this->l10n->t("Categories \x28comma-separated list\x29") : '', + '$placeholdercategory' => Feature::isEnabled(Session::getLocalUser(), 'categories') ? $this->l10n->t("Categories \x28comma-separated list\x29") : '', '$scheduled_at' => Temporal::getDateTimeField( new \DateTime(), new \DateTime('now + 6 months'), @@ -397,7 +397,7 @@ class Conversation '$browser' => $this->l10n->t('Browser'), '$compose_link_title' => $this->l10n->t('Open Compose page'), - '$always_open_compose' => $this->pConfig->get(local_user(), 'frio', 'always_open_compose', false), + '$always_open_compose' => $this->pConfig->get(Session::getLocalUser(), 'frio', 'always_open_compose', false), ]); @@ -436,7 +436,7 @@ class Conversation $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css')); $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css')); - $ssl_state = (local_user() ? true : false); + $ssl_state = (Session::getLocalUser() ? true : false); $live_update_div = ''; @@ -488,11 +488,11 @@ class Conversation } } } elseif ($mode === 'notes') { - $items = $this->addChildren($items, false, $order, local_user(), $mode); + $items = $this->addChildren($items, false, $order, Session::getLocalUser(), $mode); if (!$update) { $live_update_div = '
' . "\r\n" - . "\r\n"; } } elseif ($mode === 'display') { @@ -526,7 +526,7 @@ class Conversation $live_update_div = '' . "\r\n"; } - $page_dropping = ((local_user() && local_user() == $uid) ? true : false); + $page_dropping = ((Session::getLocalUser() && Session::getLocalUser() == $uid) ? true : false); if (!$update) { $_SESSION['return_path'] = $this->args->getQueryString(); @@ -546,7 +546,7 @@ class Conversation 'announce' => [], ]; - if ($this->pConfig->get(local_user(), 'system', 'hide_dislike')) { + if ($this->pConfig->get(Session::getLocalUser(), 'system', 'hide_dislike')) { unset($conv_responses['dislike']); } @@ -564,7 +564,7 @@ class Conversation $writable = $items[0]['writable'] || ($items[0]['uid'] == 0) && in_array($items[0]['network'], Protocol::FEDERATED); } - if (!local_user()) { + if (!Session::getLocalUser()) { $writable = false; } @@ -597,7 +597,7 @@ class Conversation $threadsid++; // prevent private email from leaking. - if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) { + if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) { continue; } @@ -641,17 +641,17 @@ class Conversation 'announce' => null, ]; - if ($this->pConfig->get(local_user(), 'system', 'hide_dislike')) { + if ($this->pConfig->get(Session::getLocalUser(), 'system', 'hide_dislike')) { unset($likebuttons['dislike']); } $body_html = ItemModel::prepareBody($item, true, $preview); - [$categories, $folders] = $this->item->determineCategoriesTerms($item, local_user()); + [$categories, $folders] = $this->item->determineCategoriesTerms($item, Session::getLocalUser()); if (!empty($item['title'])) { $title = $item['title']; - } elseif (!empty($item['content-warning']) && $this->pConfig->get(local_user(), 'system', 'disable_cw', false)) { + } elseif (!empty($item['content-warning']) && $this->pConfig->get(Session::getLocalUser(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); } else { $title = ''; @@ -745,7 +745,7 @@ class Conversation $this->builtinActivityPuller($item, $conv_responses); // Only add what is visible - if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) { + if ($item['network'] === Protocol::MAIL && Session::getLocalUser() != $item['uid']) { continue; } @@ -790,11 +790,11 @@ class Conversation private function getBlocklist(): array { - if (!local_user()) { + if (!Session::getLocalUser()) { return []; } - $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get(local_user(), 'system', 'blocked')); + $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get(Session::getLocalUser(), 'system', 'blocked')); if (empty($str_blocked)) { return []; } @@ -864,7 +864,7 @@ class Conversation $row['direction'] = ['direction' => 4, 'title' => $this->l10n->t('You subscribed to one or more tags in this post.')]; break; case ItemModel::PR_ANNOUNCEMENT: - if (!empty($row['causer-id']) && $this->pConfig->get(local_user(), 'system', 'display_resharer')) { + if (!empty($row['causer-id']) && $this->pConfig->get(Session::getLocalUser(), 'system', 'display_resharer')) { $row['owner-id'] = $row['causer-id']; $row['owner-link'] = $row['causer-link']; $row['owner-avatar'] = $row['causer-avatar']; @@ -1216,7 +1216,7 @@ class Conversation $parents[$i]['children'] = $this->sortItemChildren($parents[$i]['children']); } - if (!$this->pConfig->get(local_user(), 'system', 'no_smart_threading', 0)) { + if (!$this->pConfig->get(Session::getLocalUser(), 'system', 'no_smart_threading', 0)) { foreach ($parents as $i => $parent) { $parents[$i] = $this->smartFlattenConversation($parent); } diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php index 51abaa49d..f5e776147 100644 --- a/src/Content/ForumManager.php +++ b/src/Content/ForumManager.php @@ -24,6 +24,7 @@ namespace Friendica\Content; use Friendica\Content\Text\HTML; use Friendica\Core\Protocol; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -223,7 +224,7 @@ class ForumManager AND NOT `contact`.`pending` AND NOT `contact`.`archive` AND `contact`.`uid` = ? GROUP BY `contact`.`id`", - local_user(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY, local_user() + Session::getLocalUser(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY, Session::getLocalUser() ); return DBA::toArray($stmtContacts); diff --git a/src/Content/Item.php b/src/Content/Item.php index b363ad982..521c01546 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -27,6 +27,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; +use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\Contact; @@ -109,7 +110,7 @@ class Item $categories[] = [ 'name' => $savedFolderName, 'url' => $url, - 'removeurl' => local_user() == $uid ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : '', + 'removeurl' => Session::getLocalUser() == $uid ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : '', 'first' => $first, 'last' => false ]; @@ -120,12 +121,12 @@ class Item $categories[count($categories) - 1]['last'] = true; } - if (local_user() == $uid) { + if (Session::getLocalUser() == $uid) { foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid, Post\Category::FILE) as $savedFolderName) { $folders[] = [ 'name' => $savedFolderName, 'url' => "#", - 'removeurl' => local_user() == $uid ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : '', + 'removeurl' => Session::getLocalUser() == $uid ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : '', 'first' => $first, 'last' => false ]; @@ -331,7 +332,7 @@ class Item $sub_link = $contact_url = $pm_url = $status_link = ''; $photos_link = $posts_link = $block_link = $ignore_link = ''; - if (local_user() && local_user() == $item['uid'] && $item['gravity'] == ItemModel::GRAVITY_PARENT && !$item['self'] && !$item['mention']) { + if (Session::getLocalUser() && Session::getLocalUser() == $item['uid'] && $item['gravity'] == ItemModel::GRAVITY_PARENT && !$item['self'] && !$item['mention']) { $sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;'; } @@ -348,7 +349,7 @@ class Item $pcid = $item['author-id']; $network = ''; $rel = 0; - $condition = ['uid' => local_user(), 'uri-id' => $item['author-uri-id']]; + $condition = ['uid' => Session::getLocalUser(), 'uri-id' => $item['author-uri-id']]; $contact = DBA::selectFirst('contact', ['id', 'network', 'rel'], $condition); if (DBA::isResult($contact)) { $cid = $contact['id']; @@ -378,7 +379,7 @@ class Item } } - if (local_user()) { + if (Session::getLocalUser()) { $menu = [ $this->l10n->t('Follow Thread') => $sub_link, $this->l10n->t('View Status') => $status_link, @@ -439,7 +440,7 @@ class Item return (!($this->activity->match($item['verb'], Activity::FOLLOW) && $item['object-type'] === Activity\ObjectType::NOTE && empty($item['self']) && - $item['uid'] == local_user()) + $item['uid'] == Session::getLocalUser()) ); } diff --git a/src/Content/Nav.php b/src/Content/Nav.php index b43e926e8..c66758a6d 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -127,7 +127,7 @@ class Nav //Don't populate apps_menu if apps are private $privateapps = DI::config()->get('config', 'private_addons', false); - if (local_user() || !$privateapps) { + if (Session::getLocalUser() || !$privateapps) { $arr = ['app_menu' => self::$app_menu]; Hook::callAll('app_menu', $arr); @@ -149,7 +149,7 @@ class Nav */ private static function getInfo(App $a): array { - $ssl_state = (bool) local_user(); + $ssl_state = (bool) Session::getLocalUser(); /* * Our network is distributed, and as you visit friends some of the @@ -211,7 +211,7 @@ class Nav $homelink = DI::session()->get('visitor_home', ''); } - if ((DI::args()->getModuleName() != 'home') && (! (local_user()))) { + if ((DI::args()->getModuleName() != 'home') && (! (Session::getLocalUser()))) { $nav['home'] = [$homelink, DI::l10n()->t('Home'), '', DI::l10n()->t('Home Page')]; } @@ -229,7 +229,7 @@ class Nav $nav['apps'] = ['apps', DI::l10n()->t('Apps'), '', DI::l10n()->t('Addon applications, utilities, games')]; } - if (local_user() || !DI::config()->get('system', 'local_search')) { + if (Session::getLocalUser() || !DI::config()->get('system', 'local_search')) { $nav['search'] = ['search', DI::l10n()->t('Search'), '', DI::l10n()->t('Search site content')]; $nav['searchoption'] = [ @@ -252,12 +252,12 @@ class Nav } } - if ((local_user() || DI::config()->get('system', 'community_page_style') != Community::DISABLED_VISITOR) && + if ((Session::getLocalUser() || DI::config()->get('system', 'community_page_style') != Community::DISABLED_VISITOR) && !(DI::config()->get('system', 'community_page_style') == Community::DISABLED)) { $nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')]; } - if (local_user()) { + if (Session::getLocalUser()) { $nav['events'] = ['events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')]; } @@ -270,7 +270,7 @@ class Nav } // The following nav links are only show to logged in users - if (local_user() && !empty($a->getLoggedInUserNickname())) { + if (Session::getLocalUser() && !empty($a->getLoggedInUserNickname())) { $nav['network'] = ['network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')]; $nav['home'] = ['profile/' . $a->getLoggedInUserNickname(), DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')]; @@ -288,7 +288,7 @@ class Nav $nav['messages']['outbox'] = ['message/sent', DI::l10n()->t('Outbox'), '', DI::l10n()->t('Outbox')]; $nav['messages']['new'] = ['message/new', DI::l10n()->t('New Message'), '', DI::l10n()->t('New Message')]; - if (User::hasIdentities(DI::session()->get('submanage') ?: local_user())) { + if (User::hasIdentities(DI::session()->get('submanage') ?: Session::getLocalUser())) { $nav['delegation'] = ['delegation', DI::l10n()->t('Accounts'), '', DI::l10n()->t('Manage other pages')]; } diff --git a/src/Content/Smilies.php b/src/Content/Smilies.php index 04dcf9907..68093e843 100644 --- a/src/Content/Smilies.php +++ b/src/Content/Smilies.php @@ -22,6 +22,7 @@ namespace Friendica\Content; use Friendica\Core\Hook; +use Friendica\Core\Session; use Friendica\DI; use Friendica\Util\Strings; @@ -213,7 +214,7 @@ class Smilies public static function replaceFromArray(string $text, array $smilies, bool $no_images = false): string { if (intval(DI::config()->get('system', 'no_smilies')) - || (local_user() && intval(DI::pConfig()->get(local_user(), 'system', 'no_smilies'))) + || (Session::getLocalUser() && intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'no_smilies'))) ) { return $text; } diff --git a/src/Content/Widget.php b/src/Content/Widget.php index f1f62c33f..06841ed92 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -26,6 +26,7 @@ use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Search; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -66,7 +67,7 @@ class Widget $global_dir = Search::getGlobalDirectory(); if (DI::config()->get('system', 'invitation_only')) { - $x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining')); + $x = intval(DI::pConfig()->get(Session::getLocalUser(), 'system', 'invites_remaining')); if ($x || DI::app()->isSiteAdmin()) { DI::page()['aside'] .= '