Merge remote-tracking branch 'parent/main' into upstream-20240705
This commit is contained in:
commit
9a07550fa6
75 changed files with 1046 additions and 543 deletions
|
@ -6,6 +6,7 @@ class Api::V1::ScheduledStatusesController < Api::BaseController
|
|||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, except: [:update, :destroy]
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:update, :destroy]
|
||||
|
||||
before_action :require_user!
|
||||
before_action :set_statuses, only: :index
|
||||
before_action :set_status, except: :index
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class Api::V1::Statuses::TranslationsController < Api::V1::Statuses::BaseController
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }
|
||||
before_action :require_user!
|
||||
before_action :set_translation
|
||||
|
||||
rescue_from TranslationService::NotConfiguredError, with: :not_found
|
||||
|
|
|
@ -3,8 +3,14 @@
|
|||
class Api::V1::Timelines::BaseController < Api::BaseController
|
||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||
|
||||
before_action :require_user!, if: :require_auth?
|
||||
|
||||
private
|
||||
|
||||
def require_auth?
|
||||
!Setting.timeline_preview
|
||||
end
|
||||
|
||||
def pagination_collection
|
||||
@statuses
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Timelines::LinkController < Api::V1::Timelines::BaseController
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, only: :show, if: :require_auth?
|
||||
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
||||
before_action :set_preview_card
|
||||
before_action :set_statuses
|
||||
|
||||
|
@ -17,10 +17,6 @@ class Api::V1::Timelines::LinkController < Api::V1::Timelines::BaseController
|
|||
|
||||
private
|
||||
|
||||
def require_auth?
|
||||
!Setting.timeline_preview
|
||||
end
|
||||
|
||||
def set_preview_card
|
||||
@preview_card = PreviewCard.joins(:trend).merge(PreviewCardTrend.allowed).find_by!(url: params[:url])
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Timelines::PublicController < Api::V1::Timelines::BaseController
|
||||
before_action :require_user!, only: [:show], if: :require_auth?
|
||||
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
||||
|
||||
PERMITTED_PARAMS = %i(local remote limit only_media).freeze
|
||||
|
||||
|
@ -15,10 +15,6 @@ class Api::V1::Timelines::PublicController < Api::V1::Timelines::BaseController
|
|||
|
||||
private
|
||||
|
||||
def require_auth?
|
||||
!Setting.timeline_preview
|
||||
end
|
||||
|
||||
def load_statuses
|
||||
preloaded_public_statuses_page
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Timelines::TagController < Api::V1::Timelines::BaseController
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:statuses' }, only: :show, if: :require_auth?
|
||||
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
||||
before_action :load_tag
|
||||
|
||||
PERMITTED_PARAMS = %i(local limit only_media).freeze
|
||||
|
|
|
@ -17,6 +17,7 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
|
|||
|
||||
def destroy
|
||||
Web::PushSubscription.unsubscribe_for(params[:id], current_resource_owner)
|
||||
Doorkeeper::Application.find_by(id: params[:id])&.close_streaming_sessions(current_resource_owner)
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -2,19 +2,34 @@ import { useRef, useCallback, useEffect } from 'react';
|
|||
|
||||
export const useTimeout = () => {
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout>>();
|
||||
const callbackRef = useRef<() => void>();
|
||||
|
||||
const set = useCallback((callback: () => void, delay: number) => {
|
||||
if (timeoutRef.current) {
|
||||
clearTimeout(timeoutRef.current);
|
||||
}
|
||||
|
||||
callbackRef.current = callback;
|
||||
timeoutRef.current = setTimeout(callback, delay);
|
||||
}, []);
|
||||
|
||||
const delay = useCallback((delay: number) => {
|
||||
if (timeoutRef.current) {
|
||||
clearTimeout(timeoutRef.current);
|
||||
}
|
||||
|
||||
if (!callbackRef.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
timeoutRef.current = setTimeout(callbackRef.current, delay);
|
||||
}, []);
|
||||
|
||||
const cancel = useCallback(() => {
|
||||
if (timeoutRef.current) {
|
||||
clearTimeout(timeoutRef.current);
|
||||
timeoutRef.current = undefined;
|
||||
callbackRef.current = undefined;
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
@ -25,5 +40,5 @@ export const useTimeout = () => {
|
|||
[cancel],
|
||||
);
|
||||
|
||||
return [set, cancel] as const;
|
||||
return [set, cancel, delay] as const;
|
||||
};
|
||||
|
|
|
@ -159,6 +159,7 @@ export const expandAccountFeaturedTimeline = (accountId, { tagged } = {}) => exp
|
|||
export const expandAccountMediaTimeline = (accountId, { maxId } = {}) => expandTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { max_id: maxId, only_media: true, limit: 40 });
|
||||
export const expandListTimeline = (id, { maxId } = {}, done = noOp) => expandTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`, { max_id: maxId }, done);
|
||||
export const expandAntennaTimeline = (id, { maxId } = {}, done = noOp) => expandTimeline(`antenna:${id}`, `/api/v1/timelines/antenna/${id}`, { max_id: maxId }, done);
|
||||
export const expandLinkTimeline = (url, { maxId } = {}, done = noOp) => expandTimeline(`link:${url}`, `/api/v1/timelines/link`, { url, max_id: maxId }, done);
|
||||
export const expandHashtagTimeline = (hashtag, { maxId, tags, local } = {}, done = noOp) => {
|
||||
return expandTimeline(`hashtag:${hashtag}${local ? ':local' : ''}`, `/api/v1/timelines/tag/${hashtag}`, {
|
||||
max_id: maxId,
|
||||
|
|
|
@ -50,6 +50,7 @@ export interface ApiPreviewCardJSON {
|
|||
type: string;
|
||||
author_name: string;
|
||||
author_url: string;
|
||||
author_account?: ApiAccountJSON;
|
||||
provider_name: string;
|
||||
provider_url: string;
|
||||
html: string;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useCallback, useEffect } from 'react';
|
||||
|
||||
import { useIntl, defineMessages } from 'react-intl';
|
||||
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
|
||||
|
||||
import { useIdentity } from '@/mastodon/identity_context';
|
||||
import {
|
||||
|
@ -19,15 +19,11 @@ const messages = defineMessages({
|
|||
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
||||
followBack: { id: 'account.follow_back', defaultMessage: 'Follow back' },
|
||||
mutual: { id: 'account.mutual', defaultMessage: 'Mutual' },
|
||||
cancel_follow_request: {
|
||||
id: 'account.cancel_follow_request',
|
||||
defaultMessage: 'Withdraw follow request',
|
||||
},
|
||||
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
|
||||
});
|
||||
|
||||
export const FollowButton: React.FC<{
|
||||
accountId: string;
|
||||
accountId?: string;
|
||||
}> = ({ accountId }) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
|
@ -36,7 +32,7 @@ export const FollowButton: React.FC<{
|
|||
accountId ? state.accounts.get(accountId) : undefined,
|
||||
);
|
||||
const relationship = useAppSelector((state) =>
|
||||
state.relationships.get(accountId),
|
||||
accountId ? state.relationships.get(accountId) : undefined,
|
||||
);
|
||||
const following = relationship?.following || relationship?.requested;
|
||||
|
||||
|
@ -65,11 +61,28 @@ export const FollowButton: React.FC<{
|
|||
if (accountId === me) {
|
||||
return;
|
||||
} else if (relationship.following || relationship.requested) {
|
||||
dispatch(unfollowAccount(accountId));
|
||||
dispatch(
|
||||
openModal({
|
||||
modalType: 'CONFIRM',
|
||||
modalProps: {
|
||||
message: (
|
||||
<FormattedMessage
|
||||
id='confirmations.unfollow.message'
|
||||
defaultMessage='Are you sure you want to unfollow {name}?'
|
||||
values={{ name: <strong>@{account?.acct}</strong> }}
|
||||
/>
|
||||
),
|
||||
confirm: intl.formatMessage(messages.unfollow),
|
||||
onConfirm: () => {
|
||||
dispatch(unfollowAccount(accountId));
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
dispatch(followAccount(accountId));
|
||||
}
|
||||
}, [dispatch, accountId, relationship, account, signedIn]);
|
||||
}, [dispatch, intl, accountId, relationship, account, signedIn]);
|
||||
|
||||
let label;
|
||||
|
||||
|
@ -79,8 +92,6 @@ export const FollowButton: React.FC<{
|
|||
label = intl.formatMessage(messages.edit_profile);
|
||||
} else if (!relationship) {
|
||||
label = <LoadingIndicator />;
|
||||
} else if (relationship.requested) {
|
||||
label = intl.formatMessage(messages.cancel_follow_request);
|
||||
} else if (
|
||||
relationship.following &&
|
||||
isShowItem('relationships') &&
|
||||
|
@ -93,7 +104,7 @@ export const FollowButton: React.FC<{
|
|||
relationship.followed_by
|
||||
) {
|
||||
label = intl.formatMessage(messages.followBack);
|
||||
} else if (relationship.following) {
|
||||
} else if (relationship.following || relationship.requested) {
|
||||
label = intl.formatMessage(messages.unfollow);
|
||||
} else {
|
||||
label = intl.formatMessage(messages.follow);
|
||||
|
|
|
@ -17,7 +17,7 @@ import { useAppSelector, useAppDispatch } from 'mastodon/store';
|
|||
|
||||
export const HoverCardAccount = forwardRef<
|
||||
HTMLDivElement,
|
||||
{ accountId: string }
|
||||
{ accountId?: string }
|
||||
>(({ accountId }, ref) => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ import { useTimeout } from 'mastodon/../hooks/useTimeout';
|
|||
import { HoverCardAccount } from 'mastodon/components/hover_card_account';
|
||||
|
||||
const offset = [-12, 4] as OffsetValue;
|
||||
const enterDelay = 650;
|
||||
const leaveDelay = 250;
|
||||
const enterDelay = 750;
|
||||
const leaveDelay = 150;
|
||||
const popperConfig = { strategy: 'fixed' } as UsePopperOptions;
|
||||
|
||||
const isHoverCardAnchor = (/*element: HTMLElement*/) => false; // set false until original is fixed some problem about this hover
|
||||
|
@ -23,50 +23,12 @@ export const HoverCardController: React.FC = () => {
|
|||
const [open, setOpen] = useState(false);
|
||||
const [accountId, setAccountId] = useState<string | undefined>();
|
||||
const [anchor, setAnchor] = useState<HTMLElement | null>(null);
|
||||
const cardRef = useRef<HTMLDivElement>(null);
|
||||
const cardRef = useRef<HTMLDivElement | null>(null);
|
||||
const [setLeaveTimeout, cancelLeaveTimeout] = useTimeout();
|
||||
const [setEnterTimeout, cancelEnterTimeout] = useTimeout();
|
||||
const [setEnterTimeout, cancelEnterTimeout, delayEnterTimeout] = useTimeout();
|
||||
const [setScrollTimeout] = useTimeout();
|
||||
const location = useLocation();
|
||||
|
||||
const handleAnchorMouseEnter = useCallback(
|
||||
(e: MouseEvent) => {
|
||||
const { target } = e;
|
||||
|
||||
if (target instanceof HTMLElement && isHoverCardAnchor(/*target*/)) {
|
||||
cancelLeaveTimeout();
|
||||
|
||||
setEnterTimeout(() => {
|
||||
target.setAttribute('aria-describedby', 'hover-card');
|
||||
setAnchor(target);
|
||||
setOpen(true);
|
||||
setAccountId(
|
||||
target.getAttribute('data-hover-card-account') ?? undefined,
|
||||
);
|
||||
}, enterDelay);
|
||||
}
|
||||
|
||||
if (target === cardRef.current?.parentNode) {
|
||||
cancelLeaveTimeout();
|
||||
}
|
||||
},
|
||||
[cancelLeaveTimeout, setEnterTimeout, setOpen, setAccountId, setAnchor],
|
||||
);
|
||||
|
||||
const handleAnchorMouseLeave = useCallback(
|
||||
(e: MouseEvent) => {
|
||||
if (e.target === anchor || e.target === cardRef.current?.parentNode) {
|
||||
cancelEnterTimeout();
|
||||
|
||||
setLeaveTimeout(() => {
|
||||
anchor?.removeAttribute('aria-describedby');
|
||||
setOpen(false);
|
||||
setAnchor(null);
|
||||
}, leaveDelay);
|
||||
}
|
||||
},
|
||||
[cancelEnterTimeout, setLeaveTimeout, setOpen, setAnchor, anchor],
|
||||
);
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
cancelEnterTimeout();
|
||||
cancelLeaveTimeout();
|
||||
|
@ -79,22 +41,119 @@ export const HoverCardController: React.FC = () => {
|
|||
}, [handleClose, location]);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.addEventListener('mouseenter', handleAnchorMouseEnter, {
|
||||
let isScrolling = false;
|
||||
let currentAnchor: HTMLElement | null = null;
|
||||
|
||||
const open = (target: HTMLElement) => {
|
||||
target.setAttribute('aria-describedby', 'hover-card');
|
||||
setOpen(true);
|
||||
setAnchor(target);
|
||||
setAccountId(target.getAttribute('data-hover-card-account') ?? undefined);
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
currentAnchor?.removeAttribute('aria-describedby');
|
||||
currentAnchor = null;
|
||||
setOpen(false);
|
||||
setAnchor(null);
|
||||
setAccountId(undefined);
|
||||
};
|
||||
|
||||
const handleMouseEnter = (e: MouseEvent) => {
|
||||
const { target } = e;
|
||||
|
||||
// We've exited the window
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
// We've entered an anchor
|
||||
if (!isScrolling && isHoverCardAnchor(/*target*/)) {
|
||||
cancelLeaveTimeout();
|
||||
|
||||
currentAnchor?.removeAttribute('aria-describedby');
|
||||
currentAnchor = target;
|
||||
|
||||
setEnterTimeout(() => {
|
||||
open(target);
|
||||
}, enterDelay);
|
||||
}
|
||||
|
||||
// We've entered the hover card
|
||||
if (
|
||||
!isScrolling &&
|
||||
(target === currentAnchor || target === cardRef.current)
|
||||
) {
|
||||
cancelLeaveTimeout();
|
||||
}
|
||||
};
|
||||
|
||||
const handleMouseLeave = (e: MouseEvent) => {
|
||||
if (!currentAnchor) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.target === currentAnchor || e.target === cardRef.current) {
|
||||
cancelEnterTimeout();
|
||||
|
||||
setLeaveTimeout(() => {
|
||||
close();
|
||||
}, leaveDelay);
|
||||
}
|
||||
};
|
||||
|
||||
const handleScrollEnd = () => {
|
||||
isScrolling = false;
|
||||
};
|
||||
|
||||
const handleScroll = () => {
|
||||
isScrolling = true;
|
||||
cancelEnterTimeout();
|
||||
setScrollTimeout(handleScrollEnd, 100);
|
||||
};
|
||||
|
||||
const handleMouseMove = () => {
|
||||
delayEnterTimeout(enterDelay);
|
||||
};
|
||||
|
||||
document.body.addEventListener('mouseenter', handleMouseEnter, {
|
||||
passive: true,
|
||||
capture: true,
|
||||
});
|
||||
document.body.addEventListener('mouseleave', handleAnchorMouseLeave, {
|
||||
|
||||
document.body.addEventListener('mousemove', handleMouseMove, {
|
||||
passive: true,
|
||||
capture: false,
|
||||
});
|
||||
|
||||
document.body.addEventListener('mouseleave', handleMouseLeave, {
|
||||
passive: true,
|
||||
capture: true,
|
||||
});
|
||||
|
||||
document.addEventListener('scroll', handleScroll, {
|
||||
passive: true,
|
||||
capture: true,
|
||||
});
|
||||
|
||||
return () => {
|
||||
document.body.removeEventListener('mouseenter', handleAnchorMouseEnter);
|
||||
document.body.removeEventListener('mouseleave', handleAnchorMouseLeave);
|
||||
document.body.removeEventListener('mouseenter', handleMouseEnter);
|
||||
document.body.removeEventListener('mousemove', handleMouseMove);
|
||||
document.body.removeEventListener('mouseleave', handleMouseLeave);
|
||||
document.removeEventListener('scroll', handleScroll);
|
||||
};
|
||||
}, [handleAnchorMouseEnter, handleAnchorMouseLeave]);
|
||||
|
||||
if (!accountId) return null;
|
||||
}, [
|
||||
setEnterTimeout,
|
||||
setLeaveTimeout,
|
||||
setScrollTimeout,
|
||||
cancelEnterTimeout,
|
||||
cancelLeaveTimeout,
|
||||
delayEnterTimeout,
|
||||
setOpen,
|
||||
setAccountId,
|
||||
setAnchor,
|
||||
]);
|
||||
|
||||
return (
|
||||
<Overlay
|
||||
|
|
|
@ -33,6 +33,7 @@ export default class StatusList extends ImmutablePureComponent {
|
|||
withCounters: PropTypes.bool,
|
||||
timelineId: PropTypes.string,
|
||||
lastId: PropTypes.string,
|
||||
bindToDocument: PropTypes.bool,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
|
|
@ -98,7 +98,7 @@ const messageForFollowButton = relationship => {
|
|||
return messages.mutual;
|
||||
} else if (!relationship.get('following') && relationship.get('followed_by') && isShowItem('relationships')) {
|
||||
return messages.followBack;
|
||||
} else if (relationship.get('following')) {
|
||||
} else if (relationship.get('following') || relationship.get('requested')) {
|
||||
return messages.unfollow;
|
||||
} else {
|
||||
return messages.follow;
|
||||
|
@ -313,10 +313,8 @@ class Header extends ImmutablePureComponent {
|
|||
if (me !== account.get('id')) {
|
||||
if (signedIn && !account.get('relationship')) { // Wait until the relationship is loaded
|
||||
actionBtn = <Button disabled><LoadingIndicator /></Button>;
|
||||
} else if (account.getIn(['relationship', 'requested'])) {
|
||||
actionBtn = <Button 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({ 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(messageForFollowButton(account.get('relationship')))} onClick={signedIn ? this.props.onFollow : this.props.onInteractionModal} />;
|
||||
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames({ 'button--destructive': (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) })} text={intl.formatMessage(messageForFollowButton(account.get('relationship')))} onClick={signedIn ? this.props.onFollow : this.props.onInteractionModal} />;
|
||||
} else if (account.getIn(['relationship', 'blocking'])) {
|
||||
actionBtn = <Button text={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.props.onBlock} />;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import { makeGetAccount, getAccountHidden } from '../../../selectors';
|
|||
import Header from '../components/header';
|
||||
|
||||
const messages = defineMessages({
|
||||
cancelFollowRequestConfirm: { id: 'confirmations.cancel_follow_request.confirm', defaultMessage: 'Withdraw request' },
|
||||
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
|
||||
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Block entire domain' },
|
||||
});
|
||||
|
@ -46,7 +45,7 @@ const makeMapStateToProps = () => {
|
|||
const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
|
||||
onFollow (account) {
|
||||
if (account.getIn(['relationship', 'following'])) {
|
||||
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
|
||||
dispatch(openModal({
|
||||
modalType: 'CONFIRM',
|
||||
modalProps: {
|
||||
|
@ -55,15 +54,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
|
||||
},
|
||||
}));
|
||||
} else if (account.getIn(['relationship', 'requested'])) {
|
||||
dispatch(openModal({
|
||||
modalType: 'CONFIRM',
|
||||
modalProps: {
|
||||
message: <FormattedMessage id='confirmations.cancel_follow_request.message' defaultMessage='Are you sure you want to withdraw your request to follow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
|
||||
confirm: intl.formatMessage(messages.cancelFollowRequestConfirm),
|
||||
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
|
||||
},
|
||||
}));
|
||||
} else {
|
||||
dispatch(followAccount(account.get('id')));
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown })
|
|||
menu.push({ text: intl.formatMessage(messages.delete), action: handleDelete });
|
||||
|
||||
const names = accounts.map(a => (
|
||||
<Link to={`/@${a.get('acct')}`} key={a.get('id')} title={a.get('acct')}>
|
||||
<Link to={`/@${a.get('acct')}`} key={a.get('id')} data-hover-card-account={a.get('id')}>
|
||||
<bdi>
|
||||
<strong
|
||||
className='display-name__html'
|
||||
|
|
|
@ -4,6 +4,8 @@ import { useState, useCallback } from 'react';
|
|||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import classNames from 'classnames';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
|
||||
|
||||
import { Blurhash } from 'mastodon/components/blurhash';
|
||||
|
@ -57,7 +59,7 @@ export const Story = ({
|
|||
|
||||
<div className='story__details__shared'>
|
||||
{author ? <FormattedMessage id='link_preview.author' className='story__details__shared__author' defaultMessage='By {name}' values={{ name: authorAccount ? <AuthorLink accountId={authorAccount} /> : <strong>{author}</strong> }} /> : <span />}
|
||||
{typeof sharedTimes === 'number' ? <span className='story__details__shared__pill'><ShortNumber value={sharedTimes} renderer={sharesCountRenderer} /></span> : <Skeleton width='10ch' />}
|
||||
{typeof sharedTimes === 'number' ? <Link className='story__details__shared__pill' to={`/links/${encodeURIComponent(url)}`}><ShortNumber value={sharedTimes} renderer={sharesCountRenderer} /></Link> : <Skeleton width='10ch' />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
76
app/javascript/mastodon/features/link_timeline/index.tsx
Normal file
76
app/javascript/mastodon/features/link_timeline/index.tsx
Normal file
|
@ -0,0 +1,76 @@
|
|||
import { useRef, useEffect, useCallback } from 'react';
|
||||
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
import ExploreIcon from '@/material-icons/400-24px/explore.svg?react';
|
||||
import { expandLinkTimeline } from 'mastodon/actions/timelines';
|
||||
import Column from 'mastodon/components/column';
|
||||
import { ColumnHeader } from 'mastodon/components/column_header';
|
||||
import StatusListContainer from 'mastodon/features/ui/containers/status_list_container';
|
||||
import type { Card } from 'mastodon/models/status';
|
||||
import { useAppDispatch, useAppSelector } from 'mastodon/store';
|
||||
|
||||
export const LinkTimeline: React.FC<{
|
||||
multiColumn: boolean;
|
||||
}> = ({ multiColumn }) => {
|
||||
const { url } = useParams<{ url: string }>();
|
||||
const decodedUrl = url ? decodeURIComponent(url) : undefined;
|
||||
const dispatch = useAppDispatch();
|
||||
const columnRef = useRef<Column>(null);
|
||||
const firstStatusId = useAppSelector((state) =>
|
||||
decodedUrl
|
||||
? // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
||||
(state.timelines.getIn([`link:${decodedUrl}`, 'items', 0]) as string)
|
||||
: undefined,
|
||||
);
|
||||
const story = useAppSelector((state) =>
|
||||
firstStatusId
|
||||
? (state.statuses.getIn([firstStatusId, 'card']) as Card)
|
||||
: undefined,
|
||||
);
|
||||
|
||||
const handleHeaderClick = useCallback(() => {
|
||||
columnRef.current?.scrollTop();
|
||||
}, []);
|
||||
|
||||
const handleLoadMore = useCallback(
|
||||
(maxId: string) => {
|
||||
dispatch(expandLinkTimeline(decodedUrl, { maxId }));
|
||||
},
|
||||
[dispatch, decodedUrl],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(expandLinkTimeline(decodedUrl));
|
||||
}, [dispatch, decodedUrl]);
|
||||
|
||||
return (
|
||||
<Column bindToDocument={!multiColumn} ref={columnRef} label={story?.title}>
|
||||
<ColumnHeader
|
||||
icon='explore'
|
||||
iconComponent={ExploreIcon}
|
||||
title={story?.title}
|
||||
onClick={handleHeaderClick}
|
||||
multiColumn={multiColumn}
|
||||
showBackButton
|
||||
/>
|
||||
|
||||
<StatusListContainer
|
||||
timelineId={`link:${decodedUrl}`}
|
||||
onLoadMore={handleLoadMore}
|
||||
trackScroll
|
||||
scrollKey={`link_timeline-${decodedUrl}`}
|
||||
bindToDocument={!multiColumn}
|
||||
/>
|
||||
|
||||
<Helmet>
|
||||
<title>{story?.title}</title>
|
||||
<meta name='robots' content='noindex' />
|
||||
</Helmet>
|
||||
</Column>
|
||||
);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default LinkTimeline;
|
|
@ -63,6 +63,7 @@ import {
|
|||
BookmarkCategories,
|
||||
BookmarkCategoryStatuses,
|
||||
FollowedTags,
|
||||
LinkTimeline,
|
||||
ListTimeline,
|
||||
Blocks,
|
||||
DomainBlocks,
|
||||
|
@ -217,6 +218,7 @@ class SwitchingColumnsArea extends PureComponent {
|
|||
<WrappedRoute path='/public/local/fixed' exact component={CommunityTimeline} content={children} />
|
||||
<WrappedRoute path={['/conversations', '/timelines/direct']} component={DirectTimeline} content={children} />
|
||||
<WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} />
|
||||
<WrappedRoute path='/links/:url' component={LinkTimeline} content={children} />
|
||||
<WrappedRoute path='/lists/:id' component={ListTimeline} content={children} />
|
||||
<WrappedRoute path='/antennasw/:id' component={AntennaSetting} content={children} />
|
||||
<WrappedRoute path='/antennast/:id' component={AntennaTimeline} content={children} />
|
||||
|
|
|
@ -269,3 +269,7 @@ export function NotificationRequests () {
|
|||
export function NotificationRequest () {
|
||||
return import(/*webpackChunkName: "features/notifications/request" */'../../notifications/request');
|
||||
}
|
||||
|
||||
export function LinkTimeline () {
|
||||
return import(/*webpackChunkName: "features/link_timeline" */'../../link_timeline');
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
"account.follow_back": "Heuliañ d'ho tro",
|
||||
"account.followers": "Tud koumanantet",
|
||||
"account.followers.empty": "Den na heul an implijer·ez-mañ c'hoazh.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} heulier} two {{counter} heulier} few {{counter} heulier} many {{counter} heulier} other {{counter} heulier}}",
|
||||
"account.following": "Koumanantoù",
|
||||
"account.follows.empty": "An implijer·ez-mañ na heul den ebet.",
|
||||
"account.go_to_profile": "Gwelet ar profil",
|
||||
|
@ -60,6 +61,7 @@
|
|||
"account.requested_follow": "Gant {name} eo bet goulennet ho heuliañ",
|
||||
"account.share": "Skignañ profil @{name}",
|
||||
"account.show_reblogs": "Diskouez skignadennoù @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} embannadur} two {{counter} embannadur} few {{counter} embannadur} many {{counter} embannadur} other {{counter} embannadur}}",
|
||||
"account.unblock": "Diverzañ @{name}",
|
||||
"account.unblock_domain": "Diverzañ an domani {domain}",
|
||||
"account.unblock_short": "Distankañ",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"account.block_short": "Zablokovat",
|
||||
"account.blocked": "Blokovaný",
|
||||
"account.browse_more_on_origin_server": "Více na původním profilu",
|
||||
"account.cancel_follow_request": "Zrušit žádost o sledování",
|
||||
"account.cancel_follow_request": "Zrušit sledování",
|
||||
"account.copy": "Kopírovat odkaz na profil",
|
||||
"account.direct": "Soukromě zmínit @{name}",
|
||||
"account.disable_notifications": "Přestat mě upozorňovat, když @{name} zveřejní příspěvek",
|
||||
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Také sledovat",
|
||||
"account.followers": "Sledující",
|
||||
"account.followers.empty": "Tohoto uživatele zatím nikdo nesleduje.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} sledující} few {{counter} sledující} many {{counter} sledujících} other {{counter} sledujících}}",
|
||||
"account.following": "Sledujete",
|
||||
"account.following_counter": "{count, plural, one {{counter} sledovaný} few {{counter} sledovaní} many {{counter} sledovaných} other {{counter} sledovaných}}",
|
||||
"account.follows.empty": "Tento uživatel zatím nikoho nesleduje.",
|
||||
"account.go_to_profile": "Přejít na profil",
|
||||
"account.hide_reblogs": "Skrýt boosty od @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} tě požádal o sledování",
|
||||
"account.share": "Sdílet profil @{name}",
|
||||
"account.show_reblogs": "Zobrazit boosty od @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} příspěvek} few {{counter} příspěvky} many {{counter} příspěvků} other {{counter} příspěvků}}",
|
||||
"account.unblock": "Odblokovat @{name}",
|
||||
"account.unblock_domain": "Odblokovat doménu {domain}",
|
||||
"account.unblock_short": "Odblokovat",
|
||||
|
@ -75,9 +78,9 @@
|
|||
"admin.dashboard.retention.average": "Průměr",
|
||||
"admin.dashboard.retention.cohort": "Měsíc registrace",
|
||||
"admin.dashboard.retention.cohort_size": "Noví uživatelé",
|
||||
"admin.impact_report.instance_accounts": "Profily účtů, které by odstranily",
|
||||
"admin.impact_report.instance_followers": "Sledovatelé, o které by naši uživatelé přišli",
|
||||
"admin.impact_report.instance_follows": "Následovníci jejich uživatelé by ztratili",
|
||||
"admin.impact_report.instance_accounts": "Profily účtů, které by byli odstaněny",
|
||||
"admin.impact_report.instance_followers": "Sledující, o které by naši uživatelé přišli",
|
||||
"admin.impact_report.instance_follows": "Sledující, o které by naši uživatelé přišli",
|
||||
"admin.impact_report.title": "Shrnutí dopadu",
|
||||
"alert.rate_limited.message": "Zkuste to prosím znovu po {retry_time, time, medium}.",
|
||||
"alert.rate_limited.title": "Spojení omezena",
|
||||
|
@ -86,7 +89,7 @@
|
|||
"announcement.announcement": "Oznámení",
|
||||
"attachments_list.unprocessed": "(nezpracováno)",
|
||||
"audio.hide": "Skrýt zvuk",
|
||||
"block_modal.remote_users_caveat": "Požádáme server {domain}, aby respektoval vaše rozhodnutí. Úplné dodržování nastavení však není zaručeno, protože některé servery mohou řešit blokování různě. Veřejné příspěvky mohou být stále viditelné pro nepřihlášené uživatele.",
|
||||
"block_modal.remote_users_caveat": "Požádáme server {domain}, aby respektoval vaše rozhodnutí. Úplné dodržování nastavení však není zaručeno, protože některé servery mohou řešit blokování různě. Veřejné příspěvky mohou stále být viditelné pro nepřihlášené uživatele.",
|
||||
"block_modal.show_less": "Zobrazit méně",
|
||||
"block_modal.show_more": "Zobrazit více",
|
||||
"block_modal.they_cant_mention": "Nemůže vás zmiňovat ani sledovat.",
|
||||
|
@ -411,6 +414,8 @@
|
|||
"limited_account_hint.action": "Přesto profil zobrazit",
|
||||
"limited_account_hint.title": "Tento profil byl skryt moderátory {domain}.",
|
||||
"link_preview.author": "Podle {name}",
|
||||
"link_preview.more_from_author": "Více od {name}",
|
||||
"link_preview.shares": "{count, plural, one {{counter} příspěvek} few {{counter} příspěvky} many {{counter} příspěvků} other {{counter} příspěvků}}",
|
||||
"lists.account.add": "Přidat do seznamu",
|
||||
"lists.account.remove": "Odebrat ze seznamu",
|
||||
"lists.delete": "Smazat seznam",
|
||||
|
@ -691,8 +696,11 @@
|
|||
"server_banner.about_active_users": "Lidé používající tento server během posledních 30 dní (měsíční aktivní uživatelé)",
|
||||
"server_banner.active_users": "aktivní uživatelé",
|
||||
"server_banner.administered_by": "Spravováno:",
|
||||
"server_banner.is_one_of_many": "{domain} je jedním z mnoha Mastodon serverů, které můžete použít k účasti na fediversu.",
|
||||
"server_banner.server_stats": "Statistiky serveru:",
|
||||
"sign_in_banner.create_account": "Vytvořit účet",
|
||||
"sign_in_banner.follow_anyone": "Sledujte kohokoli napříč fediversem a uvidíte vše v chronologickém pořadí. Bez algoritmů, reklam a clickbaitu.",
|
||||
"sign_in_banner.mastodon_is": "Mastodon je ten nejlepší způsob, jak udržet krok s tím, co se právě děje.",
|
||||
"sign_in_banner.sign_in": "Přihlásit se",
|
||||
"sign_in_banner.sso_redirect": "Přihlášení nebo Registrace",
|
||||
"status.admin_account": "Otevřít moderátorské rozhraní pro @{name}",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Follow back",
|
||||
"account.followers": "Followers",
|
||||
"account.followers.empty": "No one follows this user yet.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} follower} other {{counter} followers}}",
|
||||
"account.following": "Following",
|
||||
"account.following_counter": "{count, plural, one {{counter} following} other {{counter} following}}",
|
||||
"account.follows.empty": "This user doesn't follow anyone yet.",
|
||||
"account.go_to_profile": "Go to profile",
|
||||
"account.hide_reblogs": "Hide boosts from @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} has requested to follow you",
|
||||
"account.share": "Share @{name}'s profile",
|
||||
"account.show_reblogs": "Show boosts from @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} post} other {{counter} posts}}",
|
||||
"account.unblock": "Unblock @{name}",
|
||||
"account.unblock_domain": "Unblock domain {domain}",
|
||||
"account.unblock_short": "Unblock",
|
||||
|
@ -411,6 +414,8 @@
|
|||
"limited_account_hint.action": "Show profile anyway",
|
||||
"limited_account_hint.title": "This profile has been hidden by the moderators of {domain}.",
|
||||
"link_preview.author": "By {name}",
|
||||
"link_preview.more_from_author": "More from {name}",
|
||||
"link_preview.shares": "{count, plural, one {{counter} post} other {{counter} posts}}",
|
||||
"lists.account.add": "Add to list",
|
||||
"lists.account.remove": "Remove from list",
|
||||
"lists.delete": "Delete list",
|
||||
|
@ -691,8 +696,11 @@
|
|||
"server_banner.about_active_users": "People using this server during the last 30 days (Monthly Active Users)",
|
||||
"server_banner.active_users": "active users",
|
||||
"server_banner.administered_by": "Administered by:",
|
||||
"server_banner.is_one_of_many": "{domain} is one of the many independent Mastodon servers you can use to participate in the fediverse.",
|
||||
"server_banner.server_stats": "Server stats:",
|
||||
"sign_in_banner.create_account": "Create account",
|
||||
"sign_in_banner.follow_anyone": "Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.",
|
||||
"sign_in_banner.mastodon_is": "Mastodon is the best way to keep up with what's happening.",
|
||||
"sign_in_banner.sign_in": "Sign in",
|
||||
"sign_in_banner.sso_redirect": "Login or Register",
|
||||
"status.admin_account": "Open moderation interface for @{name}",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Fylg aftur",
|
||||
"account.followers": "Fylgjarar",
|
||||
"account.followers.empty": "Ongar fylgjarar enn.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} fylgjari} other {{counter} fylgjarar}}",
|
||||
"account.following": "Fylgir",
|
||||
"account.following_counter": "{count, plural, one {{counter} fylgir} other {{counter} fylgja}}",
|
||||
"account.follows.empty": "Hesin brúkari fylgir ongum enn.",
|
||||
"account.go_to_profile": "Far til vanga",
|
||||
"account.hide_reblogs": "Fjal lyft frá @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} hevur biðið um at fylgja tær",
|
||||
"account.share": "Deil vanga @{name}'s",
|
||||
"account.show_reblogs": "Vís lyft frá @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} postur} other {{counter} postar}}",
|
||||
"account.unblock": "Banna ikki @{name}",
|
||||
"account.unblock_domain": "Banna ikki økisnavnið {domain}",
|
||||
"account.unblock_short": "Banna ikki",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Seguir tamén",
|
||||
"account.followers": "Seguidoras",
|
||||
"account.followers.empty": "Aínda ninguén segue esta usuaria.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} seguidora} other {{counter} seguidoras}}",
|
||||
"account.following": "Seguindo",
|
||||
"account.following_counter": "{count, plural, one {{counter} seguimento} other {{counter} seguimentos}}",
|
||||
"account.follows.empty": "Esta usuaria aínda non segue a ninguén.",
|
||||
"account.go_to_profile": "Ir ao perfil",
|
||||
"account.hide_reblogs": "Agochar promocións de @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} solicitou seguirte",
|
||||
"account.share": "Compartir o perfil de @{name}",
|
||||
"account.show_reblogs": "Amosar compartidos de @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} publicación} other {{counter} publicacións}}",
|
||||
"account.unblock": "Desbloquear @{name}",
|
||||
"account.unblock_domain": "Amosar {domain}",
|
||||
"account.unblock_short": "Desbloquear",
|
||||
|
@ -221,7 +224,7 @@
|
|||
"domain_pill.their_server": "O seu fogar dixital, onde están as súas publicacións.",
|
||||
"domain_pill.their_username": "O seu identificador único no seu servidor. É posible atopar usuarias co mesmo nome de usuaria en diferentes servidores.",
|
||||
"domain_pill.username": "Nome de usuaria",
|
||||
"domain_pill.whats_in_a_handle": "Que é o alcume?",
|
||||
"domain_pill.whats_in_a_handle": "As partes do alcume?",
|
||||
"domain_pill.who_they_are": "O alcume dinos quen é esa persoa e onde está, para que poidas interactuar con ela en toda a web social de <button>plataformas ActivityPub</button>.",
|
||||
"domain_pill.who_you_are": "Como o teu alcume informa de quen es e onde estás, as persoas poden interactuar contigo desde toda a web social de <button>plataformas ActivityPub</button>.",
|
||||
"domain_pill.your_handle": "O teu alcume:",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "לעקוב בחזרה",
|
||||
"account.followers": "עוקבים",
|
||||
"account.followers.empty": "אף אחד לא עוקב אחר המשתמש הזה עדיין.",
|
||||
"account.followers_counter": "{count, plural,one {עוקב אחד} other {{count} עוקבים}}",
|
||||
"account.following": "נעקבים",
|
||||
"account.following_counter": "{count, plural,one {עוקב אחרי {count}}other {עוקב אחרי {count}}}",
|
||||
"account.follows.empty": "משתמש זה עדיין לא עוקב אחרי אף אחד.",
|
||||
"account.go_to_profile": "מעבר לפרופיל",
|
||||
"account.hide_reblogs": "להסתיר הידהודים מאת @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} ביקשו לעקוב אחריך",
|
||||
"account.share": "שתף את הפרופיל של @{name}",
|
||||
"account.show_reblogs": "הצג הדהודים מאת @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {הודעה אחת} two {הודעותיים} many {{count} הודעות} other {{count} הודעות}}",
|
||||
"account.unblock": "להסיר חסימה ל- @{name}",
|
||||
"account.unblock_domain": "הסירי את החסימה של קהילת {domain}",
|
||||
"account.unblock_short": "הסר חסימה",
|
||||
|
@ -693,8 +696,11 @@
|
|||
"server_banner.about_active_users": "משתמשים פעילים בשרת ב־30 הימים האחרונים (משתמשים פעילים חודשיים)",
|
||||
"server_banner.active_users": "משתמשים פעילים",
|
||||
"server_banner.administered_by": "מנוהל ע\"י:",
|
||||
"server_banner.is_one_of_many": "{domain} הוא שרת אחד משרתי מסטודון עצמאיים רבים שדרגם תוכלו להשתתף בפדיוורס (רשת חברתית מבוזרת).",
|
||||
"server_banner.server_stats": "סטטיסטיקות שרת:",
|
||||
"sign_in_banner.create_account": "יצירת חשבון",
|
||||
"sign_in_banner.follow_anyone": "תוכלו לעקוב אחרי כל משמתמש בפדיוורס ולקרוא הכל לפי סדר הפרסום בציר הזמן. אין אלגוריתמים, פרסומות, או קליקבייט מטעם בעלי הרשת.",
|
||||
"sign_in_banner.mastodon_is": "מסטודון הוא הדרך הטובה ביותר לעקוב אחרי מה שקורה.",
|
||||
"sign_in_banner.sign_in": "התחברות",
|
||||
"sign_in_banner.sso_redirect": "התחברות/הרשמה",
|
||||
"status.admin_account": "פתח/י ממשק ניהול עבור @{name}",
|
||||
|
@ -771,7 +777,7 @@
|
|||
"timeline_hint.resources.followers": "עוקבים",
|
||||
"timeline_hint.resources.follows": "נעקבים",
|
||||
"timeline_hint.resources.statuses": "הודעות ישנות יותר",
|
||||
"trends.counter_by_accounts": "{count, plural, one {אדם {count}} other {{count} א.נשים}} {days, plural, one {מאז אתמול} two {ביומיים האחרונים} other {במשך {days} הימים האחרונים}}",
|
||||
"trends.counter_by_accounts": "{count, plural, one {אדם אחד} other {{count} א.נשים}} {days, plural, one {מאז אתמול} two {ביומיים האחרונים} other {במשך {days} הימים האחרונים}}",
|
||||
"trends.trending_now": "נושאים חמים",
|
||||
"ui.beforeunload": "הטיוטא תאבד אם תעזבו את מסטודון.",
|
||||
"units.short.billion": "{count} מליארד",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Viszontkövetés",
|
||||
"account.followers": "Követő",
|
||||
"account.followers.empty": "Ezt a felhasználót még senki sem követi.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} követő} other {{counter} követő}}",
|
||||
"account.following": "Követve",
|
||||
"account.following_counter": "{count, plural, one {{counter} követett} other {{counter} követett}}",
|
||||
"account.follows.empty": "Ez a felhasználó még senkit sem követ.",
|
||||
"account.go_to_profile": "Ugrás a profilhoz",
|
||||
"account.hide_reblogs": "@{name} megtolásainak elrejtése",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} kérte, hogy követhessen",
|
||||
"account.share": "@{name} profiljának megosztása",
|
||||
"account.show_reblogs": "@{name} megtolásainak mutatása",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} bejegyzés} other {{counter} bejegyzés}}",
|
||||
"account.unblock": "@{name} letiltásának feloldása",
|
||||
"account.unblock_domain": "{domain} domain tiltásának feloldása",
|
||||
"account.unblock_short": "Tiltás feloldása",
|
||||
|
|
|
@ -354,7 +354,7 @@
|
|||
"home.pending_critical_update.link": "Vider actualisationes",
|
||||
"home.pending_critical_update.title": "Actualisation de securitate critic disponibile!",
|
||||
"home.show_announcements": "Monstrar annuncios",
|
||||
"interaction_modal.description.favourite": "Con un conto sur Mastodon, tu pote marcar iste message como favorite pro informar le autor que tu lo apprecia e salveguarda pro plus tarde.",
|
||||
"interaction_modal.description.favourite": "Con un conto sur Mastodon, tu pote marcar iste message como favorite pro informar le autor que tu lo apprecia e lo salva pro plus tarde.",
|
||||
"interaction_modal.description.follow": "Con un conto sur Mastodon, tu pote sequer {name} e reciper su messages in tu fluxo de initio.",
|
||||
"interaction_modal.description.reblog": "Con un conto sur Mastodon, tu pote impulsar iste message pro condivider lo con tu proprie sequitores.",
|
||||
"interaction_modal.description.reply": "Con un conto sur Mastodon, tu pote responder a iste message.",
|
||||
|
@ -764,7 +764,7 @@
|
|||
"status.unmute_conversation": "Non plus silentiar conversation",
|
||||
"status.unpin": "Disfixar del profilo",
|
||||
"subscribed_languages.lead": "Solmente le messages in le linguas seligite apparera in tu chronologias de initio e de listas post le cambiamento. Selige necun pro reciper messages in tote le linguas.",
|
||||
"subscribed_languages.save": "Salveguardar le cambiamentos",
|
||||
"subscribed_languages.save": "Salvar le cambiamentos",
|
||||
"subscribed_languages.target": "Cambiar le linguas subscribite pro {target}",
|
||||
"tabs_bar.home": "Initio",
|
||||
"tabs_bar.notifications": "Notificationes",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "맞팔로우 하기",
|
||||
"account.followers": "팔로워",
|
||||
"account.followers.empty": "아직 아무도 이 사용자를 팔로우하고 있지 않습니다.",
|
||||
"account.followers_counter": "{count, plural, other {{counter} 팔로워}}",
|
||||
"account.following": "팔로잉",
|
||||
"account.following_counter": "{count, plural, other {{counter} 팔로잉}}",
|
||||
"account.follows.empty": "이 사용자는 아직 아무도 팔로우하고 있지 않습니다.",
|
||||
"account.go_to_profile": "프로필로 이동",
|
||||
"account.hide_reblogs": "@{name}의 부스트를 숨기기",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} 님이 팔로우 요청을 보냈습니다",
|
||||
"account.share": "@{name}의 프로필 공유",
|
||||
"account.show_reblogs": "@{name}의 부스트 보기",
|
||||
"account.statuses_counter": "{count, plural, other {{counter} 게시물}}",
|
||||
"account.unblock": "차단 해제",
|
||||
"account.unblock_domain": "도메인 {domain} 차단 해제",
|
||||
"account.unblock_short": "차단 해제",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Sekti atgal",
|
||||
"account.followers": "Sekėjai",
|
||||
"account.followers.empty": "Šio naudotojo dar niekas neseka.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} sekėjas} few {{counter} sekėjai} many {{counter} sekėjo} other {{counter} sekėjų}}",
|
||||
"account.following": "Sekama",
|
||||
"account.following_counter": "{count, plural, one {{counter} sekimas} few {{counter} sekimai} many {{counter} sekimo} other {{counter} sekimų}}",
|
||||
"account.follows.empty": "Šis naudotojas dar nieko neseka.",
|
||||
"account.go_to_profile": "Eiti į profilį",
|
||||
"account.hide_reblogs": "Slėpti pakėlimus iš @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} paprašė tave sekti",
|
||||
"account.share": "Bendrinti @{name} profilį",
|
||||
"account.show_reblogs": "Rodyti pakėlimus iš @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} įrašas} few {{counter} įrašai} many {{counter} įrašo} other {{counter} įrašų}}",
|
||||
"account.unblock": "Atblokuoti @{name}",
|
||||
"account.unblock_domain": "Atblokuoti domeną {domain}",
|
||||
"account.unblock_short": "Atblokuoti",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Fylg tilbake",
|
||||
"account.followers": "Fylgjarar",
|
||||
"account.followers.empty": "Ingen fylgjer denne brukaren enno.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} følgjar} other {{counter} følgjarar}}",
|
||||
"account.following": "Fylgjer",
|
||||
"account.following_counter": "{count, plural, one {{counter} følgjer} other {{counter} følgjer}}",
|
||||
"account.follows.empty": "Denne brukaren fylgjer ikkje nokon enno.",
|
||||
"account.go_to_profile": "Gå til profil",
|
||||
"account.hide_reblogs": "Gøym framhevingar frå @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} har bedt om å få fylgja deg",
|
||||
"account.share": "Del @{name} sin profil",
|
||||
"account.show_reblogs": "Vis framhevingar frå @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} innlegg} other {{counter} innlegg}}",
|
||||
"account.unblock": "Stopp blokkering av @{name}",
|
||||
"account.unblock_domain": "Stopp blokkering av domenet {domain}",
|
||||
"account.unblock_short": "Stopp blokkering",
|
||||
|
@ -693,8 +696,11 @@
|
|||
"server_banner.about_active_users": "Personar som har brukt denne tenaren dei siste 30 dagane (Månadlege Aktive Brukarar)",
|
||||
"server_banner.active_users": "aktive brukarar",
|
||||
"server_banner.administered_by": "Administrert av:",
|
||||
"server_banner.is_one_of_many": "{domain} er ein av dei mange uavhengige Mastodon-serverane du kan bruke til å delta i Fødiverset.",
|
||||
"server_banner.server_stats": "Tenarstatistikk:",
|
||||
"sign_in_banner.create_account": "Opprett konto",
|
||||
"sign_in_banner.follow_anyone": "Følg kven som helst på tvers av Fødiverset og sjå alt i kronologisk rekkjefølgje. Ingen algoritmar, reklamar eller clickbait i sikte.",
|
||||
"sign_in_banner.mastodon_is": "Mastodon er den beste måten å følgje med på det som skjer.",
|
||||
"sign_in_banner.sign_in": "Logg inn",
|
||||
"sign_in_banner.sso_redirect": "Logg inn eller registrer deg",
|
||||
"status.admin_account": "Opne moderasjonsgrensesnitt for @{name}",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Obserwuj wzajemnie",
|
||||
"account.followers": "Obserwujący",
|
||||
"account.followers.empty": "Nikt jeszcze nie obserwuje tego użytkownika.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} obserwujący} few {{counter} obserwujących} many {{counter} obserwujących} other {{counter} obserwujących}}",
|
||||
"account.following": "Obserwowani",
|
||||
"account.following_counter": "{count, plural, one {{counter} obserwowany} few {{counter} obserwowanych} many {{counter} obserwowanych} other {{counter} obserwowanych}}",
|
||||
"account.follows.empty": "Ten użytkownik nie obserwuje jeszcze nikogo.",
|
||||
"account.go_to_profile": "Przejdź do profilu",
|
||||
"account.hide_reblogs": "Ukryj podbicia od @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} chce zaobserwować twój profil",
|
||||
"account.share": "Udostępnij profil @{name}",
|
||||
"account.show_reblogs": "Pokazuj podbicia od @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} wpis} few {{counter} wpisy} many {{counter} wpisów} other {{counter} wpisów}}",
|
||||
"account.unblock": "Odblokuj @{name}",
|
||||
"account.unblock_domain": "Odblokuj domenę {domain}",
|
||||
"account.unblock_short": "Odblokuj",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Seguir de volta",
|
||||
"account.followers": "Seguidores",
|
||||
"account.followers.empty": "Ainda ninguém segue este utilizador.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} seguidor} other {{counter} seguidores}}",
|
||||
"account.following": "A seguir",
|
||||
"account.following_counter": "{count, plural, one {A seguir {counter}} other {A seguir {counter}}}",
|
||||
"account.follows.empty": "Este utilizador ainda não segue ninguém.",
|
||||
"account.go_to_profile": "Ir para o perfil",
|
||||
"account.hide_reblogs": "Esconder partilhas de @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} pediu para segui-lo",
|
||||
"account.share": "Partilhar o perfil @{name}",
|
||||
"account.show_reblogs": "Mostrar partilhas de @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} publicação} other {{counter} publicações}}",
|
||||
"account.unblock": "Desbloquear @{name}",
|
||||
"account.unblock_domain": "Desbloquear o domínio {domain}",
|
||||
"account.unblock_short": "Desbloquear",
|
||||
|
|
|
@ -88,7 +88,10 @@
|
|||
"audio.hide": "Skryť zvuk",
|
||||
"block_modal.show_less": "Zobraziť menej",
|
||||
"block_modal.show_more": "Zobraziť viac",
|
||||
"block_modal.they_cant_mention": "Nemôžu ťa spomenúť, alebo nasledovať.",
|
||||
"block_modal.they_will_know": "Môžu vidieť, že sú zablokovaní/ý.",
|
||||
"block_modal.title": "Blokovať užívateľa?",
|
||||
"block_modal.you_wont_see_mentions": "Neuvidíš príspevky, ktoré ich spomínajú.",
|
||||
"boost_modal.combo": "Nabudúce môžete preskočiť stlačením {combo}",
|
||||
"bundle_column_error.copy_stacktrace": "Kopírovať chybovú hlášku",
|
||||
"bundle_column_error.error.body": "Požadovanú stránku nebolo možné vykresliť. Môže to byť spôsobené chybou v našom kóde alebo problémom s kompatibilitou prehliadača.",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Ndiqe gjithashtu",
|
||||
"account.followers": "Ndjekës",
|
||||
"account.followers.empty": "Këtë përdorues ende s’e ndjek kush.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} ndjekës} other {{counter} ndjekës}}",
|
||||
"account.following": "Ndjekje",
|
||||
"account.following_counter": "{count, plural, one {{counter} i ndjekur} other {{counter} të ndjekur}}",
|
||||
"account.follows.empty": "Ky përdorues ende s’ndjek kënd.",
|
||||
"account.go_to_profile": "Kalo te profili",
|
||||
"account.hide_reblogs": "Fshih përforcime nga @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} ka kërkuar t’ju ndjekë",
|
||||
"account.share": "Ndajeni profilin e @{name} me të tjerët",
|
||||
"account.show_reblogs": "Shfaq përforcime nga @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} postim} other {{counter} postime}}",
|
||||
"account.unblock": "Zhbllokoje @{name}",
|
||||
"account.unblock_domain": "Zhblloko përkatësinë {domain}",
|
||||
"account.unblock_short": "Zhbllokoje",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Uzvrati praćenje",
|
||||
"account.followers": "Pratioci",
|
||||
"account.followers.empty": "Još uvek niko ne prati ovog korisnika.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} pratilac} few {{counter} pratioca} other {{counter} pratilaca}}",
|
||||
"account.following": "Prati",
|
||||
"account.following_counter": "{count, plural, one {{counter} prati} few {{counter} prati} other {{counter} prati}}",
|
||||
"account.follows.empty": "Ovaj korisnik još uvek nikog ne prati.",
|
||||
"account.go_to_profile": "Idi na profil",
|
||||
"account.hide_reblogs": "Sakrij podržavanja @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} je zatražio da vas prati",
|
||||
"account.share": "Podeli profil korisnika @{name}",
|
||||
"account.show_reblogs": "Prikaži podržavanja od korisnika @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} objava} few {{counter} objave} other {{counter} objava}}",
|
||||
"account.unblock": "Odblokiraj korisnika @{name}",
|
||||
"account.unblock_domain": "Odblokiraj domen {domain}",
|
||||
"account.unblock_short": "Odblokiraj",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Узврати праћење",
|
||||
"account.followers": "Пратиоци",
|
||||
"account.followers.empty": "Још увек нико не прати овог корисника.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} пратилац} few {{counter} пратиоца} other {{counter} пратилаца}}",
|
||||
"account.following": "Прати",
|
||||
"account.following_counter": "{count, plural, one {{counter} прати} few {{counter} прати} other {{counter} прати}}",
|
||||
"account.follows.empty": "Овај корисник још увек никог не прати.",
|
||||
"account.go_to_profile": "Иди на профил",
|
||||
"account.hide_reblogs": "Сакриј подржавања од @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} је затражио да вас прати",
|
||||
"account.share": "Подели профил корисника @{name}",
|
||||
"account.show_reblogs": "Прикажи подржавања од корисника @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} објава} few {{counter} објаве} other {{counter} објава}}",
|
||||
"account.unblock": "Одблокирај корисника @{name}",
|
||||
"account.unblock_domain": "Одблокирај домен {domain}",
|
||||
"account.unblock_short": "Одблокирај",
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
"account.follow_back": "Följ tillbaka",
|
||||
"account.followers": "Följare",
|
||||
"account.followers.empty": "Ingen följer denna användare än.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} följare} other {{counter} följare}}",
|
||||
"account.following": "Följer",
|
||||
"account.follows.empty": "Denna användare följer inte någon än.",
|
||||
"account.go_to_profile": "Gå till profilen",
|
||||
|
@ -61,6 +62,7 @@
|
|||
"account.requested_follow": "{name} har begärt att följa dig",
|
||||
"account.share": "Dela @{name}s profil",
|
||||
"account.show_reblogs": "Visa boostar från @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} inlägg} other {{counter} inlägg}}",
|
||||
"account.unblock": "Avblockera @{name}",
|
||||
"account.unblock_domain": "Avblockera {domain}",
|
||||
"account.unblock_short": "Avblockera",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "ติดตามกลับ",
|
||||
"account.followers": "ผู้ติดตาม",
|
||||
"account.followers.empty": "ยังไม่มีใครติดตามผู้ใช้นี้",
|
||||
"account.followers_counter": "{count, plural, other {{counter} ผู้ติดตาม}}",
|
||||
"account.following": "กำลังติดตาม",
|
||||
"account.following_counter": "{count, plural, other {{counter} กำลังติดตาม}}",
|
||||
"account.follows.empty": "ผู้ใช้นี้ยังไม่ได้ติดตามใคร",
|
||||
"account.go_to_profile": "ไปยังโปรไฟล์",
|
||||
"account.hide_reblogs": "ซ่อนการดันจาก @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} ได้ขอติดตามคุณ",
|
||||
"account.share": "แชร์โปรไฟล์ของ @{name}",
|
||||
"account.show_reblogs": "แสดงการดันจาก @{name}",
|
||||
"account.statuses_counter": "{count, plural, other {{counter} โพสต์}}",
|
||||
"account.unblock": "เลิกปิดกั้น @{name}",
|
||||
"account.unblock_domain": "เลิกปิดกั้นโดเมน {domain}",
|
||||
"account.unblock_short": "เลิกปิดกั้น",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Підписатися взаємно",
|
||||
"account.followers": "Підписники",
|
||||
"account.followers.empty": "Ніхто ще не підписаний на цього користувача.",
|
||||
"account.followers_counter": "{count, plural, one {{counter} підписник} few {{counter} підписники} many {{counter} підписників} other {{counter} підписники}}",
|
||||
"account.following": "Ви стежите",
|
||||
"account.following_counter": "{count, plural, one {{counter} підписка} few {{counter} підписки} many {{counter} підписок} other {{counter} підписки}}",
|
||||
"account.follows.empty": "Цей користувач ще ні на кого не підписався.",
|
||||
"account.go_to_profile": "Перейти до профілю",
|
||||
"account.hide_reblogs": "Сховати поширення від @{name}",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} надсилає запит на стеження",
|
||||
"account.share": "Поділитися профілем @{name}",
|
||||
"account.show_reblogs": "Показати поширення від @{name}",
|
||||
"account.statuses_counter": "{count, plural, one {{counter} допис} few {{counter} дописи} many {{counter} дописів} other {{counter} допис}}",
|
||||
"account.unblock": "Розблокувати @{name}",
|
||||
"account.unblock_domain": "Розблокувати {domain}",
|
||||
"account.unblock_short": "Розблокувати",
|
||||
|
@ -412,6 +415,7 @@
|
|||
"limited_account_hint.title": "Цей профіль сховали модератори {domain}.",
|
||||
"link_preview.author": "Від {name}",
|
||||
"link_preview.more_from_author": "Більше від {name}",
|
||||
"link_preview.shares": "{count, plural, one {{counter} допис} few {{counter} дописи} many {{counter} дописів} other {{counter} допис}}",
|
||||
"lists.account.add": "Додати до списку",
|
||||
"lists.account.remove": "Вилучити зі списку",
|
||||
"lists.delete": "Видалити список",
|
||||
|
@ -695,6 +699,7 @@
|
|||
"server_banner.is_one_of_many": "{domain} - один з багатьох незалежних серверів Mastodon, які ви можете використати, щоб брати участь у федівері.",
|
||||
"server_banner.server_stats": "Статистика сервера:",
|
||||
"sign_in_banner.create_account": "Створити обліковий запис",
|
||||
"sign_in_banner.follow_anyone": "Слідкуйте за ким завгодно у всьому fediverse і дивіться все це в хронологічному порядку. Немає алгоритмів, реклами чи наживок для натискань при перегляді.",
|
||||
"sign_in_banner.mastodon_is": "Мастодон - найкращий спосіб продовжувати свою справу.",
|
||||
"sign_in_banner.sign_in": "Увійти",
|
||||
"sign_in_banner.sso_redirect": "Увійдіть або зареєструйтесь",
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
"account.follow_back": "Theo dõi lại",
|
||||
"account.followers": "Người theo dõi",
|
||||
"account.followers.empty": "Chưa có người theo dõi nào.",
|
||||
"account.followers_counter": "{count, plural, other {{counter} người theo dõi}}",
|
||||
"account.following": "Đang theo dõi",
|
||||
"account.following_counter": "{count, plural, other {{counter} đang theo dõi}}",
|
||||
"account.follows.empty": "Người này chưa theo dõi ai.",
|
||||
"account.go_to_profile": "Xem hồ sơ",
|
||||
"account.hide_reblogs": "Ẩn tút @{name} đăng lại",
|
||||
|
@ -61,6 +63,7 @@
|
|||
"account.requested_follow": "{name} yêu cầu theo dõi bạn",
|
||||
"account.share": "Chia sẻ @{name}",
|
||||
"account.show_reblogs": "Hiện tút do @{name} đăng lại",
|
||||
"account.statuses_counter": "{count, plural, other {{counter} tút}}",
|
||||
"account.unblock": "Bỏ chặn @{name}",
|
||||
"account.unblock_domain": "Bỏ ẩn {domain}",
|
||||
"account.unblock_short": "Bỏ chặn",
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
import type { RecordOf } from 'immutable';
|
||||
|
||||
import type { ApiPreviewCardJSON } from 'mastodon/api_types/statuses';
|
||||
|
||||
export type { StatusVisibility } from 'mastodon/api_types/statuses';
|
||||
|
||||
// Temporary until we type it correctly
|
||||
export type Status = Immutable.Map<string, unknown>;
|
||||
|
||||
type CardShape = Required<ApiPreviewCardJSON>;
|
||||
|
||||
export type Card = RecordOf<CardShape>;
|
||||
|
|
|
@ -2,6 +2,7 @@ import { IntlProvider } from 'react-intl';
|
|||
|
||||
import { MemoryRouter } from 'react-router';
|
||||
|
||||
import type { RenderOptions } from '@testing-library/react';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { render as rtlRender } from '@testing-library/react';
|
||||
|
||||
|
@ -9,7 +10,11 @@ import { IdentityContext } from './identity_context';
|
|||
|
||||
function render(
|
||||
ui: React.ReactElement,
|
||||
{ locale = 'en', signedIn = true, ...renderOptions } = {},
|
||||
{
|
||||
locale = 'en',
|
||||
signedIn = true,
|
||||
...renderOptions
|
||||
}: RenderOptions & { locale?: string; signedIn?: boolean } = {},
|
||||
) {
|
||||
const fakeIdentity = {
|
||||
signedIn: signedIn,
|
||||
|
|
|
@ -10899,12 +10899,14 @@ noscript {
|
|||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
&.verified {
|
||||
dd {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 4px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
|
|
@ -118,7 +118,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
def find_existing_status
|
||||
status = status_from_uri(object_uri)
|
||||
status ||= Status.find_by(uri: @object['atomUri']) if @object['atomUri'].present?
|
||||
status
|
||||
status if status&.account_id == @account.id
|
||||
end
|
||||
|
||||
def process_status_params
|
||||
|
|
|
@ -16,7 +16,7 @@ module ApplicationExtension
|
|||
# dependent: delete_all, which means the ActiveRecord callback in
|
||||
# AccessTokenExtension is not run, so instead we manually announce to
|
||||
# streaming that these tokens are being deleted.
|
||||
before_destroy :push_to_streaming_api, prepend: true
|
||||
before_destroy :close_streaming_sessions, prepend: true
|
||||
end
|
||||
|
||||
def confirmation_redirect_uri
|
||||
|
@ -29,10 +29,12 @@ module ApplicationExtension
|
|||
redirect_uri.split
|
||||
end
|
||||
|
||||
def push_to_streaming_api
|
||||
def close_streaming_sessions(resource_owner = nil)
|
||||
# TODO: #28793 Combine into a single topic
|
||||
payload = Oj.dump(event: :kill)
|
||||
access_tokens.in_batches do |tokens|
|
||||
scope = access_tokens
|
||||
scope = scope.where(resource_owner_id: resource_owner.id) unless resource_owner.nil?
|
||||
scope.in_batches do |tokens|
|
||||
redis.pipelined do |pipeline|
|
||||
tokens.ids.each do |id|
|
||||
pipeline.publish("timeline:access_token:#{id}", payload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue