From: ThibG Date: Wed, 15 Nov 2017 00:06:49 +0000 (+0100) Subject: Use already-known remote user data if resolving temporarily fails in mentions (#5702) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=1c25853842075f88e3b6ed28decba3907d548f2e;p=mastodon.git Use already-known remote user data if resolving temporarily fails in mentions (#5702) --- diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index c1ff68209..a229d4ff8 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)