diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-12-07 12:28:59 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-12-07 12:28:59 +0100 |
commit | abcba5c19885f789557fe1fa62dba7f176d9afe6 (patch) | |
tree | 67628941bd27b7887f92ae758db7d81f34823e62 /app/services | |
parent | 7d59e25fbd7a0209c11cbe6aac4400bbca4de82b (diff) | |
parent | 6d7daf6154b1edbfe9a0c0b297baab8cd45658f3 (diff) |
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.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/account_search_service.rb | 4 | ||||
-rw-r--r-- | app/services/notify_service.rb | 2 | ||||
-rw-r--r-- | app/services/search_service.rb | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb index 7e74cc893..d217dabb3 100644 --- a/app/services/account_search_service.rb +++ b/app/services/account_search_service.rb @@ -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 diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index b5c721589..9364a6ae8 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -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 diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 3a498dcf4..090fd409b 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -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? |