include DomainMaterializable
include AccountMerging
- TRUST_LEVELS = {
- untrusted: 0,
- trusted: 1,
- }.freeze
-
+ MAX_DISPLAY_NAME_LENGTH = (ENV['MAX_DISPLAY_NAME_CHARS'] || 30).to_i
+ MAX_NOTE_LENGTH = (ENV['MAX_BIO_CHARS'] || 500).to_i
+ MAX_FIELDS = (ENV['MAX_PROFILE_FIELDS'] || 4).to_i
+
enum protocol: [:ostatus, :activitypub]
enum suspension_origin: [:local, :remote], _prefix: true
# account_id :bigint(8) not null
# application_id :bigint(8)
# in_reply_to_account_id :bigint(8)
+# local_only :boolean
+# full_status_text :text default(""), not null
# poll_id :bigint(8)
+# content_type :string
# deleted_at :datetime
# edited_at :datetime
+ # trendable :boolean
#
class Status < ApplicationRecord
reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit])
- Trends.tags.register(reblog)
- Trends.links.register(reblog)
+ Trends.register!(reblog)
DistributionWorker.perform_async(reblog.id)
- ActivityPub::DistributionWorker.perform_async(reblog.id)
+ ActivityPub::DistributionWorker.perform_async(reblog.id) unless reblogged_status.local_only?
create_notification(reblog)
bump_potential_friendship(account, reblog)
- content_for :page_title do
= t('admin.trends.links.title')
- .filters
- .filter-subset
- %strong= t('admin.trends.trending')
- %ul
- %li= filter_link_to t('generic.all'), trending: nil
- %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed'
- .back-link
- = link_to admin_trends_links_preview_card_providers_path do
- = t('admin.trends.preview_card_providers.title')
- = fa_icon 'chevron-right fw'
-- content_for :header_tags do
- = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
-
+ = form_tag admin_trends_links_path, method: 'GET', class: 'simple_form' do
+ - Trends::PreviewCardFilter::KEYS.each do |key|
+ = hidden_field_tag key, params[key] if params[key].present?
- %hr.spacer/
+ .filters
+ .filter-subset.filter-subset--with-select
+ %strong= t('admin.follow_recommendations.language')
+ .input.select.optional
+ = select_tag :locale, options_for_select(Trends.available_locales.map { |key| [standard_locale_name(key), key] }, params[:locale]), include_blank: true
+ .filter-subset
+ %strong= t('admin.trends.trending')
+ %ul
+ %li= filter_link_to t('generic.all'), trending: nil
+ %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed'
+ .back-link
+ = link_to admin_trends_links_preview_card_providers_path do
+ = t('admin.trends.preview_card_providers.title')
+ = fa_icon 'chevron-right fw'
= form_for(@form, url: batch_admin_trends_links_path) do |f|
= hidden_field_tag :page, params[:page] || 1
t.bigint "account_id", null: false
t.bigint "application_id"
t.bigint "in_reply_to_account_id"
+ t.boolean "local_only"
t.bigint "poll_id"
+ t.string "content_type"
t.datetime "deleted_at"
t.datetime "edited_at"
+ t.boolean "trendable"
t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)"
t.index ["deleted_at"], name: "index_statuses_on_deleted_at", where: "(deleted_at IS NOT NULL)"
t.index ["id", "account_id"], name: "index_statuses_local_20190824", order: { id: :desc }, where: "((local OR (uri IS NULL)) AND (deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))"