about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-22 21:10:36 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-22 21:10:36 +0200
commitb1a670af8d098c33a8938662f5c0bd60674ea683 (patch)
tree9fe4a0fce5df85e7364e514be860649f7111233a /app/services
parent2a84271e85564928c4b5e241d7d3bde69fef40ed (diff)
Handle remote account mentions a little better by trying a URL lookup in the db
Diffstat (limited to 'app/services')
-rw-r--r--app/services/process_feed_service.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 975223300..5e760bc75 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -69,9 +69,12 @@ class ProcessFeedService < BaseService
         end
       else
         # What to do about remote user?
-        # Are we supposed to do a search in the database by URL?
-        # We could technically open the URL, look for LRDD tags, get webfinger that way,
-        # finally acquire the acct:username@domain form, and then check DB
+        # This is kinda dodgy because URLs could change, we don't index them
+        mentioned_account = Account.find_by(url: href.to_s)
+
+        unless mentioned_account.nil?
+          mentioned_account.mentions.where(status: status).first_or_create(status: status)
+        end
       end
     end
   end