Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - package.json Not really a conflict, caused by an additional dependency in glitch-soc. - yarn.lock Not really a conflict, caused by an additional dependency in glitch-soc.
This commit is contained in:
@@ -4,8 +4,8 @@ class AccountSearchService < BaseService
|
||||
attr_reader :query, :limit, :offset, :options, :account
|
||||
|
||||
def call(query, account = nil, options = {})
|
||||
@acct_hint = query.start_with?('@')
|
||||
@query = query.strip.gsub(/\A@/, '')
|
||||
@acct_hint = query&.start_with?('@')
|
||||
@query = query&.strip&.gsub(/\A@/, '')
|
||||
@limit = options[:limit].to_i
|
||||
@offset = options[:offset].to_i
|
||||
@options = options
|
||||
|
@@ -9,7 +9,7 @@ class NotifyService < BaseService
|
||||
return if recipient.user.nil? || blocked?
|
||||
|
||||
create_notification!
|
||||
push_notification! if @notification.browserable?
|
||||
push_notification!
|
||||
push_to_conversation! if direct_message?
|
||||
send_email! if email_enabled?
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
class SearchService < BaseService
|
||||
def call(query, account, limit, options = {})
|
||||
@query = query.strip
|
||||
@query = query&.strip
|
||||
@account = account
|
||||
@options = options
|
||||
@limit = limit.to_i
|
||||
@@ -10,6 +10,8 @@ class SearchService < BaseService
|
||||
@resolve = options[:resolve] || false
|
||||
|
||||
default_results.tap do |results|
|
||||
next if @query.blank?
|
||||
|
||||
if url_query?
|
||||
results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
|
||||
elsif @query.present?
|
||||
|
Reference in New Issue
Block a user