Fix full-text search query quotation, improve tag search performance with an index,
add ability to open status by URL from search (fix #53)
This commit is contained in:
@ -1,8 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class FetchRemoteAccountService < BaseService
|
||||
def call(url)
|
||||
atom_url, body = FetchAtomService.new.call(url)
|
||||
def call(url, prefetched_body = nil)
|
||||
if prefetched_body.nil?
|
||||
atom_url, body = FetchAtomService.new.call(url)
|
||||
else
|
||||
atom_url = url
|
||||
body = prefetched_body
|
||||
end
|
||||
|
||||
return nil if atom_url.nil?
|
||||
process_atom(atom_url, body)
|
||||
|
@ -10,9 +10,9 @@ class FetchRemoteResourceService < BaseService
|
||||
xml.encoding = 'utf-8'
|
||||
|
||||
if xml.root.name == 'feed'
|
||||
FetchRemoteAccountService.new.call(atom_url)
|
||||
FetchRemoteAccountService.new.call(atom_url, body)
|
||||
elsif xml.root.name == 'entry'
|
||||
FetchRemoteStatusService.new.call(atom_url)
|
||||
FetchRemoteStatusService.new.call(atom_url, body)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class FetchRemoteStatusService < BaseService
|
||||
def call(url)
|
||||
atom_url, body = FetchAtomService.new.call(url)
|
||||
def call(url, prefetched_body = nil)
|
||||
if prefetched_body.nil?
|
||||
atom_url, body = FetchAtomService.new.call(url)
|
||||
else
|
||||
atom_url = url
|
||||
body = prefetched_body
|
||||
end
|
||||
|
||||
return nil if atom_url.nil?
|
||||
process_atom(atom_url, body)
|
||||
|
Reference in New Issue
Block a user