Commit db037e78 authored by khws4v1's avatar khws4v1

Merge tag 'v3.3.0' into ef67.myhome.cx

parents e429c291 633d1751
This diff is collapsed.
......@@ -3,7 +3,7 @@ Changelog
All notable changes to this project will be documented in this file.
## Unreleased
## [3.3.0] - 2020-12-27
### Added
- **Add hotkeys for audio/video control in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/15158), [Gargron](https://github.com/tootsuite/mastodon/pull/15198))
......@@ -81,11 +81,11 @@ All notable changes to this project will be documented in this file.
### Changed
- **Change media modals look in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/15217), [Gargron](https://github.com/tootsuite/mastodon/pull/15221), [Gargron](https://github.com/tootsuite/mastodon/pull/15284), [Gargron](https://github.com/tootsuite/mastodon/pull/15283), [Kjwon15](https://github.com/tootsuite/mastodon/pull/15308), [noellabo](https://github.com/tootsuite/mastodon/pull/15305))
- **Change media modals look in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/15217), [Gargron](https://github.com/tootsuite/mastodon/pull/15221), [Gargron](https://github.com/tootsuite/mastodon/pull/15284), [Gargron](https://github.com/tootsuite/mastodon/pull/15283), [Kjwon15](https://github.com/tootsuite/mastodon/pull/15308), [noellabo](https://github.com/tootsuite/mastodon/pull/15305), [ThibG](https://github.com/tootsuite/mastodon/pull/15417))
- Background of the overlay matches the color of the image
- Action bar to interact with or open the toot from the modal
- Change order of announcements in admin UI to be newest-first ([ThibG](https://github.com/tootsuite/mastodon/pull/15091))
- **Change account suspensions to be reversible by default** ([Gargron](https://github.com/tootsuite/mastodon/pull/14726), [ThibG](https://github.com/tootsuite/mastodon/pull/15152), [ThibG](https://github.com/tootsuite/mastodon/pull/15106), [ThibG](https://github.com/tootsuite/mastodon/pull/15100), [ThibG](https://github.com/tootsuite/mastodon/pull/15099), [noellabo](https://github.com/tootsuite/mastodon/pull/14855), [ThibG](https://github.com/tootsuite/mastodon/pull/15380))
- **Change account suspensions to be reversible by default** ([Gargron](https://github.com/tootsuite/mastodon/pull/14726), [ThibG](https://github.com/tootsuite/mastodon/pull/15152), [ThibG](https://github.com/tootsuite/mastodon/pull/15106), [ThibG](https://github.com/tootsuite/mastodon/pull/15100), [ThibG](https://github.com/tootsuite/mastodon/pull/15099), [noellabo](https://github.com/tootsuite/mastodon/pull/14855), [ThibG](https://github.com/tootsuite/mastodon/pull/15380), [Gargron](https://github.com/tootsuite/mastodon/pull/15420), [Gargron](https://github.com/tootsuite/mastodon/pull/15414))
- Suspensions no longer equal deletions
- A suspended account can be unsuspended with minimal consequences for 30 days
- Immediate deletion of data is still available as an explicit option
......@@ -123,7 +123,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Fix layout on about page when contact account has a long username ([ThibG](https://github.com/tootsuite/mastodon/pull/15357))
- Fix follow limit preventing re-following of a moved account ([Gargron](https://github.com/tootsuite/mastodon/pull/14207))
- Fix follow limit preventing re-following of a moved account ([Gargron](https://github.com/tootsuite/mastodon/pull/14207), [ThibG](https://github.com/tootsuite/mastodon/pull/15384))
- **Fix deletes not reaching every server that interacted with toot** ([Gargron](https://github.com/tootsuite/mastodon/pull/15200))
- Previously, delete of a toot would be primarily sent to the followers of its author, people mentioned in the toot, and people who reblogged the toot
- Now, additionally, it is ensured that it is sent to people who replied to it, favourited it, and to the person it replies to even if that person is not mentioned
......@@ -163,7 +163,7 @@ All notable changes to this project will be documented in this file.
- Fix inefficiency when fetching bookmarks ([akihikodaki](https://github.com/tootsuite/mastodon/pull/14674))
- Fix inefficiency when fetching favourites ([akihikodaki](https://github.com/tootsuite/mastodon/pull/14673))
- Fix inefficiency when fetching media-only account timeline ([akihikodaki](https://github.com/tootsuite/mastodon/pull/14675))
- Fix inefficieny when deleting accounts ([Gargron](https://github.com/tootsuite/mastodon/pull/15387), [ThibG](https://github.com/tootsuite/mastodon/pull/15409), [ThibG](https://github.com/tootsuite/mastodon/pull/15407), [ThibG](https://github.com/tootsuite/mastodon/pull/15408), [ThibG](https://github.com/tootsuite/mastodon/pull/15402))
- Fix inefficieny when deleting accounts ([Gargron](https://github.com/tootsuite/mastodon/pull/15387), [ThibG](https://github.com/tootsuite/mastodon/pull/15409), [ThibG](https://github.com/tootsuite/mastodon/pull/15407), [ThibG](https://github.com/tootsuite/mastodon/pull/15408), [ThibG](https://github.com/tootsuite/mastodon/pull/15402), [ThibG](https://github.com/tootsuite/mastodon/pull/15416), [Gargron](https://github.com/tootsuite/mastodon/pull/15421))
- Fix redundant query when processing batch actions on custom emojis ([niwatori24](https://github.com/tootsuite/mastodon/pull/14534))
- Fix slow distinct queries where grouped queries are faster ([Gargron](https://github.com/tootsuite/mastodon/pull/15287))
- Fix performance on instances list in admin UI ([Gargron](https://github.com/tootsuite/mastodon/pull/15282))
......@@ -387,14 +387,14 @@ All notable changes to this project will be documented in this file.
- Only then proceed to start removing their data (slow)
- Clear out media attachments in a separate worker (slow)
## [v3.1.5] - 2020-07-07
## [3.1.5] - 2020-07-07
### Security
- Fix media attachment enumeration ([ThibG](https://github.com/tootsuite/mastodon/pull/14254))
- Change rate limits for various paths ([Gargron](https://github.com/tootsuite/mastodon/pull/14253))
- Fix other sessions not being logged out on password change ([Gargron](https://github.com/tootsuite/mastodon/pull/14252))
## [v3.1.4] - 2020-05-14
## [3.1.4] - 2020-05-14
### Added
- Add `vi` to available locales ([taicv](https://github.com/tootsuite/mastodon/pull/13542))
......@@ -461,7 +461,7 @@ All notable changes to this project will be documented in this file.
- For apps that self-register on behalf of every individual user (such as most mobile apps), this is a non-issue
- The issue only affects developers of apps who are shared between multiple users, such as server-side apps like cross-posters
## [v3.1.3] - 2020-04-05
## [3.1.3] - 2020-04-05
### Added
- Add ability to filter audit log in admin UI ([Gargron](https://github.com/tootsuite/mastodon/pull/13381))
......
......@@ -7,7 +7,7 @@ class Api::V1::Accounts::FeaturedTagsController < Api::BaseController
respond_to :json
def index
render json: @featured_tags, each_serializer: REST::AccountFeaturedTagSerializer
render json: @featured_tags, each_serializer: REST::FeaturedTagSerializer
end
private
......
......@@ -4,13 +4,6 @@ exports[`<Button /> adds class "button-secondary" if props.secondary given 1`] =
<button
className="button button-secondary"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
/>
`;
......@@ -18,13 +11,6 @@ exports[`<Button /> renders a button element 1`] = `
<button
className="button"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
/>
`;
......@@ -33,13 +19,6 @@ exports[`<Button /> renders a disabled attribute if props.disabled given 1`] = `
className="button"
disabled={true}
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
/>
`;
......@@ -47,13 +26,6 @@ exports[`<Button /> renders class="button--block" if props.block given 1`] = `
<button
className="button button--block"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
/>
`;
......@@ -61,13 +33,6 @@ exports[`<Button /> renders the children 1`] = `
<button
className="button"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
>
<p>
children
......@@ -79,13 +44,6 @@ exports[`<Button /> renders the given text 1`] = `
<button
className="button"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
>
foo
</button>
......@@ -95,13 +53,6 @@ exports[`<Button /> renders the props.text instead of children 1`] = `
<button
className="button"
onClick={[Function]}
style={
Object {
"height": "36px",
"lineHeight": "36px",
"padding": "0 16px",
}
}
>
foo
</button>
......
......@@ -10,17 +10,11 @@ export default class Button extends React.PureComponent {
disabled: PropTypes.bool,
block: PropTypes.bool,
secondary: PropTypes.bool,
size: PropTypes.number,
className: PropTypes.string,
title: PropTypes.string,
style: PropTypes.object,
children: PropTypes.node,
};
static defaultProps = {
size: 36,
};
handleClick = (e) => {
if (!this.props.disabled) {
this.props.onClick(e);
......@@ -36,13 +30,6 @@ export default class Button extends React.PureComponent {
}
render () {
const style = {
padding: `0 ${this.props.size / 2.25}px`,
height: `${this.props.size}px`,
lineHeight: `${this.props.size}px`,
...this.props.style,
};
const className = classNames('button', this.props.className, {
'button-secondary': this.props.secondary,
'button--block': this.props.block,
......@@ -54,7 +41,6 @@ export default class Button extends React.PureComponent {
disabled={this.props.disabled}
onClick={this.handleClick}
ref={this.setRef}
style={style}
title={this.props.title}
>
{this.props.text || this.props.children}
......
......@@ -164,13 +164,17 @@ class Header extends ImmutablePureComponent {
info.push(<span key='domain_blocked' className='relationship-tag'><FormattedMessage id='account.domain_blocked' defaultMessage='Domain blocked' /></span>);
}
if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) {
bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />;
}
if (me !== account.get('id')) {
if (!account.get('relationship')) { // Wait until the relationship is loaded
actionBtn = '';
} else if (account.getIn(['relationship', 'requested'])) {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />;
actionBtn = <Button className={classNames('logo-button', { 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />;
} else if (!account.getIn(['relationship', 'blocking'])) {
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />;
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']), 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />;
} else if (account.getIn(['relationship', 'blocking'])) {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.props.onBlock} />;
}
......@@ -178,10 +182,6 @@ class Header extends ImmutablePureComponent {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.edit_profile)} onClick={this.openEditProfile} />;
}
if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) {
bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />;
}
if (account.get('moved') && !account.getIn(['relationship', 'following'])) {
actionBtn = '';
}
......
This diff is collapsed.
......@@ -38,7 +38,7 @@
"account.requested": "അനുവാദത്തിനായി കാത്തിരിക്കുന്നു. പിന്തുടരാനുള്ള അപേക്ഷ റദ്ദാക്കുവാൻ ഞെക്കുക",
"account.share": "@{name} ന്റെ പ്രൊഫൈൽ പങ്കുവെക്കുക",
"account.show_reblogs": "@{name} ൽ നിന്നുള്ള ബൂസ്റ്റുകൾ കാണിക്കുക",
"account.statuses_counter": "{count, plural, one {{counter} Toot} other {{counter} Toots}}",
"account.statuses_counter": "{count, plural, one {{counter} ടൂട്ട്} other {{counter} ടൂട്ടുകൾ}}",
"account.unblock": "ബ്ലോക്ക് മാറ്റുക @{name}",
"account.unblock_domain": "{domain} വെളിപ്പെടുത്തുക",
"account.unendorse": "പ്രൊഫൈലിൽ പ്രകടമാക്കാതിരിക്കുക",
......@@ -250,8 +250,8 @@
"keyboard_shortcuts.spoilers": "to show/hide CW field",
"keyboard_shortcuts.start": "to open \"get started\" column",
"keyboard_shortcuts.toggle_hidden": "to show/hide text behind CW",
"keyboard_shortcuts.toggle_sensitivity": "to show/hide media",
"keyboard_shortcuts.toot": "to start a brand new toot",
"keyboard_shortcuts.toggle_sensitivity": "മീഡിയ കാണിക്കുന്നതിനും/മറയ്ക്കുന്നതിനും",
"keyboard_shortcuts.toot": "ഒരു പുതിയ ടൂട്ട് ആരംഭിക്കാൻ",
"keyboard_shortcuts.unfocus": "to un-focus compose textarea/search",
"keyboard_shortcuts.up": "to move up in the list",
"lightbox.close": "അടയ്ക്കുക",
......@@ -269,7 +269,7 @@
"lists.replies_policy.followed": "Any followed user",
"lists.replies_policy.list": "Members of the list",
"lists.replies_policy.none": "ആരുമില്ല",
"lists.replies_policy.title": "Show replies to:",
"lists.replies_policy.title": "ഇതിനുള്ള മറുപടികൾ കാണിക്കുക:",
"lists.search": "Search among people you follow",
"lists.subheading": "എന്റെ പട്ടികകൾ",
"load_pending": "{count, plural, one {# new item} other {# new items}}",
......@@ -305,14 +305,14 @@
"navigation_bar.security": "സുരക്ഷ",
"notification.favourite": "{name} favourited your status",
"notification.follow": "{name} നിങ്ങളെ പിന്തുടർന്നു",
"notification.follow_request": "{name} has requested to follow you",
"notification.follow_request": "{name} നിങ്ങളെ പിന്തുടരാൻ അഭ്യർത്ഥിച്ചു",
"notification.mention": "{name} mentioned you",
"notification.own_poll": "നിങ്ങളുടെ പോൾ അവസാനിച്ചു",
"notification.poll": "A poll you have voted in has ended",
"notification.reblog": "{name} നിങ്ങളുടെ പോസ്റ്റ് ബൂസ്റ്റ് ചെയ്തു",
"notification.status": "{name} ഇപ്പോൾ പോസ്റ്റുചെയ്‌തു",
"notifications.clear": "അറിയിപ്പ് മായ്ക്കുക",
"notifications.clear_confirmation": "Are you sure you want to permanently clear all your notifications?",
"notifications.clear_confirmation": "നിങ്ങളുടെ എല്ലാ അറിയിപ്പുകളും ശാശ്വതമായി മായ്‌ക്കണമെന്ന് നിങ്ങൾക്ക് ഉറപ്പാണോ?",
"notifications.column_settings.alert": "ഡെസ്ക്ടോപ്പ് അറിയിപ്പുകൾ",
"notifications.column_settings.favourite": "പ്രിയപ്പെട്ടവ:",
"notifications.column_settings.filter_bar.advanced": "എല്ലാ വിഭാഗങ്ങളും പ്രദർശിപ്പിക്കുക",
......@@ -349,14 +349,14 @@
"poll.total_people": "{count, plural, one {# person} other {# people}}",
"poll.total_votes": "{count, plural, one {# vote} other {# votes}}",
"poll.vote": "വോട്ട് ചെയ്യുക",
"poll.voted": "You voted for this answer",
"poll.voted": "ഈ ഉത്തരത്തിനായി നിങ്ങൾ വോട്ട് ചെയ്തു",
"poll_button.add_poll": "ഒരു പോൾ ചേർക്കുക",
"poll_button.remove_poll": "പോൾ നീക്കംചെയ്യുക",
"privacy.change": "Adjust status privacy",
"privacy.change": "ടൂട്ട് സ്വകാര്യത ക്രമീകരിക്കുക",
"privacy.direct.long": "Post to mentioned users only",
"privacy.direct.short": "നേരിട്ട്",
"privacy.private.long": "Post to followers only",
"privacy.private.short": "Followers-only",
"privacy.private.short": "പിന്തുടരുന്നവർക്ക് മാത്രം",
"privacy.public.long": "Post to public timelines",
"privacy.public.short": "Public",
"privacy.unlisted.long": "Do not show in public timelines",
......@@ -372,7 +372,7 @@
"relative_time.today": "ഇന്ന്",
"reply_indicator.cancel": "റദ്ദാക്കുക",
"report.forward": "Forward to {target}",
"report.forward_hint": "The account is from another server. Send an anonymized copy of the report there as well?",
"report.forward_hint": "ഈ അക്കൗണ്ട് മറ്റൊരു സെർവറിൽ നിന്നാണ്. റിപ്പോർട്ടിന്റെ അജ്ഞാത പകർപ്പ് അവിടെ അയയ്ക്കണോ?",
"report.hint": "The report will be sent to your server moderators. You can provide an explanation of why you are reporting this account below:",
"report.placeholder": "കൂടുതൽ അഭിപ്രായങ്ങൾ",
"report.submit": "സമർപ്പിക്കുക",
......@@ -420,14 +420,14 @@
"status.remove_bookmark": "ബുക്ക്മാർക്ക് നീക്കംചെയ്യുക",
"status.reply": "മറുപടി",
"status.replyAll": "Reply to thread",
"status.report": "Report @{name}",
"status.report": "@{name}--നെ റിപ്പോർട്ട് ചെയ്യുക",
"status.sensitive_warning": "Sensitive content",
"status.share": "പങ്കിടുക",
"status.show_less": "കുറച്ച് കാണിക്കുക",
"status.show_less_all": "Show less for all",
"status.show_more": "കൂടുതകൽ കാണിക്കുക",
"status.show_more_all": "എല്ലാവർക്കുമായി കൂടുതൽ കാണിക്കുക",
"status.show_thread": "Show thread",
"status.show_thread": "ത്രെഡ് കാണിക്കുക",
"status.uncached_media_warning": "ലഭ്യമല്ല",
"status.unmute_conversation": "Unmute conversation",
"status.unpin": "Unpin from profile",
......@@ -463,24 +463,24 @@
"upload_form.thumbnail": "ലഘുചിത്രം മാറ്റുക",
"upload_form.undo": "ഇല്ലാതാക്കുക",
"upload_form.video_description": "Describe for people with hearing loss or visual impairment",
"upload_modal.analyzing_picture": "Analyzing picture…",
"upload_modal.analyzing_picture": "ചിത്രം വിശകലനം ചെയ്യുന്നു…",
"upload_modal.apply": "പ്രയോഗിക്കുക",
"upload_modal.choose_image": "ചിത്രം തിരഞ്ഞെടുക്കുക",
"upload_modal.description_placeholder": "A quick brown fox jumps over the lazy dog",
"upload_modal.detect_text": "Detect text from picture",
"upload_modal.edit_media": "മീഡിയ തിരുത്തുക",
"upload_modal.hint": "Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.",
"upload_modal.preparing_ocr": "Preparing OCR…",
"upload_modal.preparing_ocr": "OCR തയ്യാറാക്കുന്നു…",
"upload_modal.preview_label": "Preview ({ratio})",
"upload_progress.label": "Uploading…",
"video.close": "വീഡിയോ അടയ്ക്കുക",
"video.download": "ഫയൽ ഡൌൺലോഡ് ചെയ്യുക",
"video.exit_fullscreen": "Exit full screen",
"video.exit_fullscreen": "പൂർണ്ണ സ്ക്രീനിൽ നിന്ന് പുറത്തുകടക്കുക",
"video.expand": "Expand video",
"video.fullscreen": "പൂർണ്ണ സ്ക്രീൻ",
"video.hide": "വീഡിയോ മറയ്ക്കുക",
"video.mute": "Mute sound",
"video.pause": "Pause",
"video.play": "Play",
"video.play": "പ്ലേ",
"video.unmute": "Unmute sound"
}
{
"account.account_note_header": "Viết nhận xét",
"account.account_note_header": "Ghi chú",
"account.add_or_remove_from_list": "Thêm hoặc Xóa khỏi danh sách",
"account.badges.bot": "Bot",
"account.badges.group": "Nhóm",
......@@ -425,10 +425,10 @@
"status.share": "Chia sẻ",
"status.show_less": "Thu gọn",
"status.show_less_all": "Thu gọn toàn bộ",
"status.show_more": "Mở rộng",
"status.show_more": "Xem thêm",
"status.show_more_all": "Hiển thị tất cả",
"status.show_thread": "Liên quan",
"status.uncached_media_warning": "Giới hạn",
"status.show_thread": "Toàn bộ chủ đề",
"status.uncached_media_warning": "Uncached",
"status.unmute_conversation": "Quan tâm",
"status.unpin": "Bỏ ghim trên trang cá nhân",
"suggestions.dismiss": "Tắt đề xuất",
......
......@@ -154,6 +154,11 @@
display: block;
width: 100%;
}
.layout-multiple-columns &.button--with-bell {
font-size: 12px;
padding: 0 8px;
}
}
.column__wrapper {
......@@ -7194,21 +7199,6 @@ noscript {
.audio-player {
border-radius: 0;
}
@media screen and (max-width: 415px) {
width: 210px;
bottom: 10px;
right: 10px;
&__footer {
display: none;
}
.video-player,
.audio-player {
border-radius: 0 0 4px 4px;
}
}
}
.picture-in-picture-placeholder {
......
......@@ -444,6 +444,11 @@
}
}
.logo-button {
line-height: 36px;
padding: 3px 15px;
}
&__image {
border-radius: 4px 4px 0 0;
overflow: hidden;
......
......@@ -170,6 +170,11 @@ body.rtl {
right: 42px;
}
.account__header__tabs__buttons > .icon-button {
margin-right: 0;
margin-left: 8px;
}
.account__avatar-overlay-overlay {
right: auto;
left: 0;
......
......@@ -83,9 +83,14 @@
background: $ui-highlight-color;
color: $primary-text-color;
text-transform: none;
line-height: 36px;
line-height: 16px;
height: auto;
padding: 3px 15px;
min-height: 36px;
min-width: 88px;
white-space: normal;
overflow-wrap: break-word;
hyphens: auto;
padding: 0 15px;
border: 0;
svg {
......
......@@ -97,8 +97,8 @@ module AccountInteractions
has_many :announcement_mutes, dependent: :destroy
end
def follow!(other_account, reblogs: nil, notify: nil, uri: nil, rate_limit: false)
rel = active_relationships.create_with(show_reblogs: reblogs.nil? ? true : reblogs, notify: notify.nil? ? false : notify, uri: uri, rate_limit: rate_limit)
def follow!(other_account, reblogs: nil, notify: nil, uri: nil, rate_limit: false, bypass_limit: false)
rel = active_relationships.create_with(show_reblogs: reblogs.nil? ? true : reblogs, notify: notify.nil? ? false : notify, uri: uri, rate_limit: rate_limit, bypass_follow_limit: bypass_limit)
.find_or_create_by!(target_account: other_account)
rel.show_reblogs = reblogs unless reblogs.nil?
......@@ -111,8 +111,8 @@ module AccountInteractions
rel
end
def request_follow!(other_account, reblogs: nil, notify: nil, uri: nil, rate_limit: false)
rel = follow_requests.create_with(show_reblogs: reblogs.nil? ? true : reblogs, notify: notify.nil? ? false : notify, uri: uri, rate_limit: rate_limit)
def request_follow!(other_account, reblogs: nil, notify: nil, uri: nil, rate_limit: false, bypass_limit: false)
rel = follow_requests.create_with(show_reblogs: reblogs.nil? ? true : reblogs, notify: notify.nil? ? false : notify, uri: uri, rate_limit: rate_limit, bypass_follow_limit: bypass_limit)
.find_or_create_by!(target_account: other_account)
rel.show_reblogs = reblogs unless reblogs.nil?
......
# frozen_string_literal: true
module FollowLimitable
extend ActiveSupport::Concern
included do
validates_with FollowLimitValidator, on: :create, unless: :bypass_follow_limit?
end
def bypass_follow_limit=(value)
@bypass_follow_limit = value
end
def bypass_follow_limit?
@bypass_follow_limit
end
end
......@@ -17,6 +17,7 @@ class Follow < ApplicationRecord
include Paginable
include RelationshipCacheable
include RateLimitable
include FollowLimitable
rate_limit by: :account, family: :follows
......@@ -26,7 +27,6 @@ class Follow < ApplicationRecord
has_one :notification, as: :activity, dependent: :destroy
validates :account_id, uniqueness: { scope: :target_account_id }
validates_with FollowLimitValidator, on: :create, if: :rate_limit?
scope :recent, -> { reorder(id: :desc) }
......
......@@ -17,6 +17,7 @@ class FollowRequest < ApplicationRecord
include Paginable
include RelationshipCacheable
include RateLimitable
include FollowLimitable
rate_limit by: :account, family: :follows
......@@ -26,7 +27,6 @@ class FollowRequest < ApplicationRecord
has_one :notification, as: :activity, dependent: :destroy
validates :account_id, uniqueness: { scope: :target_account_id }
validates_with FollowLimitValidator, on: :create, if: :rate_limit?
def authorize!
account.follow!(target_account, reblogs: show_reblogs, notify: notify, uri: uri)
......
# frozen_string_literal: true
class REST::AccountFeaturedTagSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :id, :name, :url
def id
object.tag.id.to_s
end
def url
short_account_tag_url(object.account, object.tag)
end
end
# frozen_string_literal: true
class REST::FeaturedTagSerializer < ActiveModel::Serializer
attributes :id, :name, :statuses_count, :last_status_at
include RoutingHelper
attributes :id, :name, :url, :statuses_count, :last_status_at
def id
object.id.to_s
end
def url
short_account_tag_url(object.account, object.tag)
end
end
......@@ -31,7 +31,7 @@ class BatchedRemoveStatusService < BaseService
# Since we skipped all callbacks, we also need to manually
# deindex the statuses
Chewy.strategy.current.update(StatusesIndex, statuses_and_reblogs) if Chewy.enabled?
Chewy.strategy.current.update(StatusesIndex::Status, statuses_and_reblogs) if Chewy.enabled?
return if options[:skip_side_effects]
......
......@@ -142,6 +142,7 @@ class DeleteAccountService < BaseService