From f65f9c9a1c25948b0e44a3900e196485c2f84296 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 28 Dec 2022 22:44:23 +0100 Subject: [PATCH] feat: support muting conversations (#614) --- components/status/StatusActionsMore.vue | 10 ++++++++++ composables/status.ts | 9 ++++++++- locales/ar-EG.json | 2 ++ locales/cs-CZ.json | 2 ++ locales/de-DE.json | 2 ++ locales/en-GB.json | 2 ++ locales/en-US.json | 2 ++ locales/es-ES.json | 2 ++ locales/fr-FR.json | 2 ++ locales/ja-JP.json | 4 +++- locales/zh-CN.json | 2 ++ 11 files changed, 37 insertions(+), 2 deletions(-) diff --git a/components/status/StatusActionsMore.vue b/components/status/StatusActionsMore.vue index 791b46ca..f26a4b3c 100644 --- a/components/status/StatusActionsMore.vue +++ b/components/status/StatusActionsMore.vue @@ -16,6 +16,7 @@ const { toggleFavourite, togglePin, toggleReblog, + toggleMute, } = $(useStatusActions(props)) const clipboard = useClipboard() @@ -148,6 +149,15 @@ async function editStatus() { @click="copyLink(status)" /> + + Promise, countField?: CountField) { @@ -70,9 +71,15 @@ export function useStatusActions(props: StatusActionsProps) { () => masto.statuses[status.pinned ? 'unpin' : 'pin'](status.id), ) + const toggleMute = async () => toggleStatusAction( + 'muted', + () => masto.statuses[status.muted ? 'unmute' : 'mute'](status.id), + ) + return { status: $$(status), isLoading: $$(isLoading), + toggleMute, toggleReblog, toggleFavourite, toggleBookmark, diff --git a/locales/ar-EG.json b/locales/ar-EG.json index a6dc31a8..a941af69 100644 --- a/locales/ar-EG.json +++ b/locales/ar-EG.json @@ -99,6 +99,7 @@ "edit": "تعديل", "mention_account": "أذكر {0}", "mute_account": "كتم {0}", + "mute_conversation": "تجاهل هذا المنصب", "open_in_original_site": "فتح في الموقع الأصلي", "pin_on_profile": "تثبيت على حسابك الشخصي", "show_untranslated": "عرض بدون ترجمة", @@ -110,6 +111,7 @@ "unblock_account": "رفع الحظر عن {0}", "unblock_domain": "رفع الحظر عن النطاق {0}", "unmute_account": "إلغاء كتم الحساب {0}", + "unmute_conversation": "إعادة الصوت", "unpin_on_profile": "إلغاء التثبيت من الملف الشخصي" }, "nav": { diff --git a/locales/cs-CZ.json b/locales/cs-CZ.json index 52586dcf..e4128ec8 100644 --- a/locales/cs-CZ.json +++ b/locales/cs-CZ.json @@ -95,6 +95,7 @@ "edit": "Upravit", "mention_account": "Zmínit {0}", "mute_account": "Umlčet {0}", + "mute_conversation": "Umlčet příspěvek", "open_in_original_site": "Otevřít na původní stránce", "pin_on_profile": "Připíchnout na profil", "show_untranslated": "Zobrazit nepřeložené", @@ -106,6 +107,7 @@ "unblock_account": "Odblokovat {0}", "unblock_domain": "Odblokovat doménu {0}", "unmute_account": "Odmlčet {0}", + "unmute_conversation": "Přestat ignorovat příspěvek", "unpin_on_profile": "Odepnout z profilu" }, "nav": { diff --git a/locales/de-DE.json b/locales/de-DE.json index 8dab2476..84f3a3d6 100644 --- a/locales/de-DE.json +++ b/locales/de-DE.json @@ -95,6 +95,7 @@ "edit": "Bearbeiten", "mention_account": "Erwähne {0}", "mute_account": "{0} stummschalten", + "mute_conversation": "Diesem Beitrag stummschalten", "open_in_original_site": "Auf Originalseite öffnen", "pin_on_profile": "An Profil anpinnen", "show_untranslated": "Übersetzung schliessen", @@ -106,6 +107,7 @@ "unblock_account": "Entsperre {0}", "unblock_domain": "Entsperren Domain {0}", "unmute_account": "Stummschaltung von {0} aufheben", + "unmute_conversation": "Stummschaltung aufheben", "unpin_on_profile": "Von Profil lösen" }, "nav": { diff --git a/locales/en-GB.json b/locales/en-GB.json index c60a2d3f..33c83afb 100644 --- a/locales/en-GB.json +++ b/locales/en-GB.json @@ -118,6 +118,7 @@ "edit": "Edit", "mention_account": "Mention {0}", "mute_account": "Mute {0}", + "mute_conversation": "Mute this post", "open_in_original_site": "Open in original site", "pin_on_profile": "Pin on profile", "show_untranslated": "Show untranslated", @@ -129,6 +130,7 @@ "unblock_account": "Unblock {0}", "unblock_domain": "Unblock domain {0}", "unmute_account": "Unmute {0}", + "unmute_conversation": "Unmute this post", "unpin_on_profile": "Unpin on profile" }, "nav": { diff --git a/locales/en-US.json b/locales/en-US.json index 0f7a1970..264f98f1 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -118,6 +118,7 @@ "edit": "Edit", "mention_account": "Mention {0}", "mute_account": "Mute {0}", + "mute_conversation": "Mute this post", "open_in_original_site": "Open in original site", "pin_on_profile": "Pin on profile", "show_untranslated": "Show untranslated", @@ -129,6 +130,7 @@ "unblock_account": "Unblock {0}", "unblock_domain": "Unblock domain {0}", "unmute_account": "Unmute {0}", + "unmute_conversation": "Unmute this post", "unpin_on_profile": "Unpin on profile" }, "nav": { diff --git a/locales/es-ES.json b/locales/es-ES.json index cd1ccfd9..1f060a9b 100644 --- a/locales/es-ES.json +++ b/locales/es-ES.json @@ -114,6 +114,7 @@ "edit": "Editar", "mention_account": "Mencionar a {0}", "mute_account": "Silenciar a {0}", + "mute_conversation": "Silenciar publicación", "open_in_original_site": "Abrir página original", "pin_on_profile": "Fijar en tu perfil", "show_untranslated": "Mostrar original", @@ -125,6 +126,7 @@ "unblock_account": "Desbloquear a {0}", "unblock_domain": "Desbloquear dominio {0}", "unmute_account": "Dejar de silenciar a {0}", + "unmute_conversation": "Dejar de silenciar la publicación", "unpin_on_profile": "Desfijar del perfil" }, "nav": { diff --git a/locales/fr-FR.json b/locales/fr-FR.json index f8471524..be5deec0 100644 --- a/locales/fr-FR.json +++ b/locales/fr-FR.json @@ -113,6 +113,7 @@ "edit": "Éditer", "mention_account": "Mentionner {0}", "mute_account": "Mettre en sourdine {0}", + "mute_conversation": "Message muet", "open_in_original_site": "Ouvrir sur le site d'origine", "pin_on_profile": "Épingler sur le profil", "show_untranslated": "Montrer le message non-traduit", @@ -124,6 +125,7 @@ "unblock_account": "Débloquer {0}", "unblock_domain": "Débloquer le domaine {0}", "unmute_account": "Enlever la sourdine à {0}", + "unmute_conversation": "Réactiver le message", "unpin_on_profile": "Désépingler du profil" }, "nav": { diff --git a/locales/ja-JP.json b/locales/ja-JP.json index 22dab26c..11f341a1 100644 --- a/locales/ja-JP.json +++ b/locales/ja-JP.json @@ -37,10 +37,12 @@ "direct_message_account": "{0}さんにダイレクトメッセージ", "mention_account": "{0}さんにメンション", "mute_account": "{0}さんをミュート", + "mute_conversation": "ミュートポスト", "open_in_original_site": "元のサイトで開く", "unblock_account": "{0}さんのブロックを解除", "unblock_domain": "{0}のドメインブロックを解除", - "unmute_account": "{0}さんのミュートを解除" + "unmute_account": "{0}さんのミュートを解除", + "unmute_conversation": "投稿のミュートを解除" }, "nav": { "bookmarks": "ブックマーク", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 9aa78005..9146cf0f 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -109,6 +109,7 @@ "edit": "编辑", "mention_account": "提及 {0}", "mute_account": "屏蔽 {0}", + "mute_conversation": "静音帖子", "open_in_original_site": "从源站打开", "pin_on_profile": "置顶在个人资料上", "show_untranslated": "显示原文", @@ -120,6 +121,7 @@ "unblock_account": "解除拉黑 {0}", "unblock_domain": "解除拉黑域名 {0}", "unmute_account": "解除屏蔽 {0}", + "unmute_conversation": "取消静音帖子", "unpin_on_profile": "取消置顶" }, "nav": {