accounts approved, video player testing, bookmark collections
This commit is contained in:
mgabdev 2020-12-17 01:34:00 -05:00
parent 04053c0e31
commit 5a37a7090e
88 changed files with 688 additions and 395 deletions

View File

@ -80,6 +80,10 @@ class Api::BaseController < ApplicationController
# : todo : when figure out email/catpcha, put this back
# elsif !current_user.confirmed?
# render json: { error: 'Your login is missing a confirmed e-mail address' }, status: 403
elsif current_user.account.is_flagged_as_spam?
render json: { error: 'Your account has been flagged as spam. Please contact support@gab.com if you believe this is an error.' }, status: 403
elsif !current_user.approved?
render json: { error: 'Your login is currently pending approval' }, status: 403
else
set_user_activity
end

View File

@ -10,6 +10,7 @@ class Api::V1::AccountsController < Api::BaseController
before_action :require_user!, except: [:show, :create]
before_action :set_account, except: [:create]
before_action :check_account_suspension, only: [:show]
before_action :check_enabled_registrations, only: [:create]
def show
render json: @account, serializer: REST::AccountSerializer
@ -75,4 +76,12 @@ class Api::V1::AccountsController < Api::BaseController
def account_params
params.permit(:username, :email, :password, :agreement, :locale)
end
def check_enabled_registrations
forbidden if single_user_mode? || !allowed_registrations?
end
def allowed_registrations?
Setting.registrations_mode != 'none'
end
end

View File

@ -1,16 +1,17 @@
# frozen_string_literal: true
class Api::V1::BookmarksController < Api::BaseController
class Api::V1::BookmarkCollections::BookmarksController < Api::BaseController
before_action -> { doorkeeper_authorize! :read, :'read:bookmarks' }
before_action :require_user!
after_action :insert_pagination_headers
def index
@statuses = []
if current_account.is_pro
@statuses = load_statuses
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
else
render json: { error: 'You need to be a GabPRO member to access this' }, status: 422
end
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
end
private
@ -42,11 +43,11 @@ class Api::V1::BookmarksController < Api::BaseController
end
def next_path
api_v1_bookmarks_url pagination_params(max_id: pagination_max_id) if records_continue?
api_v1_bookmark_collection_bookmarks_url pagination_params(max_id: pagination_max_id) if records_continue?
end
def prev_path
api_v1_bookmarks_url pagination_params(since_id: pagination_since_id) unless results.empty?
api_v1_bookmark_collection_bookmarks_url pagination_params(since_id: pagination_since_id) unless results.empty?
end
def pagination_max_id

View File

@ -3,24 +3,24 @@
class Api::V1::BookmarkCollectionsController < Api::BaseController
before_action :require_user!
before_action :set_bookmark_collections, only: :index
before_action :set_bookmark_collection, only: [:show, :update, :destroy]
before_action :set_bookmark_collection, only: [:show, :update, :destroy, :update_status]
def index
render json: @bookmark_collections, each_serializer: REST::BookmarkCollectionSerializer
render json: @bookmark_collections, each_serializer: REST::StatusBookmarkCollectionSerializer
end
def create
@bookmark_collection = "" #current_account.custom_filters.create!(resource_params)
render json: @bookmark_collection, serializer: REST::BookmarkCollectionSerializer
@bookmark_collection = current_account.status_bookmark_collections.create!(resource_params)
render json: @bookmark_collection, serializer: REST::StatusBookmarkCollectionSerializer
end
def show
render json: @bookmark_collection, serializer: REST::BookmarkCollectionSerializer
render json: @bookmark_collection, serializer: REST::StatusBookmarkCollectionSerializer
end
def update
@bookmark_collection.update!(resource_params)
render json: @bookmark_collection, serializer: REST::BookmarkCollectionSerializer
render json: @bookmark_collection, serializer: REST::StatusBookmarkCollectionSerializer
end
def destroy
@ -28,14 +28,18 @@ class Api::V1::BookmarkCollectionsController < Api::BaseController
render_empty_success
end
def update_status
#
end
private
def set_bookmark_collections
@bookmark_collections = "" #current_account.custom_filters
@bookmark_collections = current_account.status_bookmark_collections
end
def set_bookmark_collection
@bookmark_collection = "" # current_account.custom_filters.find(params[:id])
@bookmark_collection = current_account.status_bookmark_collections.find(params[:id])
end
def resource_params

View File

@ -4,6 +4,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
layout :determine_layout
before_action :set_challenge, only: [:new]
before_action :check_enabled_registrations, only: [:new, :create]
before_action :configure_sign_up_params, only: [:create]
before_action :set_sessions, only: [:edit, :update]
before_action :set_instance_presenter, only: [:new, :create, :update]
@ -90,4 +91,13 @@ class Auth::RegistrationsController < Devise::RegistrationsController
def set_cache_headers
response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
end
def check_enabled_registrations
redirect_to root_path if single_user_mode? || !allowed_registrations?
end
def allowed_registrations?
Setting.registrations_mode != 'none'
end
end

View File

@ -3,7 +3,7 @@
class ManifestsController < EmptyController
def show
render json: InstancePresenter.new, serializer: ManifestSerializer
render json: {} #InstancePresenter.new, serializer: ManifestSerializer
end
end

View File

@ -104,4 +104,17 @@ module ApplicationHelper
# : todo :
return 'white'
end
def open_registrations?
Setting.registrations_mode == 'open'
end
def approved_registrations?
Setting.registrations_mode == 'approved'
end
def closed_registrations?
Setting.registrations_mode == 'none'
end
end

View File

@ -1 +1,16 @@
//
import api, { getLinks } from '../api'
import { me } from '../initial_state'
//
export const ALBUMS_FETCH_REQUEST = 'ALBUMS_FETCH_REQUEST'
export const ALBUMS_FETCH_SUCCESS = 'ALBUMS_FETCH_SUCCESS'
export const ALBUMS_FETCH_FAIL = 'ALBUMS_FETCH_FAIL'
export const ALBUMS_CREATE_REQUEST = 'ALBUMS_CREATE_REQUEST'
export const ALBUMS_CREATE_SUCCESS = 'ALBUMS_CREATE_SUCCESS'
export const ALBUMS_CREATE_FAIL = 'ALBUMS_CREATE_FAIL'
export const ALBUMS_REMOVE_REQUEST = 'ALBUMS_REMOVE_REQUEST'
export const ALBUMS_REMOVE_SUCCESS = 'ALBUMS_REMOVE_SUCCESS'
export const ALBUMS_REMOVE_FAIL = 'ALBUMS_REMOVE_FAIL'

View File

@ -40,13 +40,13 @@ export const UPDATE_BOOKMARK_COLLECTION_STATUS_SUCCESS = 'UPDATE_BOOKMARK_COLLEC
export const fetchBookmarkedStatuses = (bookmarkCollectionId) => (dispatch, getState) => {
if (!me) return
if (getState().getIn(['status_lists', 'bookmarks', 'isLoading'])) {
if (getState().getIn(['status_lists', 'bookmarks', bookmarkCollectionId, 'isLoading'])) {
return
}
dispatch(fetchBookmarkedStatusesRequest(bookmarkCollectionId))
api(getState).get('/api/v1/bookmarks').then((response) => {
api(getState).get(`/api/v1/bookmark_collections/${bookmarkCollectionId}/bookmarks`).then((response) => {
const next = getLinks(response).refs.find(link => link.rel === 'next')
dispatch(importFetchedStatuses(response.data))
dispatch(fetchBookmarkedStatusesSuccess(response.data, bookmarkCollectionId, next ? next.uri : null))
@ -57,6 +57,7 @@ export const fetchBookmarkedStatuses = (bookmarkCollectionId) => (dispatch, getS
const fetchBookmarkedStatusesRequest = (bookmarkCollectionId) => ({
type: BOOKMARKED_STATUSES_FETCH_REQUEST,
bookmarkCollectionId,
})
const fetchBookmarkedStatusesSuccess = (statuses, bookmarkCollectionId, next) => ({
@ -98,10 +99,12 @@ export const expandBookmarkedStatuses = (bookmarkCollectionId) => (dispatch, get
const expandBookmarkedStatusesRequest = (bookmarkCollectionId) => ({
type: BOOKMARKED_STATUSES_EXPAND_REQUEST,
bookmarkCollectionId,
})
const expandBookmarkedStatusesSuccess = (statuses, bookmarkCollectionId, next) => ({
type: BOOKMARKED_STATUSES_EXPAND_SUCCESS,
bookmarkCollectionId,
statuses,
next,
})
@ -213,7 +216,7 @@ export const updateBookmarkCollection = (bookmarkCollectionId, title) => (dispat
dispatch(updateBookmarkCollectionRequest())
api(getState).post('/api/v1/bookmark_collections', { title }).then((response) => {
api(getState).put('/api/v1/bookmark_collections', { title }).then((response) => {
dispatch(updateBookmarkCollectionSuccess(response.data))
}).catch((error) => {
dispatch(updateBookmarkCollectionFail(error))
@ -243,8 +246,9 @@ export const updateBookmarkCollectionStatus = (statusId, bookmarkCollectionId) =
dispatch(updateBookmarkCollectionStatusRequest())
api(getState).post('/api/v1/bookmark_collections', { title }).then((response) => {
dispatch(updateBookmarkCollectionStatusSuccess(response.data))
api(getState).post(`/api/v1/bookmark_collections/${bookmarkCollectionId}/update_status`, { statusId }).then((response) => {
dispatch(importFetchedStatuses([response.data]))
dispatch(updateBookmarkCollectionStatusSuccess())
}).catch((error) => {
dispatch(updateBookmarkCollectionStatusFail(error))
})
@ -254,9 +258,8 @@ const updateBookmarkCollectionStatusRequest = () => ({
type: UPDATE_BOOKMARK_COLLECTION_STATUS_REQUEST,
})
const updateBookmarkCollectionStatusSuccess = (bookmarkCollection) => ({
const updateBookmarkCollectionStatusSuccess = () => ({
type: UPDATE_BOOKMARK_COLLECTION_STATUS_SUCCESS,
bookmarkCollection,
})
const updateBookmarkCollectionStatusFail = (error) => ({

View File

@ -0,0 +1,29 @@
import React from 'react'
import PropTypes from 'prop-types'
import { defineMessages, injectIntl } from 'react-intl'
import ModalLayout from './modal_layout'
import BookmarkCollectionEdit from '../../features/bookmark_collection_edit'
class BookmarkCollectionEditModal extends React.PureComponent {
render() {
const { onClose } = this.props
return (
<ModalLayout
title='Edit Bookmark Collection'
width={500}
onClose={onClose}
>
<BookmarkCollectionEdit isModal />
</ModalLayout>
)
}
}
BookmarkCollectionEditModal.propTypes = {
onClose: PropTypes.func.isRequired,
}
export default BookmarkCollectionEditModal

View File

@ -164,6 +164,7 @@ class EditProfileModal extends ImmutablePureComponent {
<Input
id='display-name'
title='Display name'
maxLength={30}
value={displayNameValue}
onChange={this.handleDisplayNameChange}
onBlur={this.handleDisplayNameBlur}
@ -176,6 +177,7 @@ class EditProfileModal extends ImmutablePureComponent {
title='Bio'
value={bioValue}
disabled={false}
maxLength={500}
onChange={this.handleBioChange}
placeholder='Add your bio...'
/>

View File

@ -33,7 +33,7 @@ class ProfileNavigationBar extends React.PureComponent {
<Button
icon='ellipsis'
iconSize='26px'
iconClassName={_s.inheritFill}
iconClassName={_s.colorNavigation}
color='brand'
backgroundColor='none'
className={[_s.jcCenter, _s.aiCenter, _s.ml10, _s.px10].join(' ')}

View File

@ -40,7 +40,8 @@ class ShopPanel extends React.PureComponent {
isError,
} = this.props
if (!items || isError || !Array.isArray(items)) return null
if (!items || isError || !Array.isArray(items)) return <div />
if (items.length <= 0) return <div />
return (
<PanelLayout

View File

@ -14,6 +14,7 @@ import {
} from '../../constants'
import PopoverLayout from './popover_layout'
import List from '../list'
import Text from '../text'
class ChatConversationExpirationOptionsPopover extends React.PureComponent {
@ -94,7 +95,7 @@ class ChatConversationExpirationOptionsPopover extends React.PureComponent {
isXS={isXS}
onClose={this.handleOnClosePopover}
>
<Text className={[_s.d, _s.px15, _s.py10, _s.bgSecondary].join(' ')}>This chats delete after:</Text>
<Text className={[_s.d, _s.px15, _s.py10, _s.bgSecondary].join(' ')}>Chats delete after:</Text>
<List
scrollKey='chat_conversation_expiration'
items={listItems}

View File

@ -106,7 +106,7 @@ class ComposePostDesinationPopover extends ImmutablePureComponent {
<div className={[_s.d, _s.w100PC, _s.overflowYScroll, _s.maxH340PX].join(' ')}>
<List
scrollKey='groups-post-destination-add'
showLoading={groups.size === 0}
showLoading={groups.length === 0}
emptyMessage="You are not a member of any groups yet."
items={groupItems}
/>

View File

@ -1,5 +1,6 @@
import {
BREAKPOINT_EXTRA_SMALL,
POPOVER_CHAT_CONVERSATION_EXPIRATION_OPTIONS,
POPOVER_CHAT_CONVERSATION_OPTIONS,
POPOVER_CHAT_MESSAGE_OPTIONS,
POPOVER_COMMENT_SORTING_OPTIONS,
@ -23,6 +24,7 @@ import {
POPOVER_VIDEO_STATS,
} from '../../constants'
import {
ChatConversationExpirationOptionsPopover,
ChatConversationOptionsPopover,
ChatMessageOptionsPopover,
CommentSortingOptionsPopover,
@ -60,6 +62,7 @@ import LoadingPopover from './loading_popover'
const initialState = getWindowDimension()
const POPOVER_COMPONENTS = {
[POPOVER_CHAT_CONVERSATION_EXPIRATION_OPTIONS]: ChatConversationExpirationOptionsPopover,
[POPOVER_CHAT_CONVERSATION_OPTIONS]: ChatConversationOptionsPopover,
[POPOVER_CHAT_MESSAGE_OPTIONS]: ChatMessageOptionsPopover,
[POPOVER_COMMENT_SORTING_OPTIONS]: CommentSortingOptionsPopover,

View File

@ -21,6 +21,10 @@ import {
editStatus,
} from '../../actions/statuses';
import { quoteCompose } from '../../actions/compose'
import {
fetchBookmarkCollections,
updateBookmarkCollectionStatus,
} from '../../actions/bookmarks'
import {
fetchGroupRelationships,
createRemovedAccount,
@ -40,7 +44,9 @@ import {
POPOVER_STATUS_SHARE,
} from '../../constants'
import PopoverLayout from './popover_layout'
import Button from '../button'
import List from '../list'
import Text from '../text'
class StatusOptionsPopover extends ImmutablePureComponent {
@ -48,11 +54,9 @@ class StatusOptionsPopover extends ImmutablePureComponent {
router: PropTypes.object,
}
updateOnProps = [
'status',
'groupRelationships',
'isXS',
]
state = {
showingBookmarkCollections: false,
}
componentDidMount() {
const {
@ -109,6 +113,7 @@ class StatusOptionsPopover extends ImmutablePureComponent {
}
handleBookmarkClick = () => {
// : todo : add to specific bookmark collection
if (this.props.isPro) {
this.props.onBookmark(this.props.status)
} else {
@ -116,6 +121,19 @@ class StatusOptionsPopover extends ImmutablePureComponent {
}
}
handleBookmarkChangeClick = () => {
if (!this.props.bookmarkCollectionsIsFetched) this.props.onFetchBookmarkCollections()
this.setState({ showingBookmarkCollections: true })
}
handleBookmarkChangeBackClick = () => {
this.setState({ showingBookmarkCollections: false })
}
handleBookmarkChangeSelectClick = (bookmarkCollectionId) => {
this.props.onUpdateBookmarkCollectionStatus(this.props.status.get('id'), bookmarkCollectionId)
}
handleDeleteClick = () => {
this.props.onDelete(this.props.status)
}
@ -142,11 +160,13 @@ class StatusOptionsPopover extends ImmutablePureComponent {
render() {
const {
status,
intl,
groupRelationships,
isXS,
intl,
status,
groupRelationships,
bookmarkCollections,
} = this.props
const { showingBookmarkCollections } = this.state
if (!status) return <div />
@ -155,8 +175,6 @@ class StatusOptionsPopover extends ImmutablePureComponent {
const isReply = !!status.get('in_reply_to_id')
const withGroupAdmin = !!groupRelationships ? (groupRelationships.get('admin') || groupRelationships.get('moderator')) : false
console.log("publicStatus:", status, publicStatus)
let menu = []
if (me) {
@ -171,11 +189,19 @@ class StatusOptionsPopover extends ImmutablePureComponent {
menu.push({
icon: 'bookmark',
hideArrow: true,
hideArrow: status.get('bookmarked'),
title: intl.formatMessage(status.get('bookmarked') ? messages.unbookmark : messages.bookmark),
onClick: this.handleBookmarkClick,
})
if (status.get('bookmarked')) {
menu.push({
icon: 'bookmark',
title: 'Update bookmark collection',
onClick: this.handleBookmarkChangeClick,
})
}
if (status.getIn(['account', 'id']) === me) {
if (publicStatus) {
menu.push({
@ -264,16 +290,62 @@ class StatusOptionsPopover extends ImmutablePureComponent {
})
}
const popoverWidth = !isStaff ? 260 : 362
let bookmarkCollectionItems = !!bookmarkCollections ? bookmarkCollections.map((bookmarkCollection) => ({
hideArrow: true,
onClick: () => this.handleBookmarkChangeSelectClick(bookmarkCollection.get('id')),
title: bookmarkCollection.get('title'),
isActive: bookmarkCollection.get('id') === status.get('bookmark_collection_id'),
})) : []
bookmarkCollectionItems = bookmarkCollectionItems.unshift({
hideArrow: true,
onClick: () => this.handleBookmarkChangeSelectClick('saved'),
title: 'Saved',
isActive: !status.get('bookmark_collection_id'),
})
return (
<PopoverLayout
isXS={isXS}
onClose={this.handleClosePopover}
width={popoverWidth}
>
<List
scrollKey='profile_options'
items={menu}
size={isXS ? 'large' : 'small'}
/>
{
!showingBookmarkCollections &&
<List
scrollKey='profile_options'
items={menu}
size={isXS ? 'large' : 'small'}
/>
}
{
showingBookmarkCollections &&
<div className={[_s.d, _s.w100PC].join(' ')}>
<div className={[_s.d, _s.flexRow, _s.bgSecondary].join(' ')}>
<Button
isText
icon='back'
color='primary'
backgroundColor='none'
className={[_s.aiCenter, _s.jcCenter, _s.pl15, _s.pr5].join(' ')}
onClick={this.handleBookmarkChangeBackClick}
/>
<Text className={[_s.d, _s.pl5, _s.py10].join(' ')}>
Select bookmark collection:
</Text>
</div>
<div className={[_s.d, _s.w100PC, _s.overflowYScroll, _s.maxH340PX].join(' ')}>
<List
scrollKey='status_options_bookmark_collections'
showLoading={bookmarkCollectionItems.length === 0}
emptyMessage="You have no bookmark collections yet."
items={bookmarkCollectionItems}
size={isXS ? 'large' : 'small'}
/>
</div>
</div>
}
</PopoverLayout>
)
}
@ -323,6 +395,8 @@ const mapStateToProps = (state, { statusId }) => {
groupId,
groupRelationships,
isPro: state.getIn(['accounts', me, 'is_pro']),
bookmarkCollectionsIsFetched: state.getIn(['bookmark_collections', 'isFetched']),
bookmarkCollections: state.getIn(['bookmark_collections', 'items']),
}
}
@ -454,7 +528,6 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(closePopover())
dispatch(openModal(MODAL_PRO_UPGRADE))
},
onPinGroupStatus(status) {
dispatch(closePopover())
@ -464,7 +537,13 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(pinGroupStatus(status.getIn(['group', 'id']), status.get('id')))
}
},
onFetchBookmarkCollections() {
dispatch(fetchBookmarkCollections())
},
onUpdateBookmarkCollectionStatus(statusId, bookmarkCollectionId) {
dispatch(updateBookmarkCollectionStatus(statusId, bookmarkCollectionId))
dispatch(closePopover())
},
onClosePopover: () => dispatch(closePopover()),
})
@ -487,6 +566,8 @@ StatusOptionsPopover.propTypes = {
fetchIsPinnedGroupStatus: PropTypes.func.isRequired,
fetchIsBookmark: PropTypes.func.isRequired,
fetchIsPin: PropTypes.func.isRequired,
onFetchBookmarkCollections: PropTypes.func.isRequired,
onUpdateBookmarkCollectionStatus: PropTypes.func.isRequired,
isXS: PropTypes.bool,
isPro: PropTypes.bool,
}

View File

@ -12,7 +12,7 @@ import PopoverLayout from './popover_layout'
import AccountActionButton from '../account_action_button'
import Avatar from '../avatar'
import DisplayName from '../display_name'
import Text from '../text'
import UserStat from '../user_stat'
class UserInfoPopover extends ImmutablePureComponent {
@ -47,28 +47,19 @@ class UserInfoPopover extends ImmutablePureComponent {
</div>
<div className={[_s.d, _s.flexRow, _s.mt10].join(' ')}>
<NavLink
to={`${to}/followers`}
className={[_s.d, _s.flexRow, _s.mr10, _s.noUnderline, _s.cPrimary, _s.underline_onHover].join(' ')}
>
<Text weight='extraBold' color='primary'>
{shortNumberFormat(account.get('followers_count'))}&nbsp;
</Text>
<Text color='secondary'>
<FormattedMessage id='account.followers' defaultMessage='Followers' />
</Text>
</NavLink>
<NavLink
to={`${to}/following`}
className={[_s.d, _s.flexRow, _s.noUnderline, _s.cPrimary, _s.underline_onHover].join(' ')}
>
<Text weight='extraBold' color='primary'>
{shortNumberFormat(account.get('following_count'))}&nbsp;
</Text>
<Text color='secondary'>
<FormattedMessage id='account.follows' defaultMessage='Following' />
</Text>
</NavLink>
<UserStat
title={<FormattedMessage id='account.followers' defaultMessage='Followers' />}
value={shortNumberFormat(account.get('followers_count'))}
to={`/${account.get('acct')}/followers`}
isInline
/>
<UserStat
isLast
title={<FormattedMessage id='account.follows' defaultMessage='Following' />}
value={shortNumberFormat(account.get('following_count'))}
to={`/${account.get('acct')}/following`}
isInline
/>
</div>
</div>

View File

@ -424,4 +424,8 @@ StatusList.propTypes = {
promotedStatuses: PropTypes.object,
}
StatusList.defaultProps = {
statusIds: ImmutableList(),
}
export default connect(mapStateToProps, mapDispatchToProps)(StatusList)

View File

@ -19,6 +19,7 @@ class Textarea extends React.PureComponent {
onBlur,
title,
isRequired,
maxLength,
} = this.props
const inputClasses = CX({
@ -58,6 +59,7 @@ class Textarea extends React.PureComponent {
onKeyUp={onKeyUp}
onFocus={onFocus}
onBlur={onBlur}
maxLength={maxLength}
required={isRequired ? true : undefined}
/>
@ -77,6 +79,7 @@ Textarea.propTypes = {
onBlur: PropTypes.func,
title: PropTypes.string,
isRequired: PropTypes.bool,
maxLength: PropTypes.number,
}
export default Textarea

View File

@ -27,6 +27,7 @@ class ShopInjection extends React.PureComponent {
} = this.props
if (!items || isError || !Array.isArray(items)) return <div />
if (items.length <= 0) return <div />
return (
<TimelineInjectionLayout

View File

@ -38,8 +38,11 @@ class UserStat extends React.PureComponent {
const align = isCentered ? 'center' : 'left'
const titleSize = isInline ? 'normal' : 'extraLarge'
const subtitleSize = isInline ? 'normal' : 'small'
const titleColor = isInline ? 'primary' : 'brand'
const titleWeight = isInline ? 'extraBold' : 'bold'
const subtitleSize = isInline ? 'normal' : 'small'
const containerClasses = CX({
d: 1,
cursorPointer: 1,
@ -64,7 +67,7 @@ class UserStat extends React.PureComponent {
onMouseEnter={this.handleOnMouseEnter}
onMouseLeave={this.handleOnMouseLeave}
>
<Text size={titleSize} weight='bold' color='brand' align={align}>
<Text size={titleSize} weight={titleWeight} color={titleColor} align={align}>
{value}
</Text>
<Text size={subtitleSize} weight='medium' color='secondary' hasUnderline={hovering} align={align} className={subtitleClasses}>

View File

@ -7,6 +7,7 @@ import { defineMessages, injectIntl } from 'react-intl'
import { is } from 'immutable'
import throttle from 'lodash.throttle'
import { decode } from 'blurhash'
import videojs from 'video.js'
import { isFullscreen, requestFullscreen, exitFullscreen } from '../utils/fullscreen'
import { isPanoramic, isPortrait, minimumAspectRatio, maximumAspectRatio } from '../utils/media_aspect_ratio'
import {
@ -24,10 +25,24 @@ import Icon from './icon'
import SensitiveMediaItem from './sensitive_media_item'
import Text from './text'
import '!style-loader!css-loader!video.js/dist/video-js.min.css'
// check every 100 ms for buffer
const checkInterval = 100
const FIXED_VAR = 6
const videoJsOptions = {
autoplay: false,
playbackRates: [0.5, 1, 1.25, 1.5, 2],
width: 720,
height: 300,
controls: true,
sources: [{
// src: '//vjs.zencdn.net/v/oceans.mp4',
type: 'video/mp4',
}],
};
const formatTime = (secondsNum) => {
if (isNaN(secondsNum)) secondsNum = 0
@ -135,6 +150,13 @@ class Video extends ImmutablePureComponent {
if ('pictureInPictureEnabled' in document) {
this.setState({ pipAvailable: true })
}
videoJsOptions.sources = [{ src: this.props.src }]
console.log("videoJsOptions:", videoJsOptions)
// instantiate video.js
this.videoPlayer = videojs(this.videoNode, videoJsOptions, function onPlayerReady() {
console.log('onPlayerReady', this)
})
}
componentWillUnmount() {
@ -144,6 +166,10 @@ class Video extends ImmutablePureComponent {
document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true)
clearInterval(this.bufferCheckInterval)
if (this.videoPlayer) {
this.videoPlayer.dispose()
}
}
componentWillReceiveProps(nextProps) {
@ -199,6 +225,7 @@ class Video extends ImmutablePureComponent {
setVideoRef = (n) => {
this.video = n
this.videoNode = n
if (this.video) {
const { volume, muted } = this.video
@ -581,175 +608,34 @@ class Video extends ImmutablePureComponent {
>
<div className={overlayClasses} id='overlay'>
{
paused && !isBuffering &&
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
<button
onClick={this.togglePlay}
className={[_s.d, _s.outlineNone, _s.cursorPointer, _s.aiCenter, _s.jcCenter, _s.posAbs, _s.bgBlackOpaque, _s.circle, _s.h60PX, _s.w60PX].join(' ')}
>
<Icon id='play' size='24px' className={_s.cWhite} />
</button>
</Responsive>
}
{
!paused && true &&
<Icon id='loading' size='60px' className={[_s.d, _s.posAbs].join(' ')} />
}
</div>
<video
className={[_s.d, _s.h100PC, _s.w100PC, _s.outlineNone].join(' ')}
playsInline
ref={this.setVideoRef}
src={src}
poster={preview}
preload={preload}
role='button'
tabIndex='0'
aria-label={alt}
title={alt}
width={width}
height={height}
volume={volume}
onClick={this.togglePlay}
onPlay={this.handlePlay}
onPause={this.handlePause}
onTimeUpdate={this.handleTimeUpdate}
onLoadedData={this.handleLoadedData}
onProgress={this.handleProgress}
onVolumeChange={this.handleVolumeChange}
/>
<div
className={volumeControlClasses}
onMouseDown={this.handleVolumeMouseDown}
onMouseEnter={this.handleMouseEnterVolumeControl}
onMouseLeave={this.handleMouseLeaveVolumeControl}
ref={this.setVolumeRef}
>
<div
className={[_s.d, _s.radiusSmall, _s.my10, _s.posAbs, _s.w4PX, _s.ml10, _s.bgPrimaryOpaque].join(' ')}
style={{
height: '102px',
}}
<div data-vjs-player>
<video
className={[_s.d, _s.h100PC, _s.w100PC, _s.outlineNone, 'video-js'].join(' ')}
ref={this.setVideoRef}
// playsInline
// poster={preview}
// preload={preload}
// role='button'
// tabIndex='0'
// aria-label={alt}
// title={alt}
// width={width}
// height={height}
// volume={volume}
// onClick={this.togglePlay}
// onPlay={this.handlePlay}
// onPause={this.handlePause}
// onTimeUpdate={this.handleTimeUpdate}
// onLoadedData={this.handleLoadedData}
// onProgress={this.handleProgress}
// onVolumeChange={this.handleVolumeChange}
/>
<div
className={[_s.d, _s.radiusSmall, _s.my10, _s.bottom0, _s.posAbs, _s.w4PX, _s.ml10, _s.bgPrimary].join(' ')}
style={{
height: `${volumeHeight}px`
}}
/>
<span
className={[_s.d, _s.cursorPointer, _s.posAbs, _s.circle, _s.px5, _s.boxShadow1, _s.mbNeg5PX, _s.py5, _s.bgPrimary, _s.z3].join(' ')}
tabIndex='0'
style={{
marginLeft: '7px',
bottom: `${volumeHandleLoc}px`,
}}
/>
</div>
<div className={videoControlsBackgroundClasses}>
<div
className={[_s.d, _s.cursorPointer, _s.h22PX, _s.videoPlayerSeek].join(' ')}
onMouseDown={this.handleMouseDown}
ref={this.setSeekRef}
>
<div className={[progressClasses, _s.bgLoading, _s.w100PC].join(' ')} />
<div className={[progressClasses, _s.bgSubtle].join(' ')} style={{ width: `${buffer}%` }} />
<div className={[progressClasses, _s.bgBrand].join(' ')} style={{ width: `${progress}%` }} />
<span
className={seekHandleClasses}
tabIndex='0'
style={{
left: `${progress}%`
}}
>
<span className={seekInnerHandleClasses} />
</span>
</div>
<div className={[_s.d, _s.flexRow, _s.aiCenter, _s.pb5, _s.noSelect].join(' ')}>
<Button
isNarrow
backgroundColor='none'
aria-label={intl.formatMessage(paused ? messages.play : messages.pause)}
onClick={this.togglePlay}
icon={paused ? 'play' : 'pause'}
title={paused ? 'Play' : 'Pause'}
iconSize='16px'
iconClassName={_s.cWhite}
className={_s.pl0}
/>
<Button
isNarrow
backgroundColor='none'
type='button'
aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)}
onClick={this.toggleMute}
icon={muted ? 'audio-mute' : 'audio'}
iconSize='24px'
iconClassName={_s.cWhite}
className={[_s.px10, _s.mr10].join(' ')}
title='Volume'
onMouseEnter={this.handleMouseEnterAudio}
onMouseLeave={this.handleMouseLeaveAudio}
/>
<Text color='white' size='small'>
{formatTime(currentTime)}
&nbsp;/&nbsp;
{formatTime(duration)}
</Text>
<div className={[_s.d, _s.mlAuto, _s.flexRow, _s.aiCenter].join(' ')}>
<Button
isNarrow
backgroundColor='none'
aria-label={intl.formatMessage(messages.video_stats)}
onClick={this.handleOnClickSettings}
icon='cog'
iconSize='20px'
iconClassName={_s.cWhite}
className={[_s.px10, _s.pr0].join(' ')}
buttonRef={this.setSettingsBtnRef}
title='Video stats'
/>
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
{
pipAvailable &&
<Button
isNarrow
backgroundColor='none'
aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)}
onClick={this.togglePip}
icon='copy'
iconSize='20px'
iconClassName={_s.cWhite}
className={[_s.px10, _s.pr0].join(' ')}
title='Picture in Picture'
/>
}
</Responsive>
<Button
isNarrow
backgroundColor='none'
aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)}
onClick={this.toggleFullscreen}
icon={fullscreen ? 'minimize-fullscreen' : 'fullscreen'}
title={fullscreen ? 'Minimize fullscreen' : 'Fullscreen'}
iconSize='20px'
iconClassName={_s.cWhite}
className={[_s.px10, _s.pr0].join(' ')}
/>
</div>
</div>
</div>
{

View File

@ -26,6 +26,7 @@ export const PLACEHOLDER_MISSING_HEADER_SRC = '/original/missing.png'
export const POPOVER_CHAT_CONVERSATION_OPTIONS = 'CHAT_CONVERSATION_OPTIONS'
export const POPOVER_CHAT_MESSAGE_OPTIONS = 'CHAT_MESSAGE_OPTIONS'
export const POPOVER_CHAT_CONVERSATION_EXPIRATION_OPTIONS = 'CHAT_CONVERSATION_EXPIRATION_OPTIONS'
export const POPOVER_COMMENT_SORTING_OPTIONS = 'COMMENT_SORTING_OPTIONS'
export const POPOVER_COMPOSE_POST_DESTINATION = 'COMPOSE_POST_DESTINATION'
export const POPOVER_DATE_PICKER = 'DATE_PICKER'
@ -49,6 +50,7 @@ export const POPOVER_VIDEO_STATS = 'VIDEO_STATS'
export const MODAL_ALBUM_CREATE = 'ALBUM_CREATE'
export const MODAL_BLOCK_ACCOUNT = 'BLOCK_ACCOUNT'
export const MODAL_BOOKMARK_COLLECTION_CREATE = 'BOOKMARK_COLLECTION_CREATE'
export const MODAL_BOOKMARK_COLLECTION_EDIT = 'BOOKMARK_COLLECTION_EDIT'
export const MODAL_BOOST = 'BOOST'
export const MODAL_CHAT_CONVERSATION_CREATE = 'CHAT_CONVERSATION_CREATE'
export const MODAL_CHAT_CONVERSATION_DELETE = 'CHAT_CONVERSATION_DELETE'

View File

@ -2,9 +2,8 @@ import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { defineMessages, injectIntl } from 'react-intl'
import { changeListEditorTitle, submitListEditor } from '../actions/lists'
import { createBookmarkCollection } from '../actions/bookmarks'
import { closeModal } from '../actions/modal'
import { MODAL_LIST_CREATE } from '../constants'
import Button from '../components/button'
import Input from '../components/input'
import Form from '../components/form'
@ -21,14 +20,13 @@ class BookmarkCollectionCreate extends React.PureComponent {
}
handleOnSubmit = () => {
this.props.onSubmit()
this.props.onSubmit(this.state.value)
}
render() {
const { disabled, isModal } = this.props
const { value } = this.state
const isDisabled = !value || disabled
const isDisabled = !value
return (
<Form>
@ -54,14 +52,10 @@ class BookmarkCollectionCreate extends React.PureComponent {
}
const mapStateToProps = (state) => ({
disabled: state.getIn(['listEditor', 'isSubmitting']),
})
const mapDispatchToProps = (dispatch, { isModal }) => ({
onSubmit() {
if (isModal) dispatch(closeModal(MODAL_LIST_CREATE))
dispatch(submitListEditor(true))
onSubmit(title) {
if (isModal) dispatch(closeModal())
dispatch(createBookmarkCollection(title))
},
})
@ -70,4 +64,4 @@ BookmarkCollectionCreate.propTypes = {
isModal: PropTypes.bool,
}
export default connect(mapStateToProps, mapDispatchToProps)(BookmarkCollectionCreate)
export default connect(null, mapDispatchToProps)(BookmarkCollectionCreate)

View File

@ -0,0 +1,100 @@
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { defineMessages, injectIntl } from 'react-intl'
import {
updateBookmarkCollection,
removeBookmarkCollection,
} from '../actions/bookmarks'
import { closeModal } from '../actions/modal'
import Button from '../components/button'
import Input from '../components/input'
import Form from '../components/form'
import Text from '../components/text'
class BookmarkCollectionEdit extends React.PureComponent {
state = {
value: '',
}
componentDidMount() {
if (!this.props.bookmarkCollection) {
this.props.onFetchBookmarkCollection(this.props.bookmarkCollectionId)
}
}
onChange = (value) => {
this.setState({ value })
}
handleOnSubmit = () => {
this.props.onSubmit(this.state.value)
}
handleOnRemove = () => {
this.props.onRemove()
}
render() {
const { value } = this.state
const isDisabled = !value
return (
<Form>
<Input
title='Title'
placeholder='Bookmark collection title'
value={value}
onChange={this.onChange}
/>
<Button
isDisabled={isDisabled}
onClick={this.handleOnSubmit}
className={[_s.mt10].join(' ')}
>
<Text color='inherit' align='center'>
Update
</Text>
</Button>
<Button
backgroundColor='danger'
color='white'
onClick={this.handleOnRemove}
className={[_s.mt10].join(' ')}
>
<Text color='inherit' align='center'>
Update
</Text>
</Button>
</Form>
)
}
}
const mapStateToProps = (state, { bookmarkCollectionId }) => ({
bookmarkCollection: state.getIn(['bookmark_collections', bookmarkCollectionId]),
})
const mapDispatchToProps = (dispatch, { isModal, bookmarkCollectionId }) => ({
onSubmit(title) {
if (isModal) dispatch(closeModal())
dispatch(updateBookmarkCollection(title))
},
onRemove() {
if (isModal) dispatch(closeModal())
dispatch(removeBookmarkCollection(bookmarkCollectionId))
},
})
BookmarkCollectionEdit.propTypes = {
onSubmit: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
isModal: PropTypes.bool,
}
export default connect(mapStateToProps, mapDispatchToProps)(BookmarkCollectionEdit)

View File

@ -29,19 +29,32 @@ class BookmarkCollections extends ImmutablePureComponent {
render() {
const {
isMyAccount,
isLoading,
isError,
bookmarkCollections,
} = this.props
if (!isMyAccount) {
return <ColumnIndicator type='missing' />
}
if (isError) {
return <ColumnIndicator type='error' message='Error fetching bookmark collections' />
}
const listItems = [{ to: `/${meUsername}/bookmark_collections/bookmarks`, title: 'Bookmarks' }].concat(!!bookmarkCollections ? bookmarkCollections.map((s) => ({
to: s.get('to'),
title: s.get('title'),
})) : [])
console.log("bookmarkCollections:", bookmarkCollections)
let listItems = !!bookmarkCollections ? bookmarkCollections.map((b) => ({
to: `/${meUsername}/bookmark_collections/${b.get('id')}`,
title: b.get('title'),
})) : []
listItems = listItems.unshift({
to: `/${meUsername}/bookmark_collections/saved`,
title: 'Bookmarks',
})
console.log("listItems:", listItems)
return (
<Block>
@ -69,10 +82,11 @@ class BookmarkCollections extends ImmutablePureComponent {
}
const mapStateToProps = (state) => ({
const mapStateToProps = (state, { params: { username } }) => ({
isMyAccount: (username.toLowerCase() === meUsername.toLowerCase()),
isError: state.getIn(['bookmark_collections', 'isError']),
isLoading: state.getIn(['bookmark_collections', 'isLoading']),
shortcuts: state.getIn(['bookmark_collections', 'items']),
bookmarkCollections: state.getIn(['bookmark_collections', 'items']),
})
const mapDispatchToProps = (dispatch) => ({

View File

@ -9,6 +9,9 @@ import { fetchBookmarkedStatuses, expandBookmarkedStatuses } from '../actions/bo
import { meUsername } from '../initial_state'
import StatusList from '../components/status_list'
import ColumnIndicator from '../components/column_indicator'
import Block from '../components/block'
import Button from '../components/button'
import Text from '../components/text'
class BookmarkedStatuses extends ImmutablePureComponent {
@ -32,15 +35,37 @@ class BookmarkedStatuses extends ImmutablePureComponent {
return <ColumnIndicator type='missing' />
}
console.log("statusIds:", statusIds)
return (
<StatusList
statusIds={statusIds}
scrollKey='bookmarked_statuses'
hasMore={hasMore}
isLoading={isLoading}
onLoadMore={this.handleLoadMore}
emptyMessage={<FormattedMessage id='empty_column.bookmarked_statuses' defaultMessage="You don't have any bookmarked gabs yet. If you are GabPRO, when you bookmark one, it will show up here." />}
/>
<div className={[_s.d, _s.w100PC].join(' ')}>
<Block>
<div className={[_s.d, _s.px15, _s.py10].join(' ')}>
<div className={[_s.d, _s.flexRow, _s.aiCenter].join(' ')}>
<Text size='extraLarge' weight='bold'>
Bookmarks:
</Text>
<Button
className={[_s.px10, _s.mlAuto].join(' ')}
onClick={this.handleOpenModal}
backgroundColor='tertiary'
color='tertiary'
icon='cog'
/>
</div>
</div>
</Block>
<div className={[_s.d, _s.w100PC, _s.mt10].join(' ')}>
<StatusList
statusIds={statusIds}
scrollKey='bookmarked_statuses'
hasMore={hasMore}
isLoading={isLoading}
onLoadMore={this.handleLoadMore}
emptyMessage={<FormattedMessage id='empty_column.bookmarked_statuses' defaultMessage="You don't have any bookmarked gabs yet. If you are GabPRO, when you bookmark one, it will show up here." />}
/>
</div>
</div>
)
}
@ -49,9 +74,9 @@ class BookmarkedStatuses extends ImmutablePureComponent {
const mapStateToProps = (state, { params: { username, bookmarkCollectionId } }) => ({
bookmarkCollectionId,
isMyAccount: (username.toLowerCase() === meUsername.toLowerCase()),
statusIds: state.getIn(['status_lists', 'bookmarks', 'items']),
isLoading: state.getIn(['status_lists', 'bookmarks', 'isLoading'], true),
hasMore: !!state.getIn(['status_lists', 'bookmarks', 'next']),
statusIds: state.getIn(['status_lists', 'bookmarks', bookmarkCollectionId, 'items']),
isLoading: state.getIn(['status_lists', 'bookmarks', bookmarkCollectionId, 'isLoading'], true),
hasMore: !!state.getIn(['status_lists', 'bookmarks', bookmarkCollectionId, 'next']),
})
BookmarkedStatuses.propTypes = {
@ -59,6 +84,7 @@ BookmarkedStatuses.propTypes = {
statusIds: ImmutablePropTypes.list.isRequired,
hasMore: PropTypes.bool,
isLoading: PropTypes.bool,
bookmarkCollectionId: PropTypes.string,
isMyAccount: PropTypes.bool.isRequired,
}

View File

@ -15,7 +15,7 @@ import Text from '../../../components/text'
class ComposeFormSubmitButton extends React.PureComponent {
handleSubmit = () => {
this.props.onSubmit()
}
render() {

View File

@ -201,7 +201,7 @@ class Deck extends React.PureComponent {
<DeckColumn title='Compose' icon='pencil' noButtons>
<WrappedBundle component={Compose} />
</DeckColumn>
{
{ /** : todo : */
!isPro &&
<DeckColumn title='Gab Deck for GabPRO' icon='pro' noButtons>
<div className={[_s.d, _s.px15, _s.py15].join(' ')}>

View File

@ -113,6 +113,7 @@ class SlidePhotos extends ImmutablePureComponent {
id='display-name'
title='Display name'
placeholder='Add your name...'
maxLength={30}
value={displayNameValue}
onChange={this.handleDisplayNameChange}
onBlur={this.handleDisplayNameBlur}

View File

@ -4,9 +4,15 @@ import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
import { connect } from 'react-redux'
import Textarea from 'react-textarea-autosize'
import { openModal } from '../../../actions/modal'
import { openPopover } from '../../../actions/popover'
import { modal } from '../../../actions/modal'
import { sendChatMessage } from '../../../actions/chat_messages'
import { CX } from '../../../constants'
import { me } from '../../../initial_state'
import {
CX,
MODAL_PRO_UPGRADE,
POPOVER_CHAT_CONVERSATION_EXPIRATION_OPTIONS,
} from '../../../constants'
import Button from '../../../components/button'
import Icon from '../../../components/icon'
import Input from '../../../components/input'
@ -25,7 +31,11 @@ class ChatMessagesComposeForm extends React.PureComponent {
}
handleOnExpire = () => {
//
if (this.props.isPro) {
this.props.onShowExpirePopover(this.expiresBtn)
} else {
this.props.onShowProModal()
}
}
onChange = (e) => {
@ -181,16 +191,33 @@ class ChatMessagesComposeForm extends React.PureComponent {
}
const mapDispatchToProps = (dispatch) => ({
const mapStateToProps = (state) => ({
isPro: state.getIn(['accounts', me, 'is_pro']),
})
const mapDispatchToProps = (dispatch, { chatConversationId }) => ({
onSendChatMessage(text, chatConversationId) {
dispatch(sendChatMessage(text, chatConversationId))
},
onShowProModal() {
dispatch(openModal(MODAL_PRO_UPGRADE))
},
onShowExpirePopover(targetRef) {
dispatch(openPopover(POPOVER_CHAT_CONVERSATION_EXPIRATION_OPTIONS, {
targetRef,
chatConversationId,
position: 'top',
}))
}
})
ChatMessagesComposeForm.propTypes = {
chatConversationId: PropTypes.string,
isXS: PropTypes.bool,
onSendMessage: PropTypes.func.isRequired,
isPro: PropTypes.bool,
onSendChatMessage: PropTypes.func.isRequired,
onShowExpirePopover: PropTypes.func.isRequired,
onShowProModal: PropTypes.func.isRequired,
}
export default connect(null, mapDispatchToProps)(ChatMessagesComposeForm)
export default connect(mapStateToProps, mapDispatchToProps)(ChatMessagesComposeForm)

View File

@ -61,6 +61,7 @@ import {
BlockedAccounts,
BookmarkCollections,
BookmarkCollectionCreate,
BookmarkCollectionEdit,
BookmarkedStatuses,
CaliforniaConsumerProtection,
CaliforniaConsumerProtectionContact,
@ -282,10 +283,11 @@ class SwitchingArea extends React.PureComponent {
<WrappedRoute path='/:username/album_edit/:albumId' page={ModalPage} component={AlbumCreate} content={children} componentParams={{ title: 'Create Album', page: 'edit-album' }} />
<WrappedRoute path='/:username/likes' page={ProfilePage} component={LikedStatuses} content={children} />
<WrappedRoute path='/:username/bookmark_collections' page={ProfilePage} component={BookmarkCollections} content={children} />
<WrappedRoute path='/:username/bookmark_collections/create' page={ModalPage} component={BookmarkCollectionCreate} content={children} componentParams={{ title: 'Create Bookmark Collection', page: 'create-bookmark-collection' }} />
<WrappedRoute path='/:username/bookmark_collections/:bookmarkCollectionId' page={ProfilePage} component={BookmarkedStatuses} content={children} />
<WrappedRoute path='/:username/bookmark_collections/:bookmarkCollectionId/edit' page={ModalPage} component={BookmarkCollectionEdit} content={children} componentParams={{ title: 'Edit Bookmark Collection', page: 'edit-bookmark-collection' }} />
<WrappedRoute path='/:username/bookmark_collections' page={ProfilePage} component={BookmarkCollections} content={children} />
<WrappedRoute path='/:username/posts/:statusId' publicRoute exact page={BasicPage} component={StatusFeature} content={children} componentParams={{ title: 'Status', page: 'status' }} />
<WrappedRoute path='/:username/posts/:statusId/reposts' publicRoute page={ModalPage} component={StatusReposts} content={children} componentParams={{ title: 'Reposts' }} />

View File

@ -11,6 +11,8 @@ export function BlockedAccounts() { return import(/* webpackChunkName: "features
export function BookmarkCollections() { return import(/* webpackChunkName: "features/bookmark_collections" */'../../bookmark_collections') }
export function BookmarkCollectionCreate() { return import(/* webpackChunkName: "features/bookmark_collection_create" */'../../bookmark_collection_create') }
export function BookmarkCollectionCreateModal() { return import(/* webpackChunkName: "components/bookmark_collection_create_modal" */'../../../components/modal/bookmark_collection_create_modal') }
export function BookmarkCollectionEdit() { return import(/* webpackChunkName: "features/bookmark_collection_edit" */'../../bookmark_collection_edit') }
export function BookmarkCollectionEditModal() { return import(/* webpackChunkName: "components/bookmark_collection_edit_modal" */'../../../components/modal/bookmark_collection_edit_modal') }
export function BookmarkedStatuses() { return import(/* webpackChunkName: "features/bookmarked_statuses" */'../../bookmarked_statuses') }
export function BoostModal() { return import(/* webpackChunkName: "components/boost_modal" */'../../../components/modal/boost_modal') }
export function CaliforniaConsumerProtection() { return import(/* webpackChunkName: "features/california_consumer_protection" */'../../about/california_consumer_protection') }
@ -21,6 +23,7 @@ export function ChatConversationCreateModal() { return import(/* webpackChunkNam
export function ChatConversationDeleteModal() { return import(/* webpackChunkName: "components/chat_conversation_delete_modal" */'../../../components/modal/chat_conversation_delete_modal') }
export function ChatConversationOptionsPopover() { return import(/* webpackChunkName: "components/chat_conversation_options_popover" */'../../../components/popover/chat_conversation_options_popover') }
export function ChatConversationRequests() { return import(/* webpackChunkName: "features/chat_conversation_requests" */'../../chat_conversation_requests') }
export function ChatConversationExpirationOptionsPopover() { return import(/* webpackChunkName: "components/chat_conversation_expiration_options_popover" */'../../../components/popover/chat_conversation_expiration_options_popover') }
export function ChatMessageOptionsPopover() { return import(/* webpackChunkName: "components/chat_message_options_popover" */'../../../components/popover/chat_message_options_popover') }
export function CommentSortingOptionsPopover() { return import(/* webpackChunkName: "components/comment_sorting_options_popover" */'../../../components/popover/comment_sorting_options_popover') }
export function CommunityTimeline() { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline') }

View File

@ -1,7 +1,9 @@
import {
BOOKMARK_COLLECTIONS_FETCH_REQUEST,
BOOKMARK_COLLECTIONS_FETCH_SUCCESS,
BOOKMARK_COLLECTIONS_FETCH_FAIL,
ALBUMS_FETCH_REQUEST,
ALBUMS_FETCH_SUCCESS,
ALBUMS_FETCH_FAIL,
ALBUMS_CREATE_SUCCESS,
ALBUMS_REMOVE_REQUEST,
} from '../actions/bookmarks'
import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable'
@ -12,49 +14,32 @@ const initialState = ImmutableMap({
isError: false,
})
const normalizeBookmarkCollection = (bookmarkCollection) => {
return {
id: shortcut.id,
shortcut_type: 'account',
shortcut_id: shortcut.shortcut_id,
title: shortcut.shortcut.acct,
image: shortcut.shortcut.avatar_static,
to: `/${shortcut.shortcut.acct}`,
}
}
const normalizeBookmarkCollections = (shortcuts) => {
return fromJS(shortcuts.map((shortcut) => {
return normalizeShortcut(shortcut)
}))
}
export default function albums(state = initialState, action) {
switch(action.type) {
case SHORTCUTS_FETCH_REQUEST:
case ALBUMS_FETCH_REQUEST:
return state.withMutations((map) => {
map.set('isLoading', true)
map.set('isFetched', false)
map.set('isError', false)
})
case SHORTCUTS_FETCH_SUCCESS:
case ALBUMS_FETCH_SUCCESS:
return state.withMutations((map) => {
map.set('items', normalizeShortcuts(action.shortcuts))
map.set('items', fromJS(action.bookmarkCollections))
map.set('isLoading', false)
map.set('isFetched', true)
map.set('isError', false)
})
case SHORTCUTS_FETCH_FAIL:
case ALBUMS_FETCH_FAIL:
return state.withMutations((map) => {
map.set('isLoading', false)
map.set('isFetched', true)
map.set('isError', true)
})
case BOOKMARK_COLLECTIONS_CREATE_REQUEST:
return state.update('items', list => list.push(fromJS(normalizeShortcut(action.shortcut))))
case BOOKMARK_COLLECTIONS_REMOVE_REQUEST:
case ALBUMS_CREATE_SUCCESS:
return state.update('items', list => list.push(fromJS(action.bookmarkCollection)))
case ALBUMS_REMOVE_REQUEST:
return state.update('items', list => list.filterNot((item) => {
return `${item.get('id')}` === `${action.shortcutId}`
return item.get('id') === action.bookmarkCollectionId
}))
default:
return state

View File

@ -2,6 +2,8 @@ import {
BOOKMARK_COLLECTIONS_FETCH_REQUEST,
BOOKMARK_COLLECTIONS_FETCH_SUCCESS,
BOOKMARK_COLLECTIONS_FETCH_FAIL,
BOOKMARK_COLLECTIONS_CREATE_SUCCESS,
BOOKMARK_COLLECTIONS_REMOVE_REQUEST,
} from '../actions/bookmarks'
import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable'
@ -12,49 +14,32 @@ const initialState = ImmutableMap({
isError: false,
})
const normalizeBookmarkCollection = (bookmarkCollection) => {
return {
id: shortcut.id,
shortcut_type: 'account',
shortcut_id: shortcut.shortcut_id,
title: shortcut.shortcut.acct,
image: shortcut.shortcut.avatar_static,
to: `/${shortcut.shortcut.acct}`,
}
}
const normalizeBookmarkCollections = (shortcuts) => {
return fromJS(shortcuts.map((shortcut) => {
return normalizeShortcut(shortcut)
}))
}
export default function bookmark_collections(state = initialState, action) {
switch(action.type) {
case SHORTCUTS_FETCH_REQUEST:
case BOOKMARK_COLLECTIONS_FETCH_REQUEST:
return state.withMutations((map) => {
map.set('isLoading', true)
map.set('isFetched', false)
map.set('isError', false)
})
case SHORTCUTS_FETCH_SUCCESS:
case BOOKMARK_COLLECTIONS_FETCH_SUCCESS:
return state.withMutations((map) => {
map.set('items', normalizeShortcuts(action.shortcuts))
map.set('items', fromJS(action.bookmarkCollections))
map.set('isLoading', false)
map.set('isFetched', true)
map.set('isError', false)
})
case SHORTCUTS_FETCH_FAIL:
case BOOKMARK_COLLECTIONS_FETCH_FAIL:
return state.withMutations((map) => {
map.set('isLoading', false)
map.set('isFetched', true)
map.set('isError', true)
})
case BOOKMARK_COLLECTIONS_CREATE_REQUEST:
return state.update('items', list => list.push(fromJS(normalizeShortcut(action.shortcut))))
case BOOKMARK_COLLECTIONS_CREATE_SUCCESS:
return state.update('items', list => list.push(fromJS(action.bookmarkCollection)))
case BOOKMARK_COLLECTIONS_REMOVE_REQUEST:
return state.update('items', list => list.filterNot((item) => {
return `${item.get('id')}` === `${action.shortcutId}`
return item.get('id') === action.bookmarkCollectionId
}))
default:
return state

View File

@ -2,6 +2,8 @@ import { combineReducers } from 'redux-immutable'
import { loadingBarReducer } from 'react-redux-loading-bar'
import accounts from './accounts'
import accounts_counters from './accounts_counters'
import albums from './albums'
import bookmark_collections from './bookmark_collections'
import chats from './chats'
import chat_conversation_lists from './chat_conversation_lists'
import chat_conversation_messages from './chat_conversation_messages'
@ -52,6 +54,7 @@ import user_lists from './user_lists'
const reducers = {
accounts,
accounts_counters,
bookmark_collections,
chats,
chat_conversation_lists,
chat_conversation_messages,

View File

@ -16,17 +16,16 @@ import {
} from '../actions/bookmarks'
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
const initialMap = ImmutableMap({
next: null,
loaded: false,
isLoading: false,
items: ImmutableList(),
})
const initialState = ImmutableMap({
bookmarks: ImmutableMap({
next: null,
loaded: false,
items: ImmutableList(),
}),
favorites: ImmutableMap({
next: null,
loaded: false,
items: ImmutableList(),
}),
bookmarks: ImmutableMap(),
favorites: initialMap,
});
const normalizeList = (state, listType, statuses, next) => {
@ -62,14 +61,30 @@ export default function statusLists(state = initialState, action) {
switch (action.type) {
case BOOKMARKED_STATUSES_FETCH_REQUEST:
case BOOKMARKED_STATUSES_EXPAND_REQUEST:
return state.setIn(['bookmarks', 'isLoading'], true);
return state.updateIn(['bookmarks', action.bookmarkCollectionId], initialMap, map => map.set('isLoading', true))
case BOOKMARKED_STATUSES_FETCH_FAIL:
case BOOKMARKED_STATUSES_EXPAND_FAIL:
return state.setIn(['bookmarks', 'isLoading'], false);
return state.setIn(['bookmarks', action.bookmarkCollectionId, 'isLoading'], false);
case BOOKMARKED_STATUSES_FETCH_SUCCESS:
return normalizeList(state, 'bookmarks', action.statuses, action.next);
console.log("BOOKMARKED_STATUSES_FETCH_SUCCESS:", action)
try {
return state.updateIn(['bookmarks', action.bookmarkCollectionId], listMap => listMap.withMutations(map => {
map.set('next', action.next);
map.set('loaded', true);
map.set('isLoading', false);
map.set('items', ImmutableList(action.statuses.map(item => item.id)));
}))
} catch (error) {
console.log("error:", state, error)
}
return state
case BOOKMARKED_STATUSES_EXPAND_SUCCESS:
return appendToList(state, 'bookmarks', action.statuses, action.next);
return state.updateIn(['bookmarks', action.bookmarkCollectionId], listMap => listMap.withMutations(map => {
map.set('next', action.next);
map.set('isLoading', false);
map.set('items', map.get('items').concat(action.statuses.map(item => item.id)));
}))
case FAVORITED_STATUSES_FETCH_REQUEST:
case FAVORITED_STATUSES_EXPAND_REQUEST:
return state.setIn(['favorites', 'isLoading'], true);

View File

@ -86,7 +86,6 @@ const initialState = ImmutableMap({
blocks: ImmutableMap(),
mutes: ImmutableMap(),
chat_blocks: ImmutableMap(),
chat_mutes: ImmutableMap(),
groups: ImmutableMap(),
group_removed_accounts: ImmutableMap(),
group_join_requests: ImmutableMap(),

View File

@ -80,7 +80,7 @@ class Account < ApplicationRecord
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? }
validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
validates :note, note_length: { maximum: 500 }, if: -> { local? && will_save_change_to_note? }
validates :fields, length: { maximum: 4 }, if: -> { local? && will_save_change_to_fields? }
validates :fields, length: { maximum: 6 }, if: -> { local? && will_save_change_to_fields? }
scope :remote, -> { where.not(domain: nil) }
scope :local, -> { where(domain: nil) }
@ -260,7 +260,7 @@ class Account < ApplicationRecord
self[:fields] = fields
end
DEFAULT_FIELDS_SIZE = 4
DEFAULT_FIELDS_SIZE = 6
def build_fields
return if fields.size >= DEFAULT_FIELDS_SIZE

View File

@ -22,7 +22,7 @@
class ChatConversationAccount < ApplicationRecord
include Paginable
PER_ACCOUNT_APPROVED_LIMIT = 100
PER_ACCOUNT_APPROVED_LIMIT = 250
EXPIRATION_POLICY_MAP = {
none: nil,

View File

@ -7,6 +7,10 @@ module AccountAssociations
# Local users
has_one :user, inverse_of: :account, dependent: :destroy
# Chat
has_many :chat_messages, inverse_of: :account, dependent: :destroy
has_many :chat_conversation_accounts, inverse_of: :account, dependent: :destroy
# Timelines
has_many :statuses, inverse_of: :account, dependent: :destroy
has_many :favourites, inverse_of: :account, dependent: :destroy
@ -14,9 +18,10 @@ module AccountAssociations
has_many :notifications, inverse_of: :account, dependent: :destroy
has_many :scheduled_statuses, inverse_of: :account, dependent: :destroy
# Pinned statuses
# Bookmarked statuses
has_many :status_bookmarks, inverse_of: :account, dependent: :destroy
has_many :bookmarked_statuses, -> { reorder('status_bookmarks.created_at DESC') }, through: :status_bookmarks, class_name: 'Status', source: :status
has_many :status_bookmark_collections, inverse_of: :account, dependent: :destroy
# Pinned statuses
has_many :status_pins, inverse_of: :account, dependent: :destroy
@ -26,7 +31,7 @@ module AccountAssociations
has_many :media_attachments, dependent: :destroy
has_many :polls, dependent: :destroy
# PuSH subscriptions
# Push subscriptions
has_many :subscriptions, dependent: :destroy
# Report relationships

View File

@ -77,12 +77,6 @@ module AccountInteractions
has_many :chat_blocking, -> { order('chat_blocks.id desc') }, through: :chat_block_relationships, source: :target_account
has_many :chat_blocked_by_relationships, class_name: 'ChatBlock', foreign_key: :target_account_id, dependent: :destroy
has_many :chat_blocked_by, -> { order('chat_blocks.id desc') }, through: :chat_blocked_by_relationships, source: :account
# Chat mute relationships
has_many :chat_mute_relationships, class_name: 'ChatMute', foreign_key: 'account_id', dependent: :destroy
has_many :chat_muting, -> { order('chat_mutes.id desc') }, through: :chat_mute_relationships, source: :target_account
has_many :chat_muted_by_relationships, class_name: 'ChatMute', foreign_key: :target_account_id, dependent: :destroy
has_many :chat_muted_by, -> { order('chat_mutes.id desc') }, through: :chat_muted_by_relationships, source: :account
end
def follow!(other_account, reblogs: nil, uri: nil)

View File

@ -8,12 +8,13 @@
# account_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# visibility :string
#
class StatusBookmarkCollection < ApplicationRecord
PER_ACCOUNT_LIMIT = 100
PER_ACCOUNT_LIMIT = 150
belongs_to :account
belongs_to :account, inverse_of: :status_bookmark_collections
end

View File

@ -124,7 +124,7 @@ class User < ApplicationRecord
def confirm
new_user = !confirmed?
self.approved = true
self.approved = true if open_registrations?
super
@ -135,7 +135,7 @@ class User < ApplicationRecord
def confirm!
new_user = !confirmed?
self.approved = true
self.approved = true if open_registrations?
skip_confirmation!
save!
@ -258,7 +258,7 @@ class User < ApplicationRecord
private
def set_approved
self.approved = true
self.approved = open_registrations?
end
def external?
@ -305,4 +305,8 @@ class User < ApplicationRecord
end
end
def open_registrations?
Setting.registrations_mode == 'open'
end
end

View File

@ -6,7 +6,7 @@ class GroupPolicy < ApplicationPolicy
end
def create?
admin? or current_account.is_pro
true
end
def update?

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
class REST::StatusBookmarkCollectionSerializer < ActiveModel::Serializer
attributes :id, :title
def id
object.id.to_s
end
end

View File

@ -4,7 +4,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
attributes :id, :created_at, :revised_at, :in_reply_to_id, :in_reply_to_account_id,
:sensitive, :spoiler_text, :visibility, :language,
:url, :replies_count, :reblogs_count, :pinnable, :pinnable_by_group,
:favourites_count, :quote_of_id, :expires_at, :has_quote
:favourites_count, :quote_of_id, :expires_at, :has_quote, :bookmark_collection_id
attribute :favourited, if: :current_user?
attribute :reblogged, if: :current_user?
@ -168,6 +168,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
object.active_mentions.to_a.sort_by(&:id)
end
def bookmark_collection_id
instance_options[:bookmark_collection_id]
end
class ApplicationSerializer < ActiveModel::Serializer
attributes :name, :website
end

View File

@ -2,6 +2,8 @@
class AppSignUpService < BaseService
def call(app, params)
return unless allowed_registrations?
user_params = params.slice(:email, :password, :agreement, :locale)
account_params = params.slice(:username)
user = User.create!(user_params.merge(created_by_application: app, password_confirmation: user_params[:password], account_attributes: account_params))
@ -12,4 +14,9 @@ class AppSignUpService < BaseService
expires_in: Doorkeeper.configuration.access_token_expires_in,
use_refresh_token: Doorkeeper.configuration.refresh_token_enabled?)
end
def allowed_registrations?
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
end
end

View File

@ -3,6 +3,14 @@
require 'rubygems/package'
# : todo :
# albums
# bookmarks
# bookmark collections
# chat messages
# chat conversations
# joined group
# removed groups
class BackupService < BaseService
attr_reader :account, :backup, :collection

View File

@ -121,7 +121,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?)

View File

@ -16,9 +16,7 @@ class SuspendAccountService < BaseService
list_accounts
media_attachments
mute_relationships
chat_mute_relationships
muted_by_relationships
chat_muted_by_relationships
notifications
owned_lists
passive_relationships

View File

@ -12,6 +12,7 @@ class FollowLimitValidator < ActiveModel::Validator
class << self
def limit_for_account(account)
adjusted_limit = account.is_pro ? 50000 : LIMIT
adjusted_limit = account.is_flagged_as_spam ? 0 : LIMIT
if account.following_count < adjusted_limit
adjusted_limit

View File

@ -15,7 +15,7 @@ ar:
context: واحد أو أكثر من السياقات التي يجب أن ينطبق عليها عامل التصفية
digest: تُرسَل إليك بعد مُضيّ مدة مِن خمول نشاطك و فقط إذا ما تلقيت رسائل شخصية مباشِرة أثناء فترة غيابك مِن الشبكة
email: سوف تتلقى رسالة إلكترونية للتأكيد
fields: يُمكنك عرض 4 عناصر على شكل جدول في ملفك الشخصي
fields: يُمكنك عرض 6 عناصر على شكل جدول في ملفك الشخصي
header: ملف PNG أو GIF أو JPG. حجمه على أقصى تصدير %{size}. سيتم تصغيره إلى %{dimensions}px
inbox_url: نسخ العنوان الذي تريد استخدامه مِن صفحة الإستقبال للمُرحَّل
irreversible: التبويقات التي تم تصفيتها ستختفي لا محالة حتى و إن تمت إزالة عامِل التصفية لاحقًا

View File

@ -17,7 +17,7 @@ ca:
digest: Només s'envia després d'un llarg període d'inactivitat amb un resum de les mencions que has rebut en la teva absència
discoverable_html: El <a href="%{path}" target="_blank">directori</a> permet trobar usuaris en funció dels interessos i activitat. Requereix almenys %{min_followers} seguidors
email: Se t'enviarà un correu electrònic de confirmació
fields: Pots tenir fins a 4 elements que es mostren com a taula al teu perfil
fields: Pots tenir fins a 6 elements que es mostren com a taula al teu perfil
header: PNG, GIF o JPG. Màxim %{size}. S'escalarà a %{dimensions}px
inbox_url: Copia l'URL des de la pàgina principal del relay que vols utilitzar
irreversible: Els nodes filtrats desapareixeran de manera irreversible, fins i tot si el filtre es retira més tard

View File

@ -17,7 +17,7 @@ co:
digest: Solu mandatu dopu à una longa perioda dinattività, è solu selli ci sò novi missaghji diretti
discoverable_html: L'<a href="%{path}" target="_blank">annuariu</a> permette à a ghjente di truvà conti à partesi d'interessi è d'attività. Ci vole à avè almenu %{min_followers} abbunati
email: Avete da riceve un'e-mail di cunfirmazione
fields: Pudete avè finà 4 elementi mustrati cumun tavulone nantà u vostru prufile
fields: Pudete avè finà 6 elementi mustrati cumun tavulone nantà u vostru prufile
header: Furmatu PNG, GIF o JPG. %{size} o menu. Sarà ridottu à %{dimensions}px
inbox_url: Cupiate l'URL di a pagina d'accolta di u ripetitore chì vulete utilizà
irreversible: I statuti filtrati saranu sguassati di manera irreversibile, ancu s'ellu hè toltu u filtru

View File

@ -17,7 +17,7 @@ cs:
digest: Odesíláno pouze po dlouhé době nečinnosti a pouze, pokud jste při své nepřítomnosti obdržel/a osobní zprávy
discoverable_html: <a href="%{path}" target="_blank">Adresář</a> dovoluje lidem najít účty podle zájmů a aktivity. Vyžaduje alespoň %{min_followers} sledujících
email: Bude vám poslán potvrzovací e-mail
fields: Na profilu můžete mít až 4 položky zobrazené jako tabulka
fields: Na profilu můžete mít až 6 položky zobrazené jako tabulka
header: PNG, GIF či JPG. Maximálně %{size}. Bude zmenšen na %{dimensions} px
inbox_url: Zkopírujte URL z hlavní stránky mostu, který chcete použít
irreversible: Filtrované gabs nenávratně zmizí, i pokud bude filtr později odstraněn

View File

@ -9,7 +9,7 @@ cy:
context: Un neu fwy cyd-destun lle dylai'r hidlydd weithio
digest: Ond yn cael eu hanfon ar ôl cyfnod hir o anweithgarwch ac ond os ydych wedi derbyn unrhyw negeseuon personol yn eich absenoldeb
email: Byddwch yn derbyn e-bost i gadarnhau
fields: Mae modd i chi arddangos hyd at 4 eitem fel tabl ar eich proffil
fields: Mae modd i chi arddangos hyd at 6 eitem fel tabl ar eich proffil
header: PNG, GIF neu JPG. %{size} ar y mwyaf. Ceith ei israddio i %{dimensions}px
inbox_url: Copïwch yr URL o dudalen flaen y relái yr ydych am ei ddefnyddio
irreversible: Bydd tŵtiau wedi eu hidlo yn diflannu am byth, hyd yn oed os ceith yr hidlydd ei ddileu'n hwyrach

View File

@ -11,7 +11,7 @@ da:
context: En eller flere sammenhænge hvor filteret skal være gældende
digest: Sendes kun efter en lang periode med inaktivitet og kun hvis du har modtaget nogle personlige beskeder mens du er væk
email: Du vil få tilsendt en bekræftelsed mail
fields: Du kan have op til 4 ting vist som en tabel på din profil
fields: Du kan have op til 6 ting vist som en tabel på din profil
header: PNG, GIF eller JPG. Højest %{size}. Vil blive skaleret ned til %{dimensions}px
inbox_url: Kopiere linket fra forsiden af den relay som du ønsker at bruge
irreversible: Filtrerede trut vil forsvinde fulstændigt, selv hvis filteret senere skulle blive fjernet

View File

@ -17,7 +17,7 @@ de:
digest: Wenn du lange Zeit inaktiv bist, wird dir eine Zusammenfassung von Erwähnungen in deiner Abwesenheit zugeschickt
discoverable_html: Das <a href="%{path}" target="_blank">Verzeichnis</a> lässt dich basierend auf Interessen und Aktivitäten neue Benutzerkonten finden. Dies benötigt mindestens %{min_followers} Follower
email: Du wirst eine Bestätigungs-E-Mail erhalten
fields: Du kannst bis zu 4 Elemente auf deinem Profil anzeigen lassen, die als Tabelle dargestellt werden
fields: Du kannst bis zu 6 Elemente auf deinem Profil anzeigen lassen, die als Tabelle dargestellt werden
header: PNG, GIF oder JPG. Maximal %{size}. Wird auf %{dimensions} px herunterskaliert
inbox_url: Kopiere die URL von der Startseite des gewünschten Relays
irreversible: Gefilterte Beiträge werden unwiderruflich gefiltert, selbst wenn der Filter später entfernt wurde

View File

@ -17,7 +17,7 @@ el:
digest: Αποστέλλεται μόνο μετά από μακρά περίοδο αδράνειας και μόνο αν έχεις λάβει προσωπικά μηνύματα κατά την απουσία σου
discoverable_html: "Ο <a href=\"%{path}\" target=\"_blank\">κατάλογος</a> \nσου επιτρέπει να βρεις λογαριασμούς βάσει ενδιαφερόντων και δραστηριότητας. Απαιτεί τουλάχιστον %{min_followers} ακόλουθους"
email: Θα σου σταλεί email επιβεβαίωσης
fields: Μπορείς να έχεις έως 4 σημειώσεις σε μορφή πίνακα στο προφίλ σου
fields: Μπορείς να έχεις έως 6 σημειώσεις σε μορφή πίνακα στο προφίλ σου
header: PNG, GIF ή JPG. Έως %{size}. Θα περιοριστεί σε διάσταση %{dimensions}px
inbox_url: Αντέγραψε το URL της αρχικής σελίδας του ανταποκριτή (relay) που θέλεις να χρησιμοποιήσεις
irreversible: Τα φιλτραρισμένα τουτ θα εξαφανιστούν αμετάκλητα, ακόμα και αν το φίλτρο αργότερα αφαιρεθεί

View File

@ -17,7 +17,7 @@ en:
digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence
discoverable_html: The <a href="%{path}" target="_blank">directory</a> lets people find accounts based on interests and activity. Requires at least %{min_followers} followers
email: You will be sent a confirmation e-mail
fields: You can have up to 4 items displayed as a table on your profile
fields: You can have up to 6 items displayed as a table on your profile
header: PNG, GIF or JPG. At most %{size}. Will be downscaled to %{dimensions}px
inbox_url: Copy the URL from the frontpage of the relay you want to use
irreversible: Filtered gabs will disappear irreversibly, even if filter is later removed

View File

@ -17,7 +17,7 @@ en_GB:
digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence
discoverable_html: The <a href="%{path}" target="_blank">directory</a> lets people find accounts based on interests and activity. Requires at least %{min_followers} followers
email: You will be sent a confirmation e-mail
fields: You can have up to 4 items displayed as a table on your profile
fields: You can have up to 6 items displayed as a table on your profile
header: PNG, GIF or JPG. At most %{size}. Will be downscaled to %{dimensions}px
inbox_url: Copy the URL from the frontpage of the relay you want to use
irreversible: Filtered gabs will disappear irreversibly, even if filter is later removed

View File

@ -17,7 +17,7 @@ eo:
digest: Sendita nur post longa tempo de neaktiveco, kaj nur se vi ricevis personan mesaĝon en via foresto
discoverable_html: La <a href="%{path}" target="_blank">profilujo</a> permesas al homoj trovi kontojn laŭ interesoj kaj aktiveco. Postulas almenaŭ %{min_followers} sekvantojn
email: Vi ricevos konfirman retmesaĝon
fields: Vi povas havi ĝis 4 tabelajn elementojn en via profilo
fields: Vi povas havi ĝis 6 tabelajn elementojn en via profilo
header: Formato PNG, GIF aŭ JPG. Ĝis %{size}. Estos malgrandigita al %{dimensions}px
inbox_url: Kopiu la URL de la ĉefpaĝo de la ripetilo, kiun vi volas uzi
irreversible: Elfiltritaj mesaĝoj malaperos por ĉiam, eĉ se la filtrilo estas poste forigita

View File

@ -8,7 +8,7 @@ es:
bot: Esta cuenta ejecuta principalmente acciones automatizadas y podría no ser monitorizada
context: Uno o múltiples contextos en los que debe aplicarse el filtro
digest: Solo enviado tras un largo periodo de inactividad y solo si has recibido mensajes personales durante tu ausencia
fields: Puedes tener hasta 4 elementos mostrándose como una tabla en tu perfil
fields: Puedes tener hasta 6 elementos mostrándose como una tabla en tu perfil
header: PNG, GIF o JPG. Máximo %{size}. Será escalado a %{dimensions}px
inbox_url: Copia la URL de la página principal del relés que quieres utilizar
irreversible: Los gabs filtrados desaparecerán irreversiblemente, incluso si este filtro es eliminado más adelante

View File

@ -17,7 +17,7 @@ eu:
digest: Soilik jarduerarik gabeko epe luze bat eta gero, eta soilik ez zeudela mezu pertsonalen bat jaso baduzu
discoverable_html: <a href="%{path}" target="_blank">Direktorioa</a>k Jendea interesen eta jardueraren arabera aurkitzea ahalbidetzen du. Gutxienez %{min_followers} jarraitzaile behar dira bertan agertzeko
email: Baieztapen e-mail bat bidaliko zaizu
fields: 4 elementu bistaratu ditzakezu taula batean zure profilean
fields: 6 elementu bistaratu ditzakezu taula batean zure profilean
header: PNG, GIF edo JPG. Gehienez %{size}. %{dimensions}px eskalara txikituko da
inbox_url: Kopiatu erabili nahi duzun errelearen hasiera orriaren URLa
irreversible: Iragazitako Gab-ak betirako galduko dira, geroago iragazkia kentzen baduzu ere

View File

@ -8,7 +8,7 @@ fi:
defaults:
avatar: PNG, GIF tai JPG. Enintään %{size}. Skaalataan kokoon %{dimensions} px
digest: Lähetetään vain pitkän poissaolon jälkeen ja vain, jos olet saanut suoria viestejä poissaolosi aikana
fields: Sinulla voi olla korkeintaan 4 asiaa profiilissasi taulukossa
fields: Sinulla voi olla korkeintaan 6 asiaa profiilissasi taulukossa
header: PNG, GIF tai JPG. Enintään %{size}. Skaalataan kokoon %{dimensions} px
locked: Sinun täytyy hyväksyä seuraajat manuaalisesti
setting_noindex: Vaikuttaa julkiseen profiiliisi ja tilasivuihisi

View File

@ -17,7 +17,7 @@ fr:
digest: Uniquement envoyé après une longue période dinactivité et uniquement si vous avez reçu des messages personnels pendant votre absence
discoverable_html: L'<a href="%{path}" target="_blank">annuaire</a> permet aux gens de trouver des comptes en se basant sur les intérêts et les activités. Nécessite au moins %{min_followers} abonnés
email: Vous recevrez un courriel de confirmation
fields: Vous pouvez avoir jusquà 4 éléments affichés en tant que tableau sur votre profil
fields: Vous pouvez avoir jusquà 6 éléments affichés en tant que tableau sur votre profil
header: Au format PNG, GIF ou JPG. %{size} maximum. Sera réduit à %{dimensions}px
inbox_url: Copiez lURL depuis la page daccueil du relais que vous souhaitez utiliser
irreversible: Les pouets filtrés disparaîtront irrémédiablement, même si le filtre est supprimé plus tard

View File

@ -17,7 +17,7 @@ gl:
digest: Enviar só tras un longo período de inactividade e só si recibeu algunha mensaxe persoal na súa ausencia
discoverable_html: O <a href="%{path}" target="_blank">directorio</a> permite atopar contas en función de intereses e actividade. Require ter ao menos %{min_followers} seguidoras
email: Enviaráselle un correo-e de confirmación
fields: Pode ter ate 4 elementos no seu perfil mostrados como unha táboa
fields: Pode ter ate 6 elementos no seu perfil mostrados como unha táboa
header: PNG, GIF ou JPG. Máximo %{size}. Será reducida a %{dimensions}px
inbox_url: Copiar o URL desde a páxina de inicio do repetidor que quere utilizar
irreversible: Os gabs filtrados desaparecerán de xeito irreversible, incluso si despois se elimina o filtro

View File

@ -17,7 +17,7 @@ it:
digest: Inviata solo dopo un lungo periodo di inattività e solo se hai ricevuto qualche messaggio personale in tua assenza
discoverable_html: La <a href="%{path}" target="_blank">directory</a> permette alle persone di trovare account in base a determinati interessi o attività. Richiede almeno %{min_followers} seguaci
email: Ti manderemo una email di conferma
fields: Puoi avere fino a 4 voci visualizzate come una tabella sul tuo profilo
fields: Puoi avere fino a 6 voci visualizzate come una tabella sul tuo profilo
header: PNG, GIF o JPG. Al massimo %{size}. Verranno scalate a %{dimensions}px
inbox_url: Copia la URL dalla pagina iniziale del ripetitore che vuoi usare
irreversible: I gab filtrati scompariranno in modo irreversibile, anche se il filtro viene eliminato

View File

@ -17,7 +17,7 @@ ja:
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
discoverable_html: <a href="%{path}" target="_blank">ディレクトリ</a> は興味や活動をもとにアカウントを見つけることを可能にします。 掲載には %{min_followers} 人以上のフォロワーが必要です
email: 確認のメールが送信されます
fields: プロフィールに表として4つまでの項目を表示することができます
fields: プロフィールに表として6つまでの項目を表示することができます
header: "%{size}までのPNG、GIF、JPGが利用可能です。 %{dimensions}pxまで縮小されます"
inbox_url: 使用したいリレーサーバーのトップページからURLをコピーします
irreversible: フィルターが後で削除されても、除外されたトゥートは元に戻せなくなります

View File

@ -17,7 +17,7 @@ nl:
digest: Wordt alleen na een lange periode van inactiviteit verzonden en alleen wanneer je tijdens jouw afwezigheid persoonlijke berichten hebt ontvangen
discoverable_html: In de <a href="%{path}" target="_blank">gebruikersgids</a> kunnen mensen andere accounts vinden aan de hand van interesses en activiteit. Dit vereist tenminste %{min_followers} volgers
email: Je krijgt een bevestigingsmail
fields: Je kan maximaal 4 items als een tabel op je profiel weergeven
fields: Je kan maximaal 6 items als een tabel op je profiel weergeven
header: PNG, GIF of JPG. Maximaal %{size}. Wordt teruggeschaald naar %{dimensions}px
inbox_url: Kopieer de URL van de voorpagina van de relayserver die je wil gebruiken
irreversible: Gefilterde gabs verdwijnen onomkeerbaar, zelfs als de filter later wordt verwijderd

View File

@ -17,7 +17,7 @@ oc:
digest: Solament enviat aprèp un long moment dinactivitat e solament savètz recebut de messatges personals pendent vòstra abséncia
discoverable_html: L<a href="%{path}" target="_blank">annuari</a> permet al monde de trobar de comptes segon lor interèsses e activitats. Requerís almens %{min_followers} seguidors
email: Vos mandarem un corrièl de confirmacion
fields: Podètz far veire cap a 4 elements sus vòstre perfil
fields: Podètz far veire cap a 6 elements sus vòstre perfil
header: PNG, GIF o JPG. Maximum %{size}. Serà retalhada en %{dimensions}px
inbox_url: Copiatz lURL de la pagina màger del relai que volètz utilizar
irreversible: Los tuts filtrats desapareisseràn irreversiblament, encara que lo filtre siá suprimit mai tard

View File

@ -17,7 +17,7 @@ pl:
digest: Wysyłane tylko po długiej nieaktywności, jeżeli w tym czasie otrzymaleś jakąś wiadomość bezpośrednią
discoverable_html: <a href="%{path}" target="_blank">Katalog</a> pozwala znaleźć konta na podstawie zainteresowań i aktywności. Profil musi śledzić przynajmniej %{min_followers} osób
email: Otrzymasz e-mail potwierdzający
fields: Możesz ustawić maksymalnie 4 niestandardowe pola wyświetlane jako tabela na Twoim profilu
fields: Możesz ustawić maksymalnie 6 niestandardowe pola wyświetlane jako tabela na Twoim profilu
header: PNG, GIF lub JPG. Maksymalnie %{size}. Zostanie zmniejszony do %{dimensions}px
inbox_url: Skopiuj adres ze strony głównej przekaźnika, którego chcesz użyć
irreversible: Filtrowane wpisy znikną bezpowrotnie, nawet gdy filtr zostanie usunięty

View File

@ -17,7 +17,7 @@ pt-BR:
digest: Enviado após um longo período de inatividade com um resumo das menções que você recebeu em sua ausência
discoverable_html: O <a href="%{path}" target="_blank">diretório</a> permite encontrar contas baseado em seus interesses e atividades. Requer pelo menos %{min_followers} seguidores
email: Você receberá um email de confirmação
fields: Você pode ter até 4 itens exibidos em forma de tabela no seu perfil
fields: Você pode ter até 6 itens exibidos em forma de tabela no seu perfil
header: PNG, GIF or JPG. Arquivos de até %{size}. Eles serão diminuídos para %{dimensions}px
inbox_url: Copie a URL da página inicial do repetidor que você quer usar
irreversible: Os gabs filtrados vão desaparecer irreversivelmente, mesmo se o filtro for removido depois

View File

@ -17,7 +17,7 @@ pt:
digest: Enviado após um longo período de inatividade e apenas se foste mencionado na tua ausência
discoverable_html: O <a href="%{path}" target="_blank">directory</a> permite encontrar contas de pessoas com base nos seus interesses e actividades. Exige, pelo menos %{min_followers} seguidores
email: Será enviado um e-mail de confirmação
fields: Podes ter até 4 itens expostos, em forma de tabela, no teu perfil
fields: Podes ter até 6 itens expostos, em forma de tabela, no teu perfil
header: PNG, GIF or JPG. Arquivos até %{size}. Vão ser reduzidos para %{dimensions}px
inbox_url: Copia a URL da página inicial do repetidor que queres usar
irreversible: Publicações filtradas irão desaparecer irremediavelmente, mesmo que o filtro seja removido posteriormente

View File

@ -17,7 +17,7 @@ ro:
digest: Este trimis doar după o lungă perioadă de inactivitate și numai dacă primești mesaje personale în perioada de absență
discoverable_html: <a href="%{path}" target="_blank">Directorul</a> permite utilizatorilor să găsească conturi după interese și activități. Necesită minim %{min_followers} urmăritori
email: Vei primi un e-mail de confirmare
fields: Poti afișa pană la maxim 4 adrese sub formă de tabel pe pofilul tău
fields: Poti afișa pană la maxim 6 adrese sub formă de tabel pe pofilul tău
header: PNG, GIF sau JPG. Cel mult %{size}. Vor fi redimensionate la %{dimensions}px
inbox_url: Copiază adresa URL de pe prima pagină a reului pe care vrei să îl utilizezi
irreversible: Postările sortate vor dispărea ireversibil, chiar dacă filtrul este ulterior șters

View File

@ -17,7 +17,7 @@ ru:
digest: Отсылается лишь после длительной неактивности, если вы в это время получали личные сообщения
discoverable_html: <a href="%{path}" target="_blank">Каталог</a> позволяет пользователям искать людей по интересам и активности. Необходимо наличие не менее %{min_followers} подписчиков
email: Вам будет отправлено электронное письмо с подтверждением
fields: В профиле можно отобразить до 4 пунктов как таблицу
fields: В профиле можно отобразить до 6 пунктов как таблицу
header: PNG, GIF или JPG. Максимально %{size}. Будет уменьшено до %{dimensions}px
inbox_url: Копировать URL с главной страницы ретранслятора, который вы хотите использовать
irreversible: Отфильтрованные статусы будут утеряны навсегда, даже если в будущем фильтр будет убран

View File

@ -9,7 +9,7 @@ sl:
context: En ali več kontekstov, kjer naj se uporabi filter
digest: Pošlje se le po dolgem obdobju nedejavnosti in samo, če ste prejeli osebna sporočila v vaši odsotnosti
email: Poslali vam bomo potrditveno e-pošto
fields: Na svojem profilu lahko imate do 4 predmete prikazane kot tabelo.
fields: Na svojem profilu lahko imate do 6 predmete prikazane kot tabelo.
header: PNG, GIF ali JPG. Največ %{size}. Zmanjšana bo na %{dimensions}px
inbox_url: Kopirajte URL naslov s prve strani releja, ki ga želite uporabiti
irreversible: Filtrirani trobi bodo nepovratno izginili, tudi če je filter kasneje odstranjen

View File

@ -17,7 +17,7 @@ sq:
digest: I dërguar vetëm pas një periudhe të gjatë pasiviteti dhe vetëm nëse keni marrë ndonjë mesazh personal gjatë mungesës suaj
discoverable_html: <a href="%{path}" target="_blank">Drejtoria</a> u lejon njerëzve të gjejnë llogari bazuar në interesat dhe veprimtarinë. Lyp të paktën %{min_followers} ndjekës
email: Do tju dërgohet një email ripohimi
fields: Te profili juaj mund të keni deri në 4 objekte të shfaqur si tabelë
fields: Te profili juaj mund të keni deri në 6 objekte të shfaqur si tabelë
header: PNG, GIF ose JPG. E shumta %{size}. Do të ripërmasohet në %{dimensions}px
inbox_url: Kopjoni URL-në prej faqes ballore të relesë që doni të përdorni
irreversible: Mesazhet e filtruar do të zhduket në mënyrë të pakthyeshme, edhe nëse filtri hiqet më vonë

View File

@ -17,7 +17,7 @@ sr:
digest: Послато после дужег периода неактивности са прегледом свих битних ствари које сте добили док сте били одсутни
discoverable_html: <a href="%{path}" target="_blank">Директоријум</a> омогућава људима да пронађу налоге засноване на интересима и активности. Захтева бар %{min_followers} пратиоца
email: Биће вам послата е-пошта са потврдом
fields: Можете имати до 4 ставке приказане као табела на вашем профилу
fields: Можете имати до 6 ставке приказане као табела на вашем профилу
header: PNG, GIF или JPG. Највише %{size}. Биће смањена на %{dimensions}px
inbox_url: Копирајте URL са насловне стране релеја који желите користити
irreversible: Филтриранe трубе ће нестати неповратно, чак и ако је филтер касније уклоњен

View File

@ -13,7 +13,7 @@ sv:
bot: Detta konto utför huvudsakligen automatiserade åtgärder och kanske inte övervakas
digest: Skickas endast efter en lång period av inaktivitet och endast om du har fått några personliga meddelanden i din frånvaro
email: Ett konfirmationsmeddelande kommer att skickas till dig via epost
fields: Du kan ha upp till 4 objekt visade som en tabell på din profil
fields: Du kan ha upp till 6 objekt visade som en tabell på din profil
header: PNG, GIF eller JPG. Högst %{size}. Kommer att skalas ner till %{dimensions}px
irreversible: Filtrerade inlägg kommer att försvinna oåterkalleligt, även om filter tas bort senare
locale: Användargränssnittets språk, e-post och push-aviseringar

View File

@ -17,7 +17,7 @@ th:
digest: ส่งเฉพาะหลังจากไม่มีการใช้งานเป็นเวลานานและในกรณีที่คุณได้รับข้อความส่วนบุคคลใด ๆ เมื่อคุณไม่อยู่เท่านั้น
discoverable_html: <a href="%{path}" target="_blank">ไดเรกทอรี</a> ช่วยให้ผู้คนค้นหาบัญชีตามความสนใจและกิจกรรม ต้องการอย่างน้อย %{min_followers} ผู้ติดตาม
email: คุณจะได้รับอีเมลยืนยัน
fields: คุณสามารถมีได้มากถึง 4 รายการแสดงผลเป็นตารางในโปรไฟล์ของคุณ
fields: คุณสามารถมีได้มากถึง 6 รายการแสดงผลเป็นตารางในโปรไฟล์ของคุณ
header: PNG, GIF หรือ JPG สูงสุด %{size} จะถูกย่อขนาดเป็น %{dimensions}px
inbox_url: คัดลอก URL จากหน้าแรกของรีเลย์ที่คุณต้องการใช้
irreversible: โพสต์ที่กรองจะหายไปอย่างถาวร แม้ว่าจะเอาตัวกรองออกในภายหลัง

View File

@ -7,7 +7,7 @@ zh-CN:
avatar: 文件大小限制 %{size},只支持 PNG、GIF 或 JPG 格式。图片分辨率将会压缩至 %{dimensions}px
bot: 来自这个帐户的绝大多数操作都是自动进行的,并且可能无人监控
digest: 仅在你长时间未登录,且收到了私信时发送
fields: 这将会在个人资料页上以表格的形式展示,最多 4 个项目
fields: 这将会在个人资料页上以表格的形式展示,最多 6 个项目
header: 文件大小限制 %{size},只支持 PNG、GIF 或 JPG 格式。图片分辨率将会压缩至 %{dimensions}px
locale: 用户界面、电子邮件和推送通知中使用的语言
locked: 你需要手动审核所有关注请求

View File

@ -7,7 +7,7 @@ zh-HK:
avatar: 支援 PNG, GIF 或 JPG 圖片,檔案最大為 %{size},會縮裁成 %{dimensions}px
bot: 提醒用戶本帳號是機械人
digest: 僅在你長時間未登錄,且收到了私信時發送
fields: 個人資料頁可顯示多至 4 個項目
fields: 個人資料頁可顯示多至 6 個項目
header: 支援 PNG, GIF 或 JPG 圖片,檔案最大為 %{size},會縮裁成 %{dimensions}px
locale: 使用者介面、電郵和通知的語言
locked: 你必須人手核准每個用戶對你的關注請求,而你的文章私隱會被預設為「只有關注你的人能看」

View File

@ -284,10 +284,15 @@ Rails.application.routes.draw do
resources :reports, only: [:create]
resources :filters, only: [:index, :create, :show, :update, :destroy]
resources :shortcuts, only: [:index, :create, :show, :destroy]
resources :bookmarks, only: [:index]
resources :bookmark_collections, only: [:index, :create, :update, :show, :destroy]
resources :albums, only: [:index, :create, :update, :show, :destroy]
resources :bookmark_collections, only: [:index, :create, :show, :update, :destroy] do
resources :bookmarks, only: [:index], controller: 'bookmark_collections/bookmarks'
member do
post :update_status
end
end
get '/search', to: 'search#index', as: :search
get '/account_by_username/:username', to: 'account_by_username#show', username: username_regex
@ -385,12 +390,22 @@ Rails.application.routes.draw do
end
end
# : todo :
# get '/:username/with_replies', to: 'accounts#show', username: username_regex, as: :short_account_with_replies
# get '/:username/comments_only', to: 'accounts#show', username: username_regex, as: :short_account_comments_only
# get '/:username/media', to: 'accounts#show', username: username_regex, as: :short_account_media
# get '/:username/tagged/:tag', to: 'accounts#show', username: username_regex, as: :short_account_tag
# get '/:username/posts/:statusId/reblogs', to: 'statuses#show', username: username_regex
# get '/:account_username/posts/:id', to: 'statuses#show', account_username: username_regex, as: :short_account_status
# get '/:account_username/posts/:id/embed', to: 'statuses#embed', account_username: username_regex, as: :embed_short_account_status
get '/g/:groupSlug', to: 'react#groupBySlug'
get '/(*any)', to: 'react#react', as: :web
root 'react#react'
get '/', to: 'react#react', as: :homepage
# : todo :
get '/about', to: 'react#react'
get '/about/tos', to: 'react#react'
get '/about/privacy', to: 'react#react'

View File

@ -0,0 +1,18 @@
class AddMissingForeignKeys < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def change
safety_assured { add_foreign_key :chat_blocks, :accounts, column: :target_account_id, on_delete: :cascade }
safety_assured { add_foreign_key :chat_blocks, :accounts, column: :account_id, on_delete: :cascade }
safety_assured { add_foreign_key :chat_conversation_accounts, :chat_messages, column: :last_chat_message_id, on_delete: :nullify }
safety_assured { add_foreign_key :chat_messages, :accounts, column: :from_account_id, on_delete: :cascade }
safety_assured { add_foreign_key :chat_messages, :chat_conversations, column: :chat_conversation_id, on_delete: :cascade }
safety_assured { add_foreign_key :status_bookmark_collections, :accounts, column: :account_id, on_delete: :cascade }
safety_assured { add_foreign_key :media_attachment_albums, :accounts, column: :account_id, on_delete: :cascade }
safety_assured { add_foreign_key :media_attachment_albums, :media_attachments, column: :cover_id, on_delete: :nullify }
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_12_16_051551) do
ActiveRecord::Schema.define(version: 2020_12_17_003945) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@ -879,8 +879,13 @@ ActiveRecord::Schema.define(version: 2020_12_16_051551) do
add_foreign_key "backups", "users", on_delete: :nullify
add_foreign_key "blocks", "accounts", column: "target_account_id", name: "fk_9571bfabc1", on_delete: :cascade
add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
add_foreign_key "chat_blocks", "accounts", column: "target_account_id", on_delete: :cascade
add_foreign_key "chat_blocks", "accounts", on_delete: :cascade
add_foreign_key "chat_conversation_accounts", "accounts", on_delete: :cascade
add_foreign_key "chat_conversation_accounts", "chat_conversations", on_delete: :cascade
add_foreign_key "chat_conversation_accounts", "chat_messages", column: "last_chat_message_id", on_delete: :nullify
add_foreign_key "chat_messages", "accounts", column: "from_account_id", on_delete: :cascade
add_foreign_key "chat_messages", "chat_conversations", on_delete: :cascade
add_foreign_key "custom_filters", "accounts", on_delete: :cascade
add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade
add_foreign_key "favourites", "statuses", name: "fk_b0e856845e", on_delete: :cascade
@ -902,6 +907,8 @@ ActiveRecord::Schema.define(version: 2020_12_16_051551) do
add_foreign_key "list_accounts", "follows", on_delete: :cascade
add_foreign_key "list_accounts", "lists", on_delete: :cascade
add_foreign_key "lists", "accounts", on_delete: :cascade
add_foreign_key "media_attachment_albums", "accounts", on_delete: :cascade
add_foreign_key "media_attachment_albums", "media_attachments", column: "cover_id", on_delete: :nullify
add_foreign_key "media_attachments", "accounts", name: "fk_96dd81e81b", on_delete: :nullify
add_foreign_key "media_attachments", "media_attachment_albums", on_delete: :nullify
add_foreign_key "media_attachments", "scheduled_statuses", on_delete: :nullify
@ -931,6 +938,7 @@ ActiveRecord::Schema.define(version: 2020_12_16_051551) do
add_foreign_key "session_activations", "oauth_access_tokens", column: "access_token_id", name: "fk_957e5bda89", on_delete: :cascade
add_foreign_key "session_activations", "users", name: "fk_e5fda67334", on_delete: :cascade
add_foreign_key "shortcuts", "accounts", on_delete: :cascade
add_foreign_key "status_bookmark_collections", "accounts", on_delete: :cascade
add_foreign_key "status_bookmarks", "accounts", on_delete: :cascade
add_foreign_key "status_bookmarks", "status_bookmark_collections", on_delete: :nullify
add_foreign_key "status_bookmarks", "statuses", on_delete: :cascade