]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix media descriptions not being used for client-side filtering
authorClaire <claire.github-309c@sitedethib.com>
Tue, 28 Dec 2021 22:25:50 +0000 (23:25 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Fri, 7 Jan 2022 18:54:58 +0000 (19:54 +0100)
Port 37e80994f81bdb07e31f1a55cd37c967822a1a2a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/actions/importer/normalizer.js

index 9b3bd0d56f956a78b4c3dc5afca16fcd3e73042b..3995585f6c6f51ac39ac40b7aa915330fe6705ea 100644 (file)
@@ -62,7 +62,7 @@ export function normalizeStatus(status, normalOldStatus) {
     normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
   } else {
     const spoilerText   = normalStatus.spoiler_text || '';
-    const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
+    const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
     const emojiMap      = makeEmojiMap(normalStatus);
 
     normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;