From ed70b2ca277bfd26aaa1f2b1d80ef490c1c481ab Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Tue, 9 Jul 2024 20:12:09 +0100 Subject: [PATCH 01/11] Mailstream: respect blocked/ignored/collapsed contact settings --- mailstream/mailstream.php | 44 +++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index a5aafdc7..7f68b7cc 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -166,7 +166,35 @@ function mailstream_send_hook(array $data) return; } - if (!mailstream_send($data['message_id'], $item, $user)) { + $author = DBA::selectFirst('contact', ['nick', 'blocked', 'uri-id'], ['id' => $data['author-id'], 'self' => false]); + if (!DBA::isResult($author)) { + DI::logger()->error('could not find author', ['guid' => $item['guid'], 'author-id' => $data['author-id']]); + return; + } + if ($author['blocked']) { + DI::logger()->info('author is blocked', ['guid' => $item['guid'], 'author-id' => $data['author-id']]); + return; + } + $collapsed = false; + $user_contact = DBA::selectFirst('user-contact', ['cid', 'blocked', 'ignored', 'collapsed'], ['uid' => $item['uid'], 'uri-id' => $item['author-uri-id']]); + if (!DBA::isResult($user_contact)) { + $user_contact = DBA::selectFirst('user-contact', ['cid', 'blocked', 'ignored', 'collapsed'], ['uid' => $item['uid'], 'cid' => $item['author-id']]); + } + if (DBA::isResult($user_contact)) { + if ($user_contact['blocked']) { + DI::logger()->info('author is blocked', ['guid' => $item['guid'], 'cid' => $user_contact['cid']]); + return; + } + if ($user_contact['ignored']) { + DI::logger()->info('author is ignored', ['guid' => $item['guid'], 'cid' => $user_contact['cid']]); + return; + } + if ($user_contact['collapsed']) { + $collapsed = true; + } + } + + if (!mailstream_send($data['message_id'], $item, $user, $collapsed)) { DI::logger()->debug('send failed, will retry', $data); if (!Worker::defer()) { DI::logger()->error('failed and could not defer', $data); @@ -220,6 +248,7 @@ function mailstream_post_hook(array &$item) $send_hook_data = [ 'uid' => $item['uid'], 'contact-id' => $item['contact-id'], + 'author-id' => $item['author-id'], 'uri' => $item['uri'], 'message_id' => $message_id, 'tries' => 0, @@ -406,10 +435,11 @@ function mailstream_subject(array $item): string * @param string $message_id ID of the message (RFC 1036) * @param array $item content of the item * @param array $user results from the user table + * @param bool $collapsed true if the content should be hidden * * @return bool True if this message has been completed. False if it should be retried. */ -function mailstream_send(string $message_id, array $item, array $user): bool +function mailstream_send(string $message_id, array $item, array $user, bool $collapsed): bool { if (!is_array($item)) { DI::logger()->error('item is empty', ['message_id' => $message_id]); @@ -427,10 +457,16 @@ function mailstream_send(string $message_id, array $item, array $user): bool require_once(dirname(__file__) . '/phpmailer/class.phpmailer.php'); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + if ($collapsed) { + $item['body'] = DI::l10n()->t('Content from %s is collapsed', $item['author-name']); + } else { + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + } $attachments = []; - mailstream_do_images($item, $attachments); + if (!$collapsed) { + mailstream_do_images($item, $attachments); + } $frommail = DI::config()->get('mailstream', 'frommail'); if ($frommail == '') { $frommail = 'friendica@localhost.local'; From 31c130436ce7fad27e5b17f3668d185fdeeb7cf7 Mon Sep 17 00:00:00 2001 From: "Marcus F." Date: Sun, 18 Jan 2026 15:15:37 +0100 Subject: [PATCH 02/11] IRC: Use friendica nickname as suggested IRC nickname, when signed in --- irc/irc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irc/irc.php b/irc/irc.php index db808a99..a0cb899e 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -74,6 +74,7 @@ function irc_content() { $baseurl = DI::baseUrl() . '/addon/irc'; $o = ''; + $usernick = ''; /* set the list of popular channels */ if (DI::userSession()->getLocalUserId()) { @@ -81,6 +82,7 @@ function irc_content() if (!$sitechats) { $sitechats = DI::config()->get('irc', 'sitechats'); } + $usernick = "nick=" . DI::userSession()->getLocalUserNickname() . "&"; } else { $sitechats = DI::config()->get('irc','sitechats'); } @@ -117,7 +119,7 @@ function irc_content() $o .= <<< EOT

IRC chat

A beginner's guide to using IRC. [en]

- + EOT; return $o; From 3509144228a91c6dae286f83324fcbfe4ecc6247 Mon Sep 17 00:00:00 2001 From: loma-one Date: Mon, 23 Feb 2026 21:30:27 +0100 Subject: [PATCH 03/11] Add QuickPhoto Addon: Elegant BBCode simplification for images This PR introduces the QuickPhoto addon, designed to improve the user experience within the Friendica editor. It addresses the issue of long, cluttered BBCodes (monster-links) that appear when images are inserted via drag-and-drop or the image uploader. Key Features - Automatic Simplification: Replaces complex [url=...][img=...]...[/img][/url] structures with a human-readable shorthand: [img]filename|description[/img]. - Seamless Reconstruction: Automatically restores the full, valid Friendica BBCode before previewing or submitting a post, ensuring 100% compatibility with the server. - Enhanced Readability: Keeps the editor clean and focus-oriented while writing long posts with multiple images. Technical Highlights & Optimizations - Resource Efficient: The JavaScript is strictly scoped. It only becomes active if a textarea is present and visible in the DOM. - Zero Latency Typing: Implements requestIdleCallback and throttling (500ms) to ensure that the simplification process never interferes with the user's typing flow or causes UI lag. - Background Throttling: Logic is suspended when the browser tab is inactive (document.hidden) to save CPU and battery life. - LocalStorage Cache: Uses a local cache for image data (auto-cleaned after 12 hours) to ensure reliability during a single editing session. Testing performed - Tested with the standard "Jot" editor and the newer Compose/Comment templates. - Verified that image previews render correctly (reconstruction triggers on preview click). - Verified that the final post contains the correct full BBCode on the server side. - Confirmed that Drag & Drop inserts are handled immediately. --- quickphoto/quickphoto.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 quickphoto/quickphoto.php diff --git a/quickphoto/quickphoto.php b/quickphoto/quickphoto.php new file mode 100644 index 00000000..a3ba1059 --- /dev/null +++ b/quickphoto/quickphoto.php @@ -0,0 +1,32 @@ + + */ + +use Friendica\Core\Hook; + +function quickphoto_install() { + Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); + // Emergency hook: If the JS fails during transmission + Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); +} + +function quickphoto_header(&$header) { + $header .= '' . "\n"; +} + +/** + * Processes the text directly upon receipt on the server + */ +function quickphoto_post_hook(&$item) { + if (!isset($item['body'])) { + return; + } + + // If the JS couldn't do the job, we have the problem here + // that we don't have LocalStorage. That's why the JS is primarily responsible here. + // We'll leave this hook as a placeholder for future server validations. +} \ No newline at end of file From ec3b0c5941ba99c2c03c5b9e3db01a3a74769d67 Mon Sep 17 00:00:00 2001 From: loma-one Date: Mon, 23 Feb 2026 21:33:13 +0100 Subject: [PATCH 04/11] Add QuickPhoto Addon: Elegant BBCode simplification for images This PR introduces the QuickPhoto addon, designed to improve the user experience within the Friendica editor. It addresses the issue of long, cluttered BBCodes (monster-links) that appear when images are inserted via drag-and-drop or the image uploader. Key Features - Automatic Simplification: Replaces complex [url=...][img=...]...[/img][/url] structures with a human-readable shorthand: [img]filename|description[/img]. - Seamless Reconstruction: Automatically restores the full, valid Friendica BBCode before previewing or submitting a post, ensuring 100% compatibility with the server. - Enhanced Readability: Keeps the editor clean and focus-oriented while writing long posts with multiple images. Technical Highlights & Optimizations - Resource Efficient: The JavaScript is strictly scoped. It only becomes active if a textarea is present and visible in the DOM. - Zero Latency Typing: Implements requestIdleCallback and throttling (500ms) to ensure that the simplification process never interferes with the user's typing flow or causes UI lag. - Background Throttling: Logic is suspended when the browser tab is inactive (document.hidden) to save CPU and battery life. - LocalStorage Cache: Uses a local cache for image data (auto-cleaned after 12 hours) to ensure reliability during a single editing session. Testing performed - Tested with the standard "Jot" editor and the newer Compose/Comment templates. - Verified that image previews render correctly (reconstruction triggers on preview click). - Verified that the final post contains the correct full BBCode on the server side. - Confirmed that Drag & Drop inserts are handled immediately. --- quickphoto/quickphoto.js | 125 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 quickphoto/quickphoto.js diff --git a/quickphoto/quickphoto.js b/quickphoto/quickphoto.js new file mode 100644 index 00000000..4f3c12eb --- /dev/null +++ b/quickphoto/quickphoto.js @@ -0,0 +1,125 @@ +(function() { + const monsterPattern = /\[url=(.*?)\]\[img=(.*?)\](.*?)\[\/img\]\[\/url\]/gi; + let throttleTimer; + + const cleanupOldEntries = () => { + const now = Date.now(); + const twelveHours = 12 * 60 * 60 * 1000; + for (let i = 0; i < localStorage.length; i++) { + const key = localStorage.key(i); + if (key && key.startsWith('qp_')) { + try { + const data = JSON.parse(localStorage.getItem(key)); + if (data && data.timestamp && (now - data.timestamp > twelveHours)) { + localStorage.removeItem(key); + } + } catch (e) { localStorage.removeItem(key); } + } + } + }; + + const simplify = (text) => { + if (!text || !text.includes('[url=')) return text; + return text.replace(monsterPattern, (match, urlPart, imgPart, existingDesc) => { + const fileName = imgPart.split('/').pop(); + const storageKey = `qp_${fileName}`; + + localStorage.setItem(storageKey, JSON.stringify({ + url: urlPart, + img: imgPart, + timestamp: Date.now() + })); + + let userDesc = existingDesc.trim() || "Bildbeschreibung"; + return `[img]${fileName}|${userDesc}[/img]`; + }); + }; + + const reconstruct = (text) => { + if (!text || !text.includes('[img]')) return text; + return text.replace(/\[img\](.*?)\|(.*?)\[\/img\]/g, (match, fileName, desc) => { + const data = localStorage.getItem(`qp_${fileName}`); + if (data) { + const parsed = JSON.parse(data); + const finalDesc = (desc === "Bildbeschreibung") ? "" : desc; + return `[url=${parsed.url}][img=${parsed.img}]${finalDesc}[/img][/url]`; + } + return match; + }); + }; + + const applySimplify = (textarea) => { + if (!textarea || !textarea.value || !textarea.value.includes('[/img]')) return; + + (window.requestIdleCallback || function(cb) { return setTimeout(cb, 1); })(() => { + const current = textarea.value; + const simple = simplify(current); + if (current !== simple) { + const start = textarea.selectionStart; + const end = textarea.selectionEnd; + textarea.value = simple; + textarea.setSelectionRange(start, end); + } + }); + }; + + if (typeof jQuery !== 'undefined') { + const originalVal = jQuery.fn.val; + jQuery.fn.val = function(value) { + if (arguments.length === 0 && this.is('textarea')) { + return reconstruct(originalVal.call(this)); + } + if (arguments.length > 0 && this.is('textarea')) { + return originalVal.call(this, simplify(value)); + } + return originalVal.apply(this, arguments); + }; + } + + document.addEventListener('drop', (e) => { + if (e.target.tagName === 'TEXTAREA') { + setTimeout(() => applySimplify(e.target), 150); + } + }, true); + + document.addEventListener('input', (e) => { + if (e.target.tagName === 'TEXTAREA') { + clearTimeout(throttleTimer); + throttleTimer = setTimeout(() => applySimplify(e.target), 500); + } + }); + + document.addEventListener('click', (e) => { + const btn = e.target.closest( + '#wall-submit-preview, #profile-jot-submit, #wall-submit-submit, #jot-submit, ' + + '[id^="comment-edit-submit-"], [id^="comment-edit-preview-link-"]' + ); + + if (btn) { + const textareas = document.querySelectorAll('textarea'); + if (textareas.length > 0) { + textareas.forEach(textarea => { + textarea.value = reconstruct(textarea.value); + if (btn.id.includes('preview')) { + setTimeout(() => applySimplify(textarea), 1000); + } + }); + } + } + }, true); + + setInterval(() => { + if (document.hidden) return; + + const textareas = document.querySelectorAll('textarea'); + if (textareas.length === 0) return; + + textareas.forEach(textarea => { + if (textarea.offsetParent !== null) { + applySimplify(textarea); + } + }); + }, 2500); + + cleanupOldEntries(); +})(); From 0ae86dafa029fef7448ca08d082aa8077328edf1 Mon Sep 17 00:00:00 2001 From: loma-one Date: Mon, 23 Feb 2026 21:36:18 +0100 Subject: [PATCH 05/11] =?UTF-8?q?quickphoto/README.md=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickphoto/README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 quickphoto/README.md diff --git a/quickphoto/README.md b/quickphoto/README.md new file mode 100644 index 00000000..2a574064 --- /dev/null +++ b/quickphoto/README.md @@ -0,0 +1,45 @@ +# QuickPhoto Addon for Friendica + +QuickPhoto is a Friendica addon that simplifies working with images in the editor. It automatically replaces long, cumbersome BBCode structures with a compact shorthand notation, without affecting functionality or compatibility. + +--- + +## Features + +- **Automatic Simplification:** Converts "monster BBCodes" like `[url=...][img=...]...[/img][/url]` instantly into the handy format `[img]filename description[/img]`. +- **Intelligent Reconstruction:** Before submitting or previewing, the shorthand code is quickly converted back into the original, valid Friendica BBCode. +- **Real-Time Processing:** Responds immediately to drag & drop, copy & paste, and inserting images via editor buttons. +- **Focus Safety:** Cursor management ensures the focus remains stable during automatic conversion while typing. +- **Maximum Compatibility:** Supports both the standard Jot editor and the Compose module, as well as reply fields. +- **Local Cache:** Image data is securely stored in the browser's localStorage and automatically cleared after 12 hours. + +--- + +## How It Works + +The addon operates in a hybrid manner: + +- **Frontend:** A JavaScript watcher scans textareas and simplifies complex image links for better readability while writing. +- **Interface:** It integrates deeply with Friendica's jQuery functions to ensure that preview and save functions always receive the correct original data. +- **Events:** By intercepting submit and preview clicks, it guarantees that shorthand codes are never sent to the server in a format it cannot interpret. + +--- + +## Installation + +1. Create a folder named `quickphoto` in the `addon/` directory of your Friendica installation. +2. Place the file `quickphoto.php` in this folder. +3. Place the file `quickphoto.js` in the same folder. +4. Enable the addon in the Friendica administration area under **Addons**. + + --- + +MIT License + +Copyright (c) 2024-2026 Friendica Project & Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 29e8c2875ce8c9538dce5a18492219e81d197bb8 Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 09:09:48 +0100 Subject: [PATCH 06/11] quickphoto/README.md aktualisiert Inserted | in `[img]|filename description[/img]` --- quickphoto/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickphoto/README.md b/quickphoto/README.md index 2a574064..34af0e71 100644 --- a/quickphoto/README.md +++ b/quickphoto/README.md @@ -6,7 +6,7 @@ QuickPhoto is a Friendica addon that simplifies working with images in the edito ## Features -- **Automatic Simplification:** Converts "monster BBCodes" like `[url=...][img=...]...[/img][/url]` instantly into the handy format `[img]filename description[/img]`. +- **Automatic Simplification:** Converts "monster BBCodes" like `[url=...][img=...]...[/img][/url]` instantly into the handy format `[img]|filename description[/img]`. - **Intelligent Reconstruction:** Before submitting or previewing, the shorthand code is quickly converted back into the original, valid Friendica BBCode. - **Real-Time Processing:** Responds immediately to drag & drop, copy & paste, and inserting images via editor buttons. - **Focus Safety:** Cursor management ensures the focus remains stable during automatic conversion while typing. From 22026ed53359b42bbd3d0b221582605edac9d512 Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 09:13:45 +0100 Subject: [PATCH 07/11] quickphoto/quickphoto.js aktualisiert "Description" instead of "Bildbeschreibung" --- quickphoto/quickphoto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickphoto/quickphoto.js b/quickphoto/quickphoto.js index 4f3c12eb..09151888 100644 --- a/quickphoto/quickphoto.js +++ b/quickphoto/quickphoto.js @@ -30,7 +30,7 @@ timestamp: Date.now() })); - let userDesc = existingDesc.trim() || "Bildbeschreibung"; + let userDesc = existingDesc.trim() || "Description"; return `[img]${fileName}|${userDesc}[/img]`; }); }; @@ -41,7 +41,7 @@ const data = localStorage.getItem(`qp_${fileName}`); if (data) { const parsed = JSON.parse(data); - const finalDesc = (desc === "Bildbeschreibung") ? "" : desc; + const finalDesc = (desc === "Description") ? "" : desc; return `[url=${parsed.url}][img=${parsed.img}]${finalDesc}[/img][/url]`; } return match; From 4a133456cea0ef8f7021496cc24a86e1202f985d Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 10:20:43 +0100 Subject: [PATCH 08/11] quickphoto/quickphoto.php aktualisiert Provides a translation --- quickphoto/quickphoto.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/quickphoto/quickphoto.php b/quickphoto/quickphoto.php index a3ba1059..7e7bd1a0 100644 --- a/quickphoto/quickphoto.php +++ b/quickphoto/quickphoto.php @@ -1,32 +1,29 @@ */ -use Friendica\Core\Hook; - function quickphoto_install() { - Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); - // Emergency hook: If the JS fails during transmission - Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); + Friendica\Core\Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); + Friendica\Core\Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); } function quickphoto_header(&$header) { - $header .= '' . "\n"; -} + $desc_label = 'Image description'; -/** - * Processes the text directly upon receipt on the server - */ -function quickphoto_post_hook(&$item) { - if (!isset($item['body'])) { - return; + if (function_exists('t')) { + $desc_label = t('Image description'); } - // If the JS couldn't do the job, we have the problem here - // that we don't have LocalStorage. That's why the JS is primarily responsible here. - // We'll leave this hook as a placeholder for future server validations. + $js_label = addslashes($desc_label); + + $header .= "\n" . ''; + $header .= "\n" . '' . "\n"; +} + +function quickphoto_post_hook(&$item) { + // Placeholder } \ No newline at end of file From aa47cc6e048de0b48c76aea7b6220c355a4d4eb2 Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 10:22:20 +0100 Subject: [PATCH 09/11] quickphoto/quickphoto.js aktualisiert Make sure the translation is applied. --- quickphoto/quickphoto.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quickphoto/quickphoto.js b/quickphoto/quickphoto.js index 09151888..f8dc2294 100644 --- a/quickphoto/quickphoto.js +++ b/quickphoto/quickphoto.js @@ -2,6 +2,8 @@ const monsterPattern = /\[url=(.*?)\]\[img=(.*?)\](.*?)\[\/img\]\[\/url\]/gi; let throttleTimer; + const i18nDesc = (window.qp_i18n && window.qp_i18n.imageDesc) ? window.qp_i18n.imageDesc : "Image description"; + const cleanupOldEntries = () => { const now = Date.now(); const twelveHours = 12 * 60 * 60 * 1000; @@ -30,7 +32,7 @@ timestamp: Date.now() })); - let userDesc = existingDesc.trim() || "Description"; + let userDesc = existingDesc.trim() || i18nDesc; return `[img]${fileName}|${userDesc}[/img]`; }); }; @@ -41,7 +43,7 @@ const data = localStorage.getItem(`qp_${fileName}`); if (data) { const parsed = JSON.parse(data); - const finalDesc = (desc === "Description") ? "" : desc; + const finalDesc = (desc === i18nDesc) ? "" : desc; return `[url=${parsed.url}][img=${parsed.img}]${finalDesc}[/img][/url]`; } return match; @@ -110,7 +112,6 @@ setInterval(() => { if (document.hidden) return; - const textareas = document.querySelectorAll('textarea'); if (textareas.length === 0) return; From 59ece8856c0e51d391c26ae4aaf306850b571d15 Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 10:23:30 +0100 Subject: [PATCH 10/11] Translation file --- quickphoto/lang/C/messages.po | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 quickphoto/lang/C/messages.po diff --git a/quickphoto/lang/C/messages.po b/quickphoto/lang/C/messages.po new file mode 100644 index 00000000..75476018 --- /dev/null +++ b/quickphoto/lang/C/messages.po @@ -0,0 +1,22 @@ +# ADDON quickphoto +# Copyright (C) +# This file is distributed under the same license as the Friendica quickphoto addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 10:18+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: quickphoto.php:18 +msgid "Image description" +msgstr "" From 2e9f640724ebedef866908d50426c1fbe34edb4d Mon Sep 17 00:00:00 2001 From: loma-one Date: Sat, 7 Mar 2026 17:09:57 +0100 Subject: [PATCH 11/11] quickphoto/quickphoto.php aktualisiert DI::l10n()->t inserted --- quickphoto/quickphoto.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/quickphoto/quickphoto.php b/quickphoto/quickphoto.php index 7e7bd1a0..185665a6 100644 --- a/quickphoto/quickphoto.php +++ b/quickphoto/quickphoto.php @@ -6,17 +6,16 @@ * Author: Matthias Ebers */ +use Friendica\Core\Hook; +use Friendica\DI; + function quickphoto_install() { - Friendica\Core\Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); - Friendica\Core\Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); + Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); + Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); } function quickphoto_header(&$header) { - $desc_label = 'Image description'; - - if (function_exists('t')) { - $desc_label = t('Image description'); - } + $desc_label = DI::l10n()->t('Image description'); $js_label = addslashes($desc_label);