From 79cf9b9be7f3197861f1d26f0591f864ef908c12 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Thu, 28 Dec 2023 13:34:11 -0700 Subject: [PATCH] fedimbed: fix another gts moment (emotes not being array) --- src/modules/fedimbed.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index ea8b635..e16734b 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -408,10 +408,14 @@ async function processUrl(msg, url, spoiler = false) { cw = postData.summary; timestamp = postData.published; - if (postData.tag) - emotes = postData.tag + if (postData.tag) { + let tag = postData.tag; + // gts moment + if (!Array.isArray(tag)) tag = [tag]; + emotes = tag .filter((x) => !!x.icon) .map((x) => ({name: x.name, url: x.icon.url})); + } // NB: gts doesnt send singular attachments as areay const attachments = Array.isArray(postData.attachment)