From 860d6edc7b0adbea7849c815c4c8404dd8b5095e Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 5 Sep 2023 18:56:28 +0000 Subject: [PATCH] HideAttachments: allow hiding stickers (#13) Self explanatory Reviewed-on: https://codeberg.org/Ven/cord/pulls/13 Co-authored-by: Luna Co-committed-by: Luna --- src/plugins/hideAttachments.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/hideAttachments.tsx b/src/plugins/hideAttachments.tsx index f608e05a2..36c34e464 100644 --- a/src/plugins/hideAttachments.tsx +++ b/src/plugins/hideAttachments.tsx @@ -49,7 +49,7 @@ export default definePlugin({ await this.buildCss(); addButton("HideAttachments", msg => { - if (!msg.attachments.length && !msg.embeds.length) return null; + if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length) return null; const isHidden = hiddenMessages.has(msg.id); @@ -72,7 +72,7 @@ export default definePlugin({ async buildCss() { const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(","); style.textContent = ` - :is(${elements}) [class*="embedWrapper"] { + :is(${elements}) :is([class*="embedWrapper", [class*"clickableSticker"]) { /* important is not necessary, but add it to make sure bad themes won't break it */ display: none !important; }