diff options
author | Starfall <us@starfall.systems> | 2022-04-26 10:41:24 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2022-04-26 10:41:24 -0500 |
commit | fd98fd86128a5cea302b8496b6c7d5464ec1958a (patch) | |
tree | f3e304a32bed75cb8ab6b1f38652192bff71c5f1 /app/lib | |
parent | 8da73d2e57284c765b232bfc6842a7ac0f0a702b (diff) | |
parent | a481af15a9b2a7829c2a849906aa4b475ccdbd98 (diff) |
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/feed_manager.rb | 2 | ||||
-rw-r--r-- | app/lib/search_query_transformer.rb | 8 | ||||
-rw-r--r-- | app/lib/user_settings_decorator.rb | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 02ecb403d..b35ae4f22 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -268,7 +268,7 @@ class FeedManager account.following.includes(:account_stat).find_each do |target_account| if redis.zcard(timeline_key) >= limit oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i - last_status_score = Mastodon::Snowflake.id_at(account.last_status_at) + last_status_score = Mastodon::Snowflake.id_at(target_account.last_status_at) # If the feed is full and this account has not posted more recently # than the last item on the feed, then we can skip the whole account diff --git a/app/lib/search_query_transformer.rb b/app/lib/search_query_transformer.rb index c685d7b6f..aef05e9d9 100644 --- a/app/lib/search_query_transformer.rb +++ b/app/lib/search_query_transformer.rb @@ -88,14 +88,14 @@ class SearchQueryTransformer < Parslet::Transform case prefix when 'from' @filter = :account_id - username, domain = term.split('@') - account = Account.find_remote(username, domain) - raise "Account not found: #{term}" unless account + username, domain = term.gsub(/\A@/, '').split('@') + domain = nil if TagManager.instance.local_domain?(domain) + account = Account.find_remote!(username, domain) @term = account.id else - raise "Unknown prefix: #{prefix}" + raise Mastodon::SyntaxError end end end diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index d8015e50d..d339e078c 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -43,6 +43,7 @@ class UserSettingsDecorator user.settings['use_pending_items'] = use_pending_items_preference if change?('setting_use_pending_items') user.settings['trends'] = trends_preference if change?('setting_trends') user.settings['crop_images'] = crop_images_preference if change?('setting_crop_images') + user.settings['always_send_emails'] = always_send_emails_preference if change?('setting_always_send_emails') end def merged_notification_emails @@ -157,6 +158,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_crop_images' end + def always_send_emails_preference + boolean_cast_setting 'setting_always_send_emails' + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end |