Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAM-3450-private-messages-viewable-in-smart-list #225

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/lib/mammoth/channels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def filter_statuses_with_threshold
end

def statuses_from_channels(account_ids)
Status.where(account_id: account_ids,
created_at: (GO_BACK.hours.ago)..Time.current)
Status.with_public_visibility.where(account_id: account_ids,
created_at: (GO_BACK.hours.ago)..Time.current)
end

# Check status for Channel's set level of engagment
Expand Down
4 changes: 2 additions & 2 deletions app/lib/mammoth/curated_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def curated_list_statuses
def statuses_from_list(account_ids)
cache_key = 'mammoth_picks:statuses'
Rails.cache.fetch(cache_key, expires_in: 120.seconds) do
statuses = Status.where(account_id: account_ids,
created_at: (GO_BACK.hours.ago)..Time.current).to_a
statuses = Status.with_public_visibility.where(account_id: account_ids,
created_at: (GO_BACK.hours.ago)..Time.current).to_a

statuses.filter_map { |s| engagment_threshold(s) }.pluck(:id, :account_id).map { |id, account_id| { id: id, account_id: account_id } }
end
Expand Down
4 changes: 2 additions & 2 deletions app/lib/personal_for_you.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def statuses_for_indirect_follows(account_handle)
Rails.logger.debug { "INDIRECT FOLLOW RECOMMENDATIONS USERNAMES\n #{username_query}" }
Rails.logger.debug { "INDIRECT FOLLOW RECOMMENDATIONS ACCOUNT_IDS\n #{account_ids}" }
# Get Statuses for those accounts
Status.where(account_id: account_ids, updated_at: 12.hours.ago..Time.current).limit(200)
Status.with_public_visibility.where(account_id: account_ids, updated_at: 12.hours.ago..Time.current).limit(200)
end

# Get All registered users from AcctRely
Expand Down Expand Up @@ -156,7 +156,7 @@ def statuses_for_direct_follows(acct)
# Array of account id's from fedi_account_handles
account_ids = Account.where(username: username_query, domain: domain_query).pluck(:id)
# Get Statuses for those accounts
Status.where(account_id: account_ids, updated_at: 12.hours.ago..Time.current).limit(200)
Status.with_public_visibility.where(account_id: account_ids, updated_at: 12.hours.ago..Time.current).limit(200)
end

# Get enabled channels with full accounts
Expand Down