Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into develop
This commit is contained in:
@@ -10,6 +10,7 @@ class Auth::SessionsController < Devise::SessionsController
|
||||
prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
|
||||
before_action :set_instance_presenter, only: [:new]
|
||||
before_action :set_body_classes
|
||||
before_action :use_master
|
||||
|
||||
def new
|
||||
Devise.omniauth_configs.each do |provider, config|
|
||||
@@ -35,6 +36,10 @@ class Auth::SessionsController < Devise::SessionsController
|
||||
|
||||
protected
|
||||
|
||||
def use_master
|
||||
User.connection.stick_to_master!
|
||||
end
|
||||
|
||||
def find_user
|
||||
if session[:otp_user_id]
|
||||
User.find(session[:otp_user_id])
|
||||
|
||||
@@ -291,7 +291,11 @@ class Status < ApplicationRecord
|
||||
|
||||
def as_home_timeline(account)
|
||||
query = where('created_at > ?', 10.days.ago)
|
||||
query.where(visibility: [:public, :unlisted, :private])
|
||||
query.where(visibility: [:public, :unlisted]).or(
|
||||
where(visibility: [:private]).where('group is null')
|
||||
).or(
|
||||
where(visibility: [:private]).where(group: account.groups)
|
||||
)
|
||||
query.where(account: [account] + account.following).without_replies
|
||||
end
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class PostStatusService < BaseService
|
||||
|
||||
raise GabSocial::ValidationError, I18n.t('media_attachments.validations.too_many') if @options[:media_ids].size > 4 || @options[:poll].present?
|
||||
|
||||
# @account.media_attachments.connection.stick_to_master!
|
||||
@account.media_attachments.connection.stick_to_master!
|
||||
@media = @account.media_attachments.where(status_id: nil).where(id: @options[:media_ids].take(4).map(&:to_i))
|
||||
|
||||
hasVideoOrGif = @media.find(&:video?) || @media.find(&:gifv?)
|
||||
|
||||
Reference in New Issue
Block a user