Use already-known remote user data if resolving temporarily fails in mentions (#5702)

lolsob-rspec
ThibG 2017-11-15 01:06:49 +01:00 committed by Eugen Rochko
parent a71791e3f1
commit 4531b67c3e
1 changed files with 5 additions and 0 deletions

View File

@ -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)