diff --git a/app/javascript/gabsocial/features/introduction.js b/app/javascript/gabsocial/features/introduction.js
index d90a5a34..34a870b1 100644
--- a/app/javascript/gabsocial/features/introduction.js
+++ b/app/javascript/gabsocial/features/introduction.js
@@ -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}
diff --git a/app/javascript/gabsocial/features/messages/components/chat_message_compose_form.js b/app/javascript/gabsocial/features/messages/components/chat_message_compose_form.js
index 10daddc1..59bec7ab 100644
--- a/app/javascript/gabsocial/features/messages/components/chat_message_compose_form.js
+++ b/app/javascript/gabsocial/features/messages/components/chat_message_compose_form.js
@@ -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)
\ No newline at end of file
+export default connect(mapStateToProps, mapDispatchToProps)(ChatMessagesComposeForm)
\ No newline at end of file
diff --git a/app/javascript/gabsocial/features/ui/ui.js b/app/javascript/gabsocial/features/ui/ui.js
index b8931842..9b04a59f 100644
--- a/app/javascript/gabsocial/features/ui/ui.js
+++ b/app/javascript/gabsocial/features/ui/ui.js
@@ -61,6 +61,7 @@ import {
BlockedAccounts,
BookmarkCollections,
BookmarkCollectionCreate,
+ BookmarkCollectionEdit,
BookmarkedStatuses,
CaliforniaConsumerProtection,
CaliforniaConsumerProtectionContact,
@@ -282,10 +283,11 @@ class SwitchingArea extends React.PureComponent {
-
-
+
+
+
diff --git a/app/javascript/gabsocial/features/ui/util/async_components.js b/app/javascript/gabsocial/features/ui/util/async_components.js
index 26590bda..982cc781 100644
--- a/app/javascript/gabsocial/features/ui/util/async_components.js
+++ b/app/javascript/gabsocial/features/ui/util/async_components.js
@@ -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') }
diff --git a/app/javascript/gabsocial/reducers/albums.js b/app/javascript/gabsocial/reducers/albums.js
index 384ee9a9..91841747 100644
--- a/app/javascript/gabsocial/reducers/albums.js
+++ b/app/javascript/gabsocial/reducers/albums.js
@@ -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
diff --git a/app/javascript/gabsocial/reducers/bookmark_collections.js b/app/javascript/gabsocial/reducers/bookmark_collections.js
index ab48880f..c82cabfc 100644
--- a/app/javascript/gabsocial/reducers/bookmark_collections.js
+++ b/app/javascript/gabsocial/reducers/bookmark_collections.js
@@ -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
diff --git a/app/javascript/gabsocial/reducers/index.js b/app/javascript/gabsocial/reducers/index.js
index 97a67c47..a2f85565 100644
--- a/app/javascript/gabsocial/reducers/index.js
+++ b/app/javascript/gabsocial/reducers/index.js
@@ -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,
diff --git a/app/javascript/gabsocial/reducers/status_lists.js b/app/javascript/gabsocial/reducers/status_lists.js
index d108a06b..48acc5f6 100644
--- a/app/javascript/gabsocial/reducers/status_lists.js
+++ b/app/javascript/gabsocial/reducers/status_lists.js
@@ -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);
diff --git a/app/javascript/gabsocial/reducers/user_lists.js b/app/javascript/gabsocial/reducers/user_lists.js
index 637ccf08..0684cb39 100644
--- a/app/javascript/gabsocial/reducers/user_lists.js
+++ b/app/javascript/gabsocial/reducers/user_lists.js
@@ -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(),
diff --git a/app/models/account.rb b/app/models/account.rb
index de95feee..93acde08 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -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
diff --git a/app/models/chat_conversation_account.rb b/app/models/chat_conversation_account.rb
index fd89dcf0..ddf9991e 100644
--- a/app/models/chat_conversation_account.rb
+++ b/app/models/chat_conversation_account.rb
@@ -22,7 +22,7 @@
class ChatConversationAccount < ApplicationRecord
include Paginable
- PER_ACCOUNT_APPROVED_LIMIT = 100
+ PER_ACCOUNT_APPROVED_LIMIT = 250
EXPIRATION_POLICY_MAP = {
none: nil,
diff --git a/app/models/concerns/account_associations.rb b/app/models/concerns/account_associations.rb
index 217b8d78..392ae35a 100644
--- a/app/models/concerns/account_associations.rb
+++ b/app/models/concerns/account_associations.rb
@@ -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
diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb
index 49ebcf07..9250648c 100644
--- a/app/models/concerns/account_interactions.rb
+++ b/app/models/concerns/account_interactions.rb
@@ -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)
diff --git a/app/models/status_bookmark_collection.rb b/app/models/status_bookmark_collection.rb
index 5d509fbf..d7f99140 100644
--- a/app/models/status_bookmark_collection.rb
+++ b/app/models/status_bookmark_collection.rb
@@ -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
diff --git a/app/models/user.rb b/app/models/user.rb
index a714f660..0bb4784f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index 2737268d..96d79091 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -6,7 +6,7 @@ class GroupPolicy < ApplicationPolicy
end
def create?
- admin? or current_account.is_pro
+ true
end
def update?
diff --git a/app/serializers/rest/status_bookmark_collection_serializer.rb b/app/serializers/rest/status_bookmark_collection_serializer.rb
new file mode 100644
index 00000000..678cd79a
--- /dev/null
+++ b/app/serializers/rest/status_bookmark_collection_serializer.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class REST::StatusBookmarkCollectionSerializer < ActiveModel::Serializer
+ attributes :id, :title
+
+ def id
+ object.id.to_s
+ end
+
+end
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index 7f4b9b3c..0bdddd05 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -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
diff --git a/app/services/app_sign_up_service.rb b/app/services/app_sign_up_service.rb
index ea02bc51..9526847a 100644
--- a/app/services/app_sign_up_service.rb
+++ b/app/services/app_sign_up_service.rb
@@ -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
diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb
index 11a7e6fa..1eaf4b2b 100644
--- a/app/services/backup_service.rb
+++ b/app/services/backup_service.rb
@@ -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
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index dcb5ccc6..0f94aaa3 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -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?)
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 702e1b7f..854f86a9 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -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
diff --git a/app/validators/follow_limit_validator.rb b/app/validators/follow_limit_validator.rb
index 1b0b7a35..2acc2b6a 100644
--- a/app/validators/follow_limit_validator.rb
+++ b/app/validators/follow_limit_validator.rb
@@ -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
diff --git a/config/locales/simple_form.ar.yml b/config/locales/simple_form.ar.yml
index f0d12113..0d1a411b 100644
--- a/config/locales/simple_form.ar.yml
+++ b/config/locales/simple_form.ar.yml
@@ -15,7 +15,7 @@ ar:
context: واحد أو أكثر من السياقات التي يجب أن ينطبق عليها عامل التصفية
digest: تُرسَل إليك بعد مُضيّ مدة مِن خمول نشاطك و فقط إذا ما تلقيت رسائل شخصية مباشِرة أثناء فترة غيابك مِن الشبكة
email: سوف تتلقى رسالة إلكترونية للتأكيد
- fields: يُمكنك عرض 4 عناصر على شكل جدول في ملفك الشخصي
+ fields: يُمكنك عرض 6 عناصر على شكل جدول في ملفك الشخصي
header: ملف PNG أو GIF أو JPG. حجمه على أقصى تصدير %{size}. سيتم تصغيره إلى %{dimensions}px
inbox_url: نسخ العنوان الذي تريد استخدامه مِن صفحة الإستقبال للمُرحَّل
irreversible: التبويقات التي تم تصفيتها ستختفي لا محالة حتى و إن تمت إزالة عامِل التصفية لاحقًا
diff --git a/config/locales/simple_form.ca.yml b/config/locales/simple_form.ca.yml
index 93beec12..3da87661 100644
--- a/config/locales/simple_form.ca.yml
+++ b/config/locales/simple_form.ca.yml
@@ -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
directori 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
diff --git a/config/locales/simple_form.co.yml b/config/locales/simple_form.co.yml
index bda03d74..28032a14 100644
--- a/config/locales/simple_form.co.yml
+++ b/config/locales/simple_form.co.yml
@@ -17,7 +17,7 @@ co:
digest: Solu mandatu dopu à una longa perioda d’inattività, è solu s’elli ci sò novi missaghji diretti
discoverable_html: L'
annuariu 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 cum’un tavulone nant’à u vostru prufile
+ fields: Pudete avè fin’à 6 elementi mustrati cum’un 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
diff --git a/config/locales/simple_form.cs.yml b/config/locales/simple_form.cs.yml
index 44c21399..76e5f6e7 100644
--- a/config/locales/simple_form.cs.yml
+++ b/config/locales/simple_form.cs.yml
@@ -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:
Adresář 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
diff --git a/config/locales/simple_form.cy.yml b/config/locales/simple_form.cy.yml
index 1e295139..343cba6b 100644
--- a/config/locales/simple_form.cy.yml
+++ b/config/locales/simple_form.cy.yml
@@ -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
diff --git a/config/locales/simple_form.da.yml b/config/locales/simple_form.da.yml
index c57b046b..d52c468c 100644
--- a/config/locales/simple_form.da.yml
+++ b/config/locales/simple_form.da.yml
@@ -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
diff --git a/config/locales/simple_form.de.yml b/config/locales/simple_form.de.yml
index da30e334..d6749c09 100644
--- a/config/locales/simple_form.de.yml
+++ b/config/locales/simple_form.de.yml
@@ -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
Verzeichnis 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
diff --git a/config/locales/simple_form.el.yml b/config/locales/simple_form.el.yml
index c6c13e0a..b219b468 100644
--- a/config/locales/simple_form.el.yml
+++ b/config/locales/simple_form.el.yml
@@ -17,7 +17,7 @@ el:
digest: Αποστέλλεται μόνο μετά από μακρά περίοδο αδράνειας και μόνο αν έχεις λάβει προσωπικά μηνύματα κατά την απουσία σου
discoverable_html: "Ο
κατάλογος \nσου επιτρέπει να βρεις λογαριασμούς βάσει ενδιαφερόντων και δραστηριότητας. Απαιτεί τουλάχιστον %{min_followers} ακόλουθους"
email: Θα σου σταλεί email επιβεβαίωσης
- fields: Μπορείς να έχεις έως 4 σημειώσεις σε μορφή πίνακα στο προφίλ σου
+ fields: Μπορείς να έχεις έως 6 σημειώσεις σε μορφή πίνακα στο προφίλ σου
header: PNG, GIF ή JPG. Έως %{size}. Θα περιοριστεί σε διάσταση %{dimensions}px
inbox_url: Αντέγραψε το URL της αρχικής σελίδας του ανταποκριτή (relay) που θέλεις να χρησιμοποιήσεις
irreversible: Τα φιλτραρισμένα τουτ θα εξαφανιστούν αμετάκλητα, ακόμα και αν το φίλτρο αργότερα αφαιρεθεί
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index 6d578231..1dfdc035 100644
--- a/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
@@ -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
directory 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
diff --git a/config/locales/simple_form.en_GB.yml b/config/locales/simple_form.en_GB.yml
index 61d8b339..5de700ee 100644
--- a/config/locales/simple_form.en_GB.yml
+++ b/config/locales/simple_form.en_GB.yml
@@ -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
directory 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
diff --git a/config/locales/simple_form.eo.yml b/config/locales/simple_form.eo.yml
index 37020baa..acb2a1b4 100644
--- a/config/locales/simple_form.eo.yml
+++ b/config/locales/simple_form.eo.yml
@@ -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
profilujo 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
diff --git a/config/locales/simple_form.es.yml b/config/locales/simple_form.es.yml
index a340aac6..354d3e51 100644
--- a/config/locales/simple_form.es.yml
+++ b/config/locales/simple_form.es.yml
@@ -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
diff --git a/config/locales/simple_form.eu.yml b/config/locales/simple_form.eu.yml
index 9211516d..b66b4fb7 100644
--- a/config/locales/simple_form.eu.yml
+++ b/config/locales/simple_form.eu.yml
@@ -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:
Direktorioak 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
diff --git a/config/locales/simple_form.fi.yml b/config/locales/simple_form.fi.yml
index 7909f53a..13d6e940 100644
--- a/config/locales/simple_form.fi.yml
+++ b/config/locales/simple_form.fi.yml
@@ -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
diff --git a/config/locales/simple_form.fr.yml b/config/locales/simple_form.fr.yml
index 68894dff..18581b67 100644
--- a/config/locales/simple_form.fr.yml
+++ b/config/locales/simple_form.fr.yml
@@ -17,7 +17,7 @@ fr:
digest: Uniquement envoyé après une longue période d’inactivité et uniquement si vous avez reçu des messages personnels pendant votre absence
discoverable_html: L'
annuaire 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 l’URL depuis la page d’accueil 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
diff --git a/config/locales/simple_form.gl.yml b/config/locales/simple_form.gl.yml
index c6c51abc..a4739ee5 100644
--- a/config/locales/simple_form.gl.yml
+++ b/config/locales/simple_form.gl.yml
@@ -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
directorio 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
diff --git a/config/locales/simple_form.it.yml b/config/locales/simple_form.it.yml
index 0032e49f..4f1fa0db 100644
--- a/config/locales/simple_form.it.yml
+++ b/config/locales/simple_form.it.yml
@@ -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
directory 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
diff --git a/config/locales/simple_form.ja.yml b/config/locales/simple_form.ja.yml
index 683b82c9..ed28fb84 100644
--- a/config/locales/simple_form.ja.yml
+++ b/config/locales/simple_form.ja.yml
@@ -17,7 +17,7 @@ ja:
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
discoverable_html:
ディレクトリ は興味や活動をもとにアカウントを見つけることを可能にします。 掲載には %{min_followers} 人以上のフォロワーが必要です
email: 確認のメールが送信されます
- fields: プロフィールに表として4つまでの項目を表示することができます
+ fields: プロフィールに表として6つまでの項目を表示することができます
header: "%{size}までのPNG、GIF、JPGが利用可能です。 %{dimensions}pxまで縮小されます"
inbox_url: 使用したいリレーサーバーのトップページからURLをコピーします
irreversible: フィルターが後で削除されても、除外されたトゥートは元に戻せなくなります
diff --git a/config/locales/simple_form.nl.yml b/config/locales/simple_form.nl.yml
index 98947dd0..5eca10a7 100644
--- a/config/locales/simple_form.nl.yml
+++ b/config/locales/simple_form.nl.yml
@@ -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
gebruikersgids 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
diff --git a/config/locales/simple_form.oc.yml b/config/locales/simple_form.oc.yml
index 9a484860..6effc713 100644
--- a/config/locales/simple_form.oc.yml
+++ b/config/locales/simple_form.oc.yml
@@ -17,7 +17,7 @@ oc:
digest: Solament enviat aprèp un long moment d’inactivitat e solament s’avètz recebut de messatges personals pendent vòstra abséncia
discoverable_html: L’
annuari 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 l’URL 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
diff --git a/config/locales/simple_form.pl.yml b/config/locales/simple_form.pl.yml
index e8104536..596986d5 100644
--- a/config/locales/simple_form.pl.yml
+++ b/config/locales/simple_form.pl.yml
@@ -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:
Katalog 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
diff --git a/config/locales/simple_form.pt-BR.yml b/config/locales/simple_form.pt-BR.yml
index 3bfa0d5f..61491a15 100644
--- a/config/locales/simple_form.pt-BR.yml
+++ b/config/locales/simple_form.pt-BR.yml
@@ -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
diretório 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
diff --git a/config/locales/simple_form.pt.yml b/config/locales/simple_form.pt.yml
index c144a97c..ff7cbb9c 100644
--- a/config/locales/simple_form.pt.yml
+++ b/config/locales/simple_form.pt.yml
@@ -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
directory 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
diff --git a/config/locales/simple_form.ro.yml b/config/locales/simple_form.ro.yml
index 757b8720..8836cab8 100644
--- a/config/locales/simple_form.ro.yml
+++ b/config/locales/simple_form.ro.yml
@@ -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:
Directorul 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
diff --git a/config/locales/simple_form.ru.yml b/config/locales/simple_form.ru.yml
index 4f180eeb..8d1bbb69 100644
--- a/config/locales/simple_form.ru.yml
+++ b/config/locales/simple_form.ru.yml
@@ -17,7 +17,7 @@ ru:
digest: Отсылается лишь после длительной неактивности, если вы в это время получали личные сообщения
discoverable_html:
Каталог позволяет пользователям искать людей по интересам и активности. Необходимо наличие не менее %{min_followers} подписчиков
email: Вам будет отправлено электронное письмо с подтверждением
- fields: В профиле можно отобразить до 4 пунктов как таблицу
+ fields: В профиле можно отобразить до 6 пунктов как таблицу
header: PNG, GIF или JPG. Максимально %{size}. Будет уменьшено до %{dimensions}px
inbox_url: Копировать URL с главной страницы ретранслятора, который вы хотите использовать
irreversible: Отфильтрованные статусы будут утеряны навсегда, даже если в будущем фильтр будет убран
diff --git a/config/locales/simple_form.sl.yml b/config/locales/simple_form.sl.yml
index 16263dbf..9215b22e 100644
--- a/config/locales/simple_form.sl.yml
+++ b/config/locales/simple_form.sl.yml
@@ -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
diff --git a/config/locales/simple_form.sq.yml b/config/locales/simple_form.sq.yml
index 6138d779..1a483c77 100644
--- a/config/locales/simple_form.sq.yml
+++ b/config/locales/simple_form.sq.yml
@@ -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:
Drejtoria u lejon njerëzve të gjejnë llogari bazuar në interesat dhe veprimtarinë. Lyp të paktën %{min_followers} ndjekës
email: Do t’ju 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ë
diff --git a/config/locales/simple_form.sr.yml b/config/locales/simple_form.sr.yml
index 7e3c6685..eaaf72c5 100644
--- a/config/locales/simple_form.sr.yml
+++ b/config/locales/simple_form.sr.yml
@@ -17,7 +17,7 @@ sr:
digest: Послато после дужег периода неактивности са прегледом свих битних ствари које сте добили док сте били одсутни
discoverable_html:
Директоријум омогућава људима да пронађу налоге засноване на интересима и активности. Захтева бар %{min_followers} пратиоца
email: Биће вам послата е-пошта са потврдом
- fields: Можете имати до 4 ставке приказане као табела на вашем профилу
+ fields: Можете имати до 6 ставке приказане као табела на вашем профилу
header: PNG, GIF или JPG. Највише %{size}. Биће смањена на %{dimensions}px
inbox_url: Копирајте URL са насловне стране релеја који желите користити
irreversible: Филтриранe трубе ће нестати неповратно, чак и ако је филтер касније уклоњен
diff --git a/config/locales/simple_form.sv.yml b/config/locales/simple_form.sv.yml
index f3818126..9d1a3f87 100644
--- a/config/locales/simple_form.sv.yml
+++ b/config/locales/simple_form.sv.yml
@@ -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
diff --git a/config/locales/simple_form.th.yml b/config/locales/simple_form.th.yml
index cd9a8770..51a49043 100644
--- a/config/locales/simple_form.th.yml
+++ b/config/locales/simple_form.th.yml
@@ -17,7 +17,7 @@ th:
digest: ส่งเฉพาะหลังจากไม่มีการใช้งานเป็นเวลานานและในกรณีที่คุณได้รับข้อความส่วนบุคคลใด ๆ เมื่อคุณไม่อยู่เท่านั้น
discoverable_html:
ไดเรกทอรี ช่วยให้ผู้คนค้นหาบัญชีตามความสนใจและกิจกรรม ต้องการอย่างน้อย %{min_followers} ผู้ติดตาม
email: คุณจะได้รับอีเมลยืนยัน
- fields: คุณสามารถมีได้มากถึง 4 รายการแสดงผลเป็นตารางในโปรไฟล์ของคุณ
+ fields: คุณสามารถมีได้มากถึง 6 รายการแสดงผลเป็นตารางในโปรไฟล์ของคุณ
header: PNG, GIF หรือ JPG สูงสุด %{size} จะถูกย่อขนาดเป็น %{dimensions}px
inbox_url: คัดลอก URL จากหน้าแรกของรีเลย์ที่คุณต้องการใช้
irreversible: โพสต์ที่กรองจะหายไปอย่างถาวร แม้ว่าจะเอาตัวกรองออกในภายหลัง
diff --git a/config/locales/simple_form.zh-CN.yml b/config/locales/simple_form.zh-CN.yml
index d0678b4c..91fbbd85 100644
--- a/config/locales/simple_form.zh-CN.yml
+++ b/config/locales/simple_form.zh-CN.yml
@@ -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: 你需要手动审核所有关注请求
diff --git a/config/locales/simple_form.zh-HK.yml b/config/locales/simple_form.zh-HK.yml
index aae94e58..2c6dd603 100644
--- a/config/locales/simple_form.zh-HK.yml
+++ b/config/locales/simple_form.zh-HK.yml
@@ -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: 你必須人手核准每個用戶對你的關注請求,而你的文章私隱會被預設為「只有關注你的人能看」
diff --git a/config/routes.rb b/config/routes.rb
index e045cbd8..d2a07d56 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -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'
diff --git a/db/migrate/20201217003945_add_missing_foreign_keys.rb b/db/migrate/20201217003945_add_missing_foreign_keys.rb
new file mode 100644
index 00000000..8be7971b
--- /dev/null
+++ b/db/migrate/20201217003945_add_missing_foreign_keys.rb
@@ -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
\ No newline at end of file
diff --git a/db/schema.rb b/db/schema.rb
index 5ba6db65..c3e3448e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -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