Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into feature/removing_ruby_junk

This commit is contained in:
mgabdev
2020-11-25 16:43:09 -06:00
11 changed files with 66 additions and 30 deletions

View File

@@ -18,6 +18,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
def set_list
@list = List.where(account: current_account).find(params[:id])
@accounts = ListAccount.select('account_id').where(list_id: @list)
end
def set_statuses
@@ -29,16 +30,14 @@ class Api::V1::Timelines::ListController < Api::BaseController
end
def list_statuses
list_feed.get(
statuses = Status.where(
account: @accounts, reply: false
).where(
'updated_at > ?', 10.days.ago
).paginate_by_id(
limit_param(DEFAULT_STATUSES_LIMIT),
params[:max_id],
params[:since_id],
params[:min_id]
)
end
def list_feed
ListFeed.new(@list)
params_slice(:max_id, :since_id, :min_id)
).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
end
def insert_pagination_headers

View File

@@ -98,8 +98,8 @@ class EditProfileModal extends ImmutablePureComponent {
if (account.get('avatar_static') !== avatarSrc) obj.avatar = avatarSrc
if (account.get('header_static') !== headerSrc) obj.header = headerSrc
this.props.onSave(obj)
this.handleOnClose()
this.props.onSave(obj, this.handleOnClose)
//this.handleOnClose()
}
render() {
@@ -210,7 +210,7 @@ const mapStateToProps = (state) => ({
})
const mapDispatchToProps = (dispatch) => ({
onSave: (data) => dispatch(saveUserProfileInformation(data)),
onSave: (data, closer) => dispatch(saveUserProfileInformation(data, closer)),
})
EditProfileModal.propTypes = {

View File

@@ -56,12 +56,14 @@ class GroupTimelineSortTopOptionsPopover extends React.PureComponent {
title: intl.formatMessage(messages.topYearTitle),
onClick: () => this.handleOnClick(GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_YEARLY),
},
/*
{
hideArrow: true,
isActive: sortByTopValue === GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_ALL_TIME,
title: intl.formatMessage(messages.topAllTitle),
onClick: () => this.handleOnClick(GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_ALL_TIME),
},
*/
]
return (

View File

@@ -19,6 +19,7 @@ export default function (state = initialState, action) {
case SAVE_USER_PROFILE_INFORMATION_FETCH_SUCCESS:
return state
case SAVE_USER_PROFILE_INFORMATION_FETCH_FAIL:
alert('Failed to update your profile. Max profile image size is 2MB. Please update and try again.')
return state.set('isError', true)
case RESEND_USER_CONFIRMATION_EMAIL_SUCCESS:
return state.set('emailConfirmationResends', state.get('emailConfirmationResends') + 1)

View File

@@ -90,7 +90,7 @@ class Status < ApplicationRecord
default_scope { recent }
scope :recent, -> { reorder(created_at: :desc) }
scope :recent, -> { reorder(updated_at: :desc) }
scope :remote, -> { where(local: false).or(where.not(uri: nil)) }
scope :local, -> { where(local: true).or(where(uri: nil)) }
@@ -290,13 +290,14 @@ class Status < ApplicationRecord
end
def as_home_timeline(account)
query = where('updated_at > ?', 30.days.ago)
query = where('updated_at > ?', 5.days.ago)
query.where(visibility: [:public, :unlisted, :private])
query.where(account: [account] + account.following).without_replies
end
def as_group_timeline(group)
where(group: group).without_replies
query = where('updated_at > ?', 5.days.ago)
query.where(group: group).without_replies
end
def as_group_collection_timeline(groupIds)

View File

@@ -2,8 +2,16 @@
class FanOutOnWriteService < BaseService
# Push a status into home and mentions feeds
# @param [Status] status
def call(status)
deliver_to_self(status) if status.account.local?
raise GabSocial::RaceConditionError if status.visibility.nil?
if status.direct_visibility? || status.limited_visibility?
#
else
deliver_to_self(status) if status.account.local?
end
end
private