From 4531b67c3e663033e67f0b023fe825a2b30088c9 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 15 Nov 2017 01:06:49 +0100 Subject: [PATCH] Use already-known remote user data if resolving temporarily fails in mentions (#5702) --- app/services/process_mentions_service.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index c1ff682090..a229d4ff86 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -17,6 +17,11 @@ class ProcessMentionsService < BaseService mentioned_account = nil end + if mentioned_account.nil? + username, domain = match.first.split('@') + mentioned_account = Account.find_remote(username, domain) + end + next match if mentioned_account.nil? || (!mentioned_account.local? && mentioned_account.ostatus? && status.stream_entry.hidden?) mentioned_account.mentions.where(status: status).first_or_create(status: status)