From 4a96f88efd2b21578cfc823b822a7286956bd9a1 Mon Sep 17 00:00:00 2001 From: plebeius Date: Tue, 10 Feb 2026 13:45:55 +0800 Subject: [PATCH] feat: add copy user ID menu item and rename copy link to copy direct link Add 'Copy user ID' button to both desktop and mobile post menus, allowing users to copy the full author address. This provides a way to verify authenticity against the 8-char display ID. Also rename 'Copy link' to 'Copy direct link' for clarity. Update security comments to reflect the new approach and add translations for all 35 languages. --- public/translations/ar/default.json | 5 +++-- public/translations/bn/default.json | 5 +++-- public/translations/cs/default.json | 5 +++-- public/translations/da/default.json | 5 +++-- public/translations/de/default.json | 5 +++-- public/translations/el/default.json | 5 +++-- public/translations/en/default.json | 5 +++-- public/translations/es/default.json | 5 +++-- public/translations/fa/default.json | 5 +++-- public/translations/fi/default.json | 5 +++-- public/translations/fil/default.json | 5 +++-- public/translations/fr/default.json | 5 +++-- public/translations/he/default.json | 5 +++-- public/translations/hi/default.json | 5 +++-- public/translations/hu/default.json | 5 +++-- public/translations/id/default.json | 5 +++-- public/translations/it/default.json | 5 +++-- public/translations/ja/default.json | 5 +++-- public/translations/ko/default.json | 5 +++-- public/translations/mr/default.json | 5 +++-- public/translations/nl/default.json | 5 +++-- public/translations/no/default.json | 5 +++-- public/translations/pl/default.json | 5 +++-- public/translations/pt/default.json | 5 +++-- public/translations/ro/default.json | 5 +++-- public/translations/ru/default.json | 5 +++-- public/translations/sq/default.json | 5 +++-- public/translations/sv/default.json | 5 +++-- public/translations/te/default.json | 5 +++-- public/translations/th/default.json | 5 +++-- public/translations/tr/default.json | 5 +++-- public/translations/uk/default.json | 5 +++-- public/translations/ur/default.json | 5 +++-- public/translations/vi/default.json | 5 +++-- public/translations/zh/default.json | 5 +++-- src/components/post-desktop/post-desktop.tsx | 2 +- .../post-menu-desktop/post-menu-desktop.tsx | 22 ++++++++++++++++++- .../post-menu-mobile/post-menu-mobile.tsx | 22 ++++++++++++++++++- src/components/post-mobile/post-mobile.tsx | 2 +- 39 files changed, 149 insertions(+), 74 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 6ec9bcad..fd9fc284 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -99,7 +99,6 @@ "interface": "واجهة", "invalid_url": "رابط غير صالح", "image_search": "البحث عن صورة", - "copy_link": "نسخ الرابط", "hide_post": "إخفاء المنشور", "hide_thread": "إخفاء الموضوع", "unhide_post": "إظهار المنشور", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "نسخ معرف المستخدم", + "copy_direct_link": "نسخ الرابط المباشر" } diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 1c588cb1..d03858f8 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -99,7 +99,6 @@ "interface": "ইন্টারফেস", "invalid_url": "অবৈধ ইউআরএল", "image_search": "চিত্র অনুসন্ধান", - "copy_link": "লিংক অনুলিপি করুন", "hide_post": "পোস্ট লুকাও", "hide_thread": "থ্রেড লুকাও", "unhide_post": "পোস্ট প্রদর্শন করুন", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "ইউজার আইডি কপি করুন", + "copy_direct_link": "সরাসরি লিংক অনুলিপি করুন" } diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index 97fb4127..b996bd57 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -99,7 +99,6 @@ "interface": "rozhraní", "invalid_url": "Neplatná adresa URL", "image_search": "hledání obrázku", - "copy_link": "kopírovat odkaz", "hide_post": "skrýt příspěvek", "hide_thread": "skrýt vlákno", "unhide_post": "zobrazit příspěvek", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopírovat ID uživatele", + "copy_direct_link": "kopírovat přímý odkaz" } diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 4c06a346..e4412369 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "Ugyldig webadresse", "image_search": "billedsøgning", - "copy_link": "kopier link", "hide_post": "skjul post", "hide_thread": "skjul tråd", "unhide_post": "vis indlæg", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopier bruger-ID", + "copy_direct_link": "kopier direkte link" } diff --git a/public/translations/de/default.json b/public/translations/de/default.json index c951d5d1..e4dd7a17 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -99,7 +99,6 @@ "interface": "Schnittstelle", "invalid_url": "Ungültige URL", "image_search": "Bildersuche", - "copy_link": "Link kopieren", "hide_post": "Beitrag ausblenden", "hide_thread": "Thread ausblenden", "unhide_post": "Beitrag anzeigen", @@ -276,5 +275,7 @@ "type": "Typ", "yes": "Ja", "no": "Nein", - "pending_mod_approval": "Ausstehende Moderatorgenehmigung, für Benutzer nicht sichtbar" + "pending_mod_approval": "Ausstehende Moderatorgenehmigung, für Benutzer nicht sichtbar", + "copy_user_id": "Benutzer-ID kopieren", + "copy_direct_link": "Direktlink kopieren" } diff --git a/public/translations/el/default.json b/public/translations/el/default.json index e92e62b8..455226e0 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -99,7 +99,6 @@ "interface": "διεπαφή", "invalid_url": "Μη έγκυρη διεύθυνση URL", "image_search": "αναζήτηση εικόνων", - "copy_link": "αντιγραφή συνδέσμου", "hide_post": "απόκρυψη ανάρτησης", "hide_thread": "απόκρυψη νήματος", "unhide_post": "εμφάνιση ανάρτησης", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "αντιγραφή ID χρήστη", + "copy_direct_link": "αντιγραφή άμεσου συνδέσμου" } diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 7f9cd625..ee53ae49 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "Invalid URL", "image_search": "image search", - "copy_link": "Copy link", "hide_post": "Hide post", "hide_thread": "Hide thread", "unhide_post": "Unhide post", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "Copy user ID", + "copy_direct_link": "Copy direct link" } diff --git a/public/translations/es/default.json b/public/translations/es/default.json index e1f1ba9c..aa3e5f4f 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -99,7 +99,6 @@ "interface": "interfaz", "invalid_url": "URL no válida", "image_search": "búsqueda de imágenes", - "copy_link": "Copiar enlace", "hide_post": "Ocultar publicación", "hide_thread": "Ocultar hilo", "unhide_post": "Mostrar publicación", @@ -276,5 +275,7 @@ "type": "Tipo", "yes": "Sí", "no": "No", - "pending_mod_approval": "Pendiente de aprobación del moderador, no visible para los usuarios" + "pending_mod_approval": "Pendiente de aprobación del moderador, no visible para los usuarios", + "copy_user_id": "Copiar ID de usuario", + "copy_direct_link": "Copiar enlace directo" } diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 26c8571f..e083ac80 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -99,7 +99,6 @@ "interface": "رابط", "invalid_url": "آدرس اینترنتی نامعتبر است", "image_search": "جستجوی تصویر", - "copy_link": "رونوشت لینک", "hide_post": "پنهان کردن پست", "hide_thread": "پنهان کردن موضوع", "unhide_post": "نمایش پست", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "کپی شناسه کاربر", + "copy_direct_link": "رونوشت لینک مستقیم" } diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 34749c06..8eab1804 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -99,7 +99,6 @@ "interface": "liitäntä", "invalid_url": "Virheellinen URL-osoite", "image_search": "kuvahaku", - "copy_link": "kopioi linkki", "hide_post": "piilota viesti", "hide_thread": "piilota keskustelu", "unhide_post": "näytä viesti", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopioi käyttäjätunnus", + "copy_direct_link": "kopioi suora linkki" } diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index d3e0e9be..0b9e6f99 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "Hindi wastong URL", "image_search": "paghahanap ng larawan", - "copy_link": "kopyahin ang link", "hide_post": "itago ang post", "hide_thread": "itago ang thread", "unhide_post": "ipakita ang post", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopyahin ang user ID", + "copy_direct_link": "kopyahin ang direct link" } diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index af933581..3c792085 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "URL non valide", "image_search": "recherche d'images", - "copy_link": "Copier le lien", "hide_post": "Masquer la publication", "hide_thread": "Masquer le fil", "unhide_post": "Afficher la publication", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Oui", "no": "Non", - "pending_mod_approval": "En attente d'approbation du modérateur, non visible pour les utilisateurs" + "pending_mod_approval": "En attente d'approbation du modérateur, non visible pour les utilisateurs", + "copy_user_id": "Copier l'ID utilisateur", + "copy_direct_link": "Copier le lien direct" } diff --git a/public/translations/he/default.json b/public/translations/he/default.json index ed8fc1cd..27f02685 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -99,7 +99,6 @@ "interface": "ממשק", "invalid_url": "כתובת אינטרנט לא תקינה", "image_search": "חיפוש תמונות", - "copy_link": "העתק קישור", "hide_post": "הסתר פוסט", "hide_thread": "הסתר ת’רד", "unhide_post": "הצג פוסט", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "העתק מזהה משתמש", + "copy_direct_link": "העתק קישור ישיר" } diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 8c13d1d2..2c64d3a0 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -99,7 +99,6 @@ "interface": "इंटरफेस", "invalid_url": "अमान्य URL", "image_search": "चित्र खोज", - "copy_link": "लिंक कॉपी करें", "hide_post": "पोस्ट छुपाएं", "hide_thread": "धागा छुपाएं", "unhide_post": "पोस्ट प्रदर्शित करें", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "यूज़र ID कॉपी करें", + "copy_direct_link": "डायरेक्ट लिंक कॉपी करें" } diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index b43aa701..307fc0d1 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -99,7 +99,6 @@ "interface": "felület", "invalid_url": "Érvénytelen URL-cím", "image_search": "képkeresés", - "copy_link": "link másolása", "hide_post": "bejegyzés elrejtése", "hide_thread": "szál elrejtése", "unhide_post": "bejegyzés megjelenítése", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "felhasználói ID másolása", + "copy_direct_link": "közvetlen link másolása" } diff --git a/public/translations/id/default.json b/public/translations/id/default.json index dabfe270..685f6199 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -99,7 +99,6 @@ "interface": "antarmuka", "invalid_url": "URL tidak valid", "image_search": "pencarian gambar", - "copy_link": "salin tautan", "hide_post": "sembunyikan pos", "hide_thread": "sembunyikan utas", "unhide_post": "tampilkan pos", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "salin ID pengguna", + "copy_direct_link": "salin tautan langsung" } diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 3330dc45..345f8e6c 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -99,7 +99,6 @@ "interface": "interfaccia", "invalid_url": "URL non valido", "image_search": "ricerca immagini", - "copy_link": "Copia link", "hide_post": "Nascondi post", "hide_thread": "Nascondi thread", "unhide_post": "Mostra post", @@ -276,5 +275,7 @@ "type": "Tipo", "yes": "Sì", "no": "No", - "pending_mod_approval": "In attesa di approvazione del moderatore, non visibile agli utenti" + "pending_mod_approval": "In attesa di approvazione del moderatore, non visibile agli utenti", + "copy_user_id": "Copia ID utente", + "copy_direct_link": "Copia link diretto" } diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index 11b28a9a..a8c80934 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -99,7 +99,6 @@ "interface": "インターフェース", "invalid_url": "無効なURL", "image_search": "画像検索", - "copy_link": "リンクをコピー", "hide_post": "投稿を非表示", "hide_thread": "スレッドを非表示", "unhide_post": "投稿を表示", @@ -276,5 +275,7 @@ "type": "タイプ", "yes": "はい", "no": "いいえ", - "pending_mod_approval": "モデレーターの承認待ち、ユーザーには表示されません" + "pending_mod_approval": "モデレーターの承認待ち、ユーザーには表示されません", + "copy_user_id": "ユーザーIDをコピー", + "copy_direct_link": "直接リンクをコピー" } diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 6f85830d..963394ff 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -99,7 +99,6 @@ "interface": "인터페이스", "invalid_url": "잘못된 URL", "image_search": "이미지 검색", - "copy_link": "링크 복사", "hide_post": "게시물 숨기기", "hide_thread": "스레드 숨기기", "unhide_post": "게시물 숨기기 해제", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "사용자 ID 복사", + "copy_direct_link": "직접 링크 복사" } diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 5c455d6c..e6ff6f9a 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -99,7 +99,6 @@ "interface": "इंटरफेस", "invalid_url": "अवैध URL", "image_search": "प्रतिमा शोध", - "copy_link": "लिंक कॉपी करा", "hide_post": "पोस्ट लपवा", "hide_thread": "थ्रेड लपवा", "unhide_post": "पोस्ट दाखवा", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "यूजर ID कॉपी करा", + "copy_direct_link": "डायरेक्ट लिंक कॉपी करा" } diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 356ee01f..02fce1b7 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "Ongeldige URL", "image_search": "afbeeldingen zoeken", - "copy_link": "link kopiëren", "hide_post": "bericht verbergen", "hide_thread": "thread verbergen", "unhide_post": "bericht weergeven", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "gebruikers-ID kopiëren", + "copy_direct_link": "directe link kopiëren" } diff --git a/public/translations/no/default.json b/public/translations/no/default.json index b51e4d2a..60abf058 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -99,7 +99,6 @@ "interface": "grensesnitt", "invalid_url": "Ugyldig URL", "image_search": "bilde søk", - "copy_link": "kopier lenke", "hide_post": "skjul innlegg", "hide_thread": "skjul tråd", "unhide_post": "vis innlegg", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopier bruker-ID", + "copy_direct_link": "kopier direkte lenke" } diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 2c9db8be..76c983ec 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -99,7 +99,6 @@ "interface": "interfejs", "invalid_url": "Nieprawidłowy adres URL", "image_search": "wyszukiwanie obrazów", - "copy_link": "skopiuj link", "hide_post": "ukryj post", "hide_thread": "ukryj wątek", "unhide_post": "pokaż post", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "skopiuj ID użytkownika", + "copy_direct_link": "skopiuj bezpośredni link" } diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 2a3c2f93..05b7dd95 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -99,7 +99,6 @@ "interface": "interface", "invalid_url": "URL inválida", "image_search": "pesquisa de imagens", - "copy_link": "Copiar link", "hide_post": "Ocultar postagem", "hide_thread": "Ocultar tópico", "unhide_post": "Mostrar postagem", @@ -276,5 +275,7 @@ "type": "Tipo", "yes": "Sim", "no": "Não", - "pending_mod_approval": "Aguardando aprovação do moderador, não visível para os usuários" + "pending_mod_approval": "Aguardando aprovação do moderador, não visível para os usuários", + "copy_user_id": "Copiar ID do usuário", + "copy_direct_link": "Copiar link direto" } diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index f5c79917..8d02bfbe 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -99,7 +99,6 @@ "interface": "interfață", "invalid_url": "URL invalid", "image_search": "căutare de imagini", - "copy_link": "copiați linkul", "hide_post": "ascundeți postarea", "hide_thread": "ascundeți firul", "unhide_post": "afișează postarea", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "copiați ID-ul utilizatorului", + "copy_direct_link": "copiați linkul direct" } diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index f1d7a1f0..0503feb6 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -99,7 +99,6 @@ "interface": "интерфейс", "invalid_url": "Недействительный URL", "image_search": "поиск изображений", - "copy_link": "копировать ссылку", "hide_post": "скрыть пост", "hide_thread": "скрыть ветку", "unhide_post": "показать пост", @@ -276,5 +275,7 @@ "type": "Тип", "yes": "Да", "no": "Нет", - "pending_mod_approval": "Ожидает одобрения модератора, не видно пользователям" + "pending_mod_approval": "Ожидает одобрения модератора, не видно пользователям", + "copy_user_id": "копировать ID пользователя", + "copy_direct_link": "копировать прямую ссылку" } diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 2998f3c1..4acf5ec5 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -99,7 +99,6 @@ "interface": "ndërfaqe", "invalid_url": "URL jo e vlefshëm", "image_search": "kërkim imazhesh", - "copy_link": "kopjo linkun", "hide_post": "fsheh postën", "hide_thread": "fsheh fijen", "unhide_post": "shfaq postën", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopjo ID e përdoruesit", + "copy_direct_link": "kopjo lidhjen e drejtpërdrejtë" } diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index a4d28810..c94bc0fd 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -99,7 +99,6 @@ "interface": "gränssnitt", "invalid_url": "Ogiltig URL", "image_search": "bildsökning", - "copy_link": "kopiera länk", "hide_post": "dölj inlägg", "hide_thread": "dölj tråd", "unhide_post": "visa inlägg", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kopiera användar-ID", + "copy_direct_link": "kopiera direktlänk" } diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 625dd56e..17a9ee86 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -99,7 +99,6 @@ "interface": "అంతరాఫ్సు", "invalid_url": "చెల్లని URL", "image_search": "చిత్రాల శోధన", - "copy_link": "లింక్ ను కాపీ చేయండి", "hide_post": "పోస్ట్ దాచు", "hide_thread": "థ్రెడ్ దాచు", "unhide_post": "పోస్ట్ చూపించు", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "యూజర్ ID కాపీ చేయండి", + "copy_direct_link": "డైరెక్ట్ లింక్ కాపీ చేయండి" } diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 3f21530c..5324d061 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -99,7 +99,6 @@ "interface": "อินเทอร์เฟซ", "invalid_url": "URL ไม่ถูกต้อง", "image_search": "ค้นหารูปภาพ", - "copy_link": "คัดลอกลิงก์", "hide_post": "ซ่อนโพสต์", "hide_thread": "ซ่อนเธรด", "unhide_post": "แสดงโพสต์", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "คัดลอก ID ผู้ใช้", + "copy_direct_link": "คัดลอกลิงก์โดยตรง" } diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index e6b1cdc6..048e00ec 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -99,7 +99,6 @@ "interface": "arayüz", "invalid_url": "Geçersiz URL", "image_search": "resim arama", - "copy_link": "bağlantıyı kopyala", "hide_post": "gönderiyi gizle", "hide_thread": "konuyu gizle", "unhide_post": "gönderiyi göster", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "kullanıcı ID'sini kopyala", + "copy_direct_link": "doğrudan bağlantıyı kopyala" } diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 75214c0e..9dc66da8 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -99,7 +99,6 @@ "interface": "інтерфейс", "invalid_url": "Недійсний URL", "image_search": "пошук зображень", - "copy_link": "копіювати посилання", "hide_post": "сховати допис", "hide_thread": "сховати нитку", "unhide_post": "показати допис", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "копіювати ID користувача", + "copy_direct_link": "копіювати пряме посилання" } diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index 0367c2f5..78cacad2 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -99,7 +99,6 @@ "interface": "انٹرفیس", "invalid_url": "غیر درست یو آر ایل", "image_search": "تصویر کی تلاش", - "copy_link": "لنک کاپی کریں", "hide_post": "پوسٹ چھپائیں", "hide_thread": "دھاگہ چھپائیں", "unhide_post": "پوسٹ دکھائیں", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "صارف کی شناخت کاپی کریں", + "copy_direct_link": "براہ راست لنک کاپی کریں" } diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 537fb4fe..c00e2427 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -99,7 +99,6 @@ "interface": "giao diện", "invalid_url": "URL không hợp lệ", "image_search": "tìm kiếm hình ảnh", - "copy_link": "sao chép liên kết", "hide_post": "Ẩn bài viết", "hide_thread": "Ẩn chủ đề", "unhide_post": "Hiện bài viết", @@ -276,5 +275,7 @@ "type": "Type", "yes": "Yes", "no": "No", - "pending_mod_approval": "Pending mod approval, not visible to users" + "pending_mod_approval": "Pending mod approval, not visible to users", + "copy_user_id": "sao chép ID người dùng", + "copy_direct_link": "sao chép liên kết trực tiếp" } diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 79530296..b917f136 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -99,7 +99,6 @@ "interface": "界面", "invalid_url": "无效的网址", "image_search": "图像搜索", - "copy_link": "复制链接", "hide_post": "隐藏帖子", "hide_thread": "隐藏主题", "unhide_post": "显示帖子", @@ -276,5 +275,7 @@ "type": "类型", "yes": "是", "no": "否", - "pending_mod_approval": "等待版主批准,用户不可见" + "pending_mod_approval": "等待版主批准,用户不可见", + "copy_user_id": "复制用户ID", + "copy_direct_link": "复制直接链接" } diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index d19bf6b3..0ecd5187 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -197,7 +197,7 @@ const PostInfo = ({ const alertThresholdSeconds = getAlertThresholdSeconds(); const isOverThreshold = isAwaitingApproval && timeWaiting > alertThresholdSeconds; - const userID = address && Plebbit.getShortAddress({ address }); // should not be shortened to less than 12 characters, because users can create unlimited addresses/IDs before authenticating or passing challenges, so if the ID is short enough they can spoof it to troll users with the same ID + const userID = address && Plebbit.getShortAddress({ address }); // shortened to 8 chars for display; users can verify the full user ID via "Copy user ID" in the post menu to guard against spoofing const userIDBackgroundColor = hashStringToColor(userID); const userIDTextColor = getTextColorForBackground(userIDBackgroundColor); diff --git a/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx b/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx index 33bf8269..0f3c0013 100644 --- a/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx +++ b/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx @@ -39,7 +39,7 @@ const CopyLinkButton = ({ cid, subplebbitAddress, linkType, onClose }: CopyLinkB } }} > -
{t('copy_link')}
+
{t('copy_direct_link')}
); }; @@ -63,6 +63,25 @@ const CopyContentIdButton = ({ cid, onClose }: { cid: string; onClose: () => voi ); }; +const CopyUserIdButton = ({ address, onClose }: { address: string; onClose: () => void }) => { + const { t } = useTranslation(); + return ( +
{ + try { + await copyToClipboard(address); + } catch (error) { + console.error('Failed to copy user id', error); + } finally { + onClose(); + } + }} + > +
{t('copy_user_id')}
+
+ ); +}; + const ImageSearchButton = ({ url, onClose }: { url: string; onClose: () => void }) => { const { t } = useTranslation(); const [isImageSearchMenuOpen, setIsImageSearchMenuOpen] = useState(false); @@ -178,6 +197,7 @@ const PostMenuDesktop = ({ postMenu }: PostMenuDesktopProps) => {
{cid && subplebbitAddress && } {cid && } + {authorAddress && } {!(isInPostPageView && postCid === cid) && (
-
{t('copy_link')}
+
{t('copy_direct_link')}
); }; @@ -71,6 +71,25 @@ const CopyContentIdButton = ({ cid, onClose }: { cid: string; onClose: () => voi ); }; +const CopyUserIdButton = ({ address, onClose }: { address: string; onClose: () => void }) => { + const { t } = useTranslation(); + return ( +
{ + try { + await copyToClipboard(address); + } catch (error) { + console.error('Failed to copy user id', error); + } finally { + onClose(); + } + }} + > +
{t('copy_user_id')}
+
+ ); +}; + const ImageSearchButtons = ({ url, onClose }: { url: string; onClose: () => void }) => { const { t } = useTranslation(); return ( @@ -180,6 +199,7 @@ const PostMenuMobile = ({ postMenu, editMenuPost }: PostMenuMobileProps) => {
{cid && subplebbitAddress && } {cid && } + {authorAddress && } {cid && subplebbitAddress && } {cid && subplebbitAddress && authorAddress && } {cid && subplebbitAddress && !isInBoardView && } diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 7875e36f..4b56b85c 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -173,7 +173,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles, threadNumber }: Pos const pseudonymityMode = useSubplebbitField(subplebbitAddress, (sub) => sub?.features?.pseudonymityMode); const showUserID = pseudonymityMode !== 'per-reply'; - const userID = address && Plebbit.getShortAddress({ address }); // should not be shortened to less than 12 characters, because users can create unlimited addresses/IDs before authenticating or passing challenges, so if the ID is short enough they can spoof it to troll users with the same ID + const userID = address && Plebbit.getShortAddress({ address }); // shortened to 8 chars for display; users can verify the full user ID via "Copy user ID" in the post menu to guard against spoofing const userIDBackgroundColor = hashStringToColor(userID); const userIDTextColor = getTextColorForBackground(userIDBackgroundColor);