diff options
author | cmrd Senya <35317-cmrd-senya@users.noreply.gitlab.gnome.org> | 2022-09-04 22:52:15 +0300 |
---|---|---|
committer | cmrd Senya <35317-cmrd-senya@users.noreply.gitlab.gnome.org> | 2022-09-04 23:15:30 +0300 |
commit | 93d61c7f2166acf8f8fa25f07123afdc444534a9 (patch) | |
tree | 5694a9ca15d71280fba9d53d42a4884fb53f424e | |
parent | 1c064e016f4d1d1657778fcc739df8cd25919d76 (diff) |
Use federation code for fetching public posts on search
-rw-r--r-- | lib/diaspora/fetcher/public.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/diaspora/fetcher/public.rb b/lib/diaspora/fetcher/public.rb index 03530167a..70a159bf5 100644 --- a/lib/diaspora/fetcher/public.rb +++ b/lib/diaspora/fetcher/public.rb @@ -104,16 +104,13 @@ module Diaspora; module Fetcher; class Public logger.debug "post: #{post.to_s[0..250]}" - entry = StatusMessage.diaspora_initialize( - author: @person, - public: true, - guid: post["guid"], - text: post["text"], - provider_display_name: post["provider_display_name"], - created_at: ActiveSupport::TimeZone.new("UTC").parse(post["created_at"]).to_datetime, + DiasporaFederation::Federation::Fetcher.fetch_public( + @person.diaspora_handle, + :post, + post["guid"] ) - entry.save - + rescue DiasporaFederation::Federation::Fetcher::NotFetchable => e + logger.debug e.message end set_fetch_status Public::Status_Processed end |