Use federation code for fetching public posts on search
This commit is contained in:
parent
1c064e016f
commit
93d61c7f21
1 changed files with 6 additions and 9 deletions
|
|
@ -104,16 +104,13 @@ module Diaspora; module Fetcher; class Public
|
||||||
|
|
||||||
logger.debug "post: #{post.to_s[0..250]}"
|
logger.debug "post: #{post.to_s[0..250]}"
|
||||||
|
|
||||||
entry = StatusMessage.diaspora_initialize(
|
DiasporaFederation::Federation::Fetcher.fetch_public(
|
||||||
author: @person,
|
@person.diaspora_handle,
|
||||||
public: true,
|
:post,
|
||||||
guid: post["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,
|
|
||||||
)
|
)
|
||||||
entry.save
|
rescue DiasporaFederation::Federation::Fetcher::NotFetchable => e
|
||||||
|
logger.debug e.message
|
||||||
end
|
end
|
||||||
set_fetch_status Public::Status_Processed
|
set_fetch_status Public::Status_Processed
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue