Progress on little important things

removing .mov for now until we can figure out solution with videojs, added model to track username changes, got chat creation flow down, progress on bookmark collections, albums, filtering blocks/mutes from group, explore, collection timelines
This commit is contained in:
mgabdev
2020-12-22 01:36:38 -05:00
parent 2bbb5be505
commit 6fbea0a59e
37 changed files with 406 additions and 135 deletions

View File

@@ -20,7 +20,7 @@ class Api::V1::ChatConversationController < Api::BaseController
def create
chat_conversation_account = find_or_create_conversation
render json: chat_conversation_account, each_serializer: REST::ChatConversationAccountSerializer
render json: chat_conversation_account, serializer: REST::ChatConversationAccountSerializer
end
def mark_chat_conversation_read

View File

@@ -45,7 +45,11 @@ class Api::V1::Timelines::ExploreController < EmptyController
end
def explore_statuses
SortingQueryBuilder.new.call(@sort_type, params[:max_id])
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id]).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id])
end
end
def insert_pagination_headers

View File

@@ -70,7 +70,11 @@ class Api::V1::Timelines::GroupCollectionController < EmptyController
return []
end
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @groupIds)
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @groupIds).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @groupIds)
end
end
def insert_pagination_headers

View File

@@ -51,7 +51,12 @@ class Api::V1::Timelines::GroupController < Api::BaseController
end
def group_statuses
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @group)
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @group).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @group)
end
end
def insert_pagination_headers

View File

@@ -36,6 +36,13 @@ class EmptyController < ActionController::Base
protected
def set_pagination_headers(next_path = nil, prev_path = nil)
links = []
links << [next_path, [%w(rel next)]] if next_path
links << [prev_path, [%w(rel prev)]] if prev_path
response.headers['Link'] = LinkHeader.new(links) unless links.empty?
end
def current_user
nil
end

View File

@@ -24,11 +24,12 @@ class Settings::ProfilesController < Settings::BaseController
flash[:alert] = 'Unable to change username for your account. You are not GabPRO'
redirect_to settings_profile_path
else
# : todo :
# only allowed to change username once per day
if params[:account][:username] && @account.username != params[:account][:username]
Redis.current.set("username_change:#{account.id}", true)
Redis.current.expire("username_change:#{account.id}", 24.huors.seconds)
if @account.username != params[:account][:username]
AccountUsernameChange.create!(
account: @account,
from_username: @account.username,
to_username: params[:account][:username]
)
end
if UpdateAccountService.new.call(@account, account_params)