about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-07 22:43:28 +0100
committerGitHub <noreply@github.com>2022-01-07 22:43:28 +0100
commit5b185b05f10f280bb2059920dfdb2b7f3d6f7d91 (patch)
treed5ba55bf888811115f48d34b52485748e21ea039 /app
parente2933854ac598c5ee7428a654a72cf4f4bd9afea (diff)
parentaf86c7a5ded69cf8aee3ff70504c383155e40fde (diff)
Merge pull request #1655 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app')
-rw-r--r--app/javascript/flavours/glitch/actions/importer/normalizer.js2
-rw-r--r--app/javascript/mastodon/actions/importer/normalizer.js2
-rw-r--r--app/services/purge_domain_service.rb1
3 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js
index 9b3bd0d56..3995585f6 100644
--- a/app/javascript/flavours/glitch/actions/importer/normalizer.js
+++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js
@@ -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;
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index 5002292b9..6b79e1f16 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -71,7 +71,7 @@ export function normalizeStatus(status, normalOldStatus) {
     }
 
     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;
diff --git a/app/services/purge_domain_service.rb b/app/services/purge_domain_service.rb
index e10a8f0c8..9df81f13e 100644
--- a/app/services/purge_domain_service.rb
+++ b/app/services/purge_domain_service.rb
@@ -5,6 +5,7 @@ class PurgeDomainService < BaseService
     Account.remote.where(domain: domain).reorder(nil).find_each do |account|
       DeleteAccountService.new.call(account, reserve_username: false, skip_side_effects: true)
     end
+    CustomEmoji.remote.where(domain: domain).reorder(nil).find_each(&:destroy)
     Instance.refresh
   end
 end