1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-11-27 14:28:55 +09:00

feature - Sent DM

This commit is contained in:
whippyshou 2023-10-31 22:30:19 +09:00
parent 2e979aa7d9
commit dea09a221e
16 changed files with 210 additions and 68 deletions

View File

@ -18,7 +18,12 @@ class StatusesIndex < Chewy::Index
language: 'possessive_english',
},
},
tokenizer: {
nori_user_dict: {
type: 'nori_tokenizer',
decompound_mode: 'mixed',
},
},
analyzer: {
verbatim: {
tokenizer: 'uax_url_email',
@ -26,7 +31,7 @@ class StatusesIndex < Chewy::Index
},
content: {
tokenizer: 'standard',
tokenizer: 'nori_user_dict',
filter: %w(
lowercase
asciifolding

View File

@ -0,0 +1,43 @@
import api from '../api';
import { me } from '../initial_state';
import { importFetchedStatuses } from './importer';
export const DIRECT_STATUSES_FETCH_REQUEST = 'DIRECT_STATUSES_FETCH_REQUEST';
export const DIRECT_STATUSES_FETCH_SUCCESS = 'DIRECT_STATUSES_FETCH_SUCCESS';
export const DIRECT_STATUSES_FETCH_FAIL = 'DIRECT_STATUSES_FETCH_FAIL';
export function fetchDirectStatuses() {
return (dispatch, getState) => {
dispatch(fetchDirectStatusesRequest());
api(getState).get(`/api/v1/accounts/${me}/statuses`).then(response => {
const directRes = (response.data).filter((item) => item==null || item.visibility ==='direct');
dispatch(importFetchedStatuses(directRes));
dispatch(fetchDirectStatusesSuccess(directRes, null));
}).catch(error => {
dispatch(fetchDirectStatusesFail(error));
});
};
}
export function fetchDirectStatusesRequest() {
return {
type: DIRECT_STATUSES_FETCH_REQUEST,
};
}
export function fetchDirectStatusesSuccess(statuses, next) {
return {
type: DIRECT_STATUSES_FETCH_SUCCESS,
statuses,
next,
};
}
export function fetchDirectStatusesFail(error) {
return {
type: DIRECT_STATUSES_FETCH_FAIL,
error,
};
}

View File

@ -12,7 +12,7 @@ import { ServerHeroImage } from 'mastodon/components/server_hero_image';
import { ShortNumber } from 'mastodon/components/short_number';
import { Skeleton } from 'mastodon/components/skeleton';
import Account from 'mastodon/containers/account_container';
import { domain } from 'mastodon/initial_state';
import { domain, title } from 'mastodon/initial_state';
const messages = defineMessages({
aboutActiveUsers: { id: 'server_banner.about_active_users', defaultMessage: 'People using this server during the last 30 days (Monthly Active Users)' },
@ -42,7 +42,7 @@ class ServerBanner extends PureComponent {
return (
<div className='server-banner'>
<div className='server-banner__introduction'>
<FormattedMessage id='server_banner.introduction' defaultMessage='{domain} is part of the decentralized social network powered by {mastodon}.' values={{ domain: <strong>{domain}</strong>, mastodon: <a href='https://joinmastodon.org' target='_blank'>Mastodon</a> }} />
<FormattedMessage id='server_banner.introduction' defaultMessage='{domain} is part of the decentralized social network powered by {mastodon}.' values={{ title: <strong>{title}</strong>, WhippyEdition: <a href='https://whippy.postype.com/' target='_blank'>휘핑 에디션</a> }} />
</div>
<ServerHeroImage blurhash={server.getIn(['thumbnail', 'blurhash'])} src={server.getIn(['thumbnail', 'url'])} className='server-banner__hero' />

View File

@ -121,7 +121,7 @@ class About extends PureComponent {
<div className='about__header'>
<ServerHeroImage blurhash={server.getIn(['thumbnail', 'blurhash'])} src={server.getIn(['thumbnail', 'url'])} srcSet={server.getIn(['thumbnail', 'versions'])?.map((value, key) => `${value} ${key.replace('@', '')}`).join(', ')} className='about__header__hero' />
<h1>{isLoading ? <Skeleton width='10ch' /> : server.get('title')}</h1>
<p><FormattedMessage id='about.powered_by' defaultMessage='Decentralized social media powered by {mastodon}' values={{ mastodon: <a href='https://joinmastodon.org' className='about__mail' target='_blank'>Mastodon</a> }} /></p>
<p><FormattedMessage id='about.powered_by' defaultMessage='Decentralized social media powered by {mastodon}' values={{ WhippyEdition: <a href='https://whippy.postype.com' className='about__mail' target='_blank'>휘핑 에디션</a> }} /></p>
</div>
<div className='about__meta'>

View File

@ -47,6 +47,7 @@ const messages = defineMessages({
enableNotifications: { id: 'account.enable_notifications', defaultMessage: 'Notify me when @{name} posts' },
disableNotifications: { id: 'account.disable_notifications', defaultMessage: 'Stop notifying me when @{name} posts' },
pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned posts' },
directMessages: { id: 'navigation_bar.directMessages', defaultMessage: 'Direct Messages' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' },
@ -302,6 +303,7 @@ class Header extends ImmutablePureComponent {
menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });
menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });
menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });
menu.push({ text: intl.formatMessage(messages.directMessages), to: '/direct_messages' });
menu.push(null);
menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });
menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });

View File

@ -10,6 +10,7 @@ import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
const messages = defineMessages({
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned posts' },
directMessages: { id: 'navigation_bar.directMessages', defaultMessage: 'Direct Messages' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' },
@ -43,6 +44,7 @@ class ActionBar extends PureComponent {
menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });
menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });
menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });
menu.push({ text: intl.formatMessage(messages.directMessages), to: '/direct_messages' });
menu.push(null);
menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });
menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });

View File

@ -0,0 +1,70 @@
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
import { getStatusList } from 'mastodon/selectors';
import { fetchDirectStatuses } from '../../actions/direct_statuses';
import ColumnBackButtonSlim from '../../components/column_back_button_slim';
import StatusList from '../../components/status_list';
import Column from '../ui/components/column';
const messages = defineMessages({
heading: { id: 'column.pins', defaultMessage: 'Pinned post' },
});
const mapStateToProps = state => ({
statusIds: getStatusList(state, 'direct'),
hasMore: !!state.getIn(['status_lists', 'direct', 'next']),
});
class PinnedStatuses extends ImmutablePureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
statusIds: ImmutablePropTypes.list.isRequired,
intl: PropTypes.object.isRequired,
hasMore: PropTypes.bool.isRequired,
multiColumn: PropTypes.bool,
};
UNSAFE_componentWillMount () {
this.props.dispatch(fetchDirectStatuses());
}
handleHeaderClick = () => {
this.column.scrollTop();
};
setRef = c => {
this.column = c;
};
render () {
const { intl, statusIds, hasMore, multiColumn } = this.props;
return (
<Column bindToDocument={!multiColumn} icon='thumb-tack' heading={intl.formatMessage(messages.heading)} ref={this.setRef}>
<ColumnBackButtonSlim />
<StatusList
statusIds={statusIds}
scrollKey='pinned_statuses'
hasMore={hasMore}
bindToDocument={!multiColumn}
/>
<Helmet>
<meta name='robots' content='noindex' />
</Helmet>
</Column>
);
}
}
export default connect(mapStateToProps)(injectIntl(PinnedStatuses));

View File

@ -55,8 +55,6 @@ class Explore extends PureComponent {
const { signedIn } = this.context.identity;
return (
signedIn && (
<Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}>
<ColumnHeader
icon={isSearching ? 'search' : 'hashtag'}
@ -108,7 +106,7 @@ class Explore extends PureComponent {
</Helmet>
</>
)}
</Column> )
</Column>
);
}

View File

@ -62,6 +62,7 @@ import {
Onboarding,
About,
PrivacyPolicy,
SendDirectMessagesStatuses
} from './util/async-components';
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
@ -205,6 +206,7 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/bookmarks' component={BookmarkedStatuses} content={children} />
<WrappedRoute path='/pinned' component={PinnedStatuses} content={children} />
<WrappedRoute path='/direct_messages' component={SendDirectMessagesStatuses} content={children} />
<WrappedRoute path='/start' exact component={Onboarding} content={children} />
<WrappedRoute path='/directory' component={Directory} content={children} />

View File

@ -58,6 +58,11 @@ export function PinnedStatuses () {
return import(/* webpackChunkName: "features/pinned_statuses" */'../../pinned_statuses');
}
export function SendDirectMessagesStatuses () {
return import(/* webpackChunkName: "features/pinned_statuses" */'../../direct_messages');
}
export function AccountTimeline () {
return import(/* webpackChunkName: "features/account_timeline" */'../../account_timeline');
}

View File

@ -120,6 +120,7 @@
"column.lists": "Lists",
"column.mutes": "Muted users",
"column.notifications": "Notifications",
"column.direct_message": "Direct Messages",
"column.pins": "Pinned posts",
"column.public": "Federated timeline",
"column_back_button.label": "Back",
@ -418,6 +419,7 @@
"navigation_bar.opened_in_classic_interface": "Posts, accounts, and other specific pages are opened by default in the classic web interface.",
"navigation_bar.personal": "Personal",
"navigation_bar.pins": "Pinned posts",
"navigation_bar.directMessages": "Dm posts",
"navigation_bar.preferences": "Preferences",
"navigation_bar.public_timeline": "Federated timeline",
"navigation_bar.search": "Search",

View File

@ -9,7 +9,7 @@
"about.domain_blocks.suspended.explanation": "이 서버의 어떤 데이터도 처리되거나, 저장 되거나 공유되지 않고, 이 서버의 어떤 유저와도 상호작용 하거나 대화할 수 없습니다.",
"about.domain_blocks.suspended.title": "정지됨",
"about.not_available": "이 정보는 이 서버에서 사용할 수 없습니다.",
"about.powered_by": "{mastodon}으로 구동되는 전용 오리지널 캐릭터 커뮤니티",
"about.powered_by": "{WhippyEdition}으로 구동되는 마스토돈 인스턴스",
"about.rules": "서버 규칙",
"account.account_note_header": "노트",
"account.add_or_remove_from_list": "리스트에 추가 혹은 삭제",
@ -121,6 +121,7 @@
"column.mutes": "뮤트한 사용자",
"column.notifications": "알림",
"column.pins": "고정된 게시물",
"column.direct_message": "보낸 다이렉트 메시지",
"column.public": "연합 타임라인",
"column_back_button.label": "돌아가기",
"column_header.hide_settings": "설정 숨기기",
@ -418,6 +419,7 @@
"navigation_bar.opened_in_classic_interface": "게시물, 계정, 기타 특정 페이지들은 기본적으로 기존 웹 인터페이스로 열리게 됩니다.",
"navigation_bar.personal": "개인용",
"navigation_bar.pins": "고정된 게시물",
"navigation_bar.directMessages": "보낸 다이렉트 메시지",
"navigation_bar.preferences": "환경설정",
"navigation_bar.public_timeline": "연합 타임라인",
"navigation_bar.search": "검색",
@ -608,7 +610,7 @@
"server_banner.about_active_users": "30일 동안 이 서버를 사용한 사람들 (월간 활성 이용자)",
"server_banner.active_users": "활성 사용자",
"server_banner.administered_by": "관리자:",
"server_banner.introduction": "마스토돈을 기반으로 운영되는 오리지널 캐릭터 커뮤니티 전용 인스턴스입니다.",
"server_banner.introduction": "{title}은 {WhippyEdition}으로 운영되는 마스토돈 인스턴스입니다.",
"server_banner.learn_more": "더 알아보기",
"server_banner.server_stats": "서버 통계:",
"sign_in_banner.create_account": "계정 생성",

View File

@ -31,6 +31,9 @@ import {
import {
PINNED_STATUSES_FETCH_SUCCESS,
} from '../actions/pin_statuses';
import {
DIRECT_STATUSES_FETCH_SUCCESS,
} from '../actions/direct_statuses';
import {
TRENDS_STATUSES_FETCH_REQUEST,
TRENDS_STATUSES_FETCH_SUCCESS,
@ -58,6 +61,11 @@ const initialState = ImmutableMap({
loaded: false,
items: ImmutableOrderedSet(),
}),
direct: ImmutableMap({
next: null,
loaded: false,
items: ImmutableOrderedSet(),
}),
trending: ImmutableMap({
next: null,
loaded: false,
@ -138,6 +146,8 @@ export default function statusLists(state = initialState, action) {
return removeOneFromList(state, 'bookmarks', action.status);
case PINNED_STATUSES_FETCH_SUCCESS:
return normalizeList(state, 'pins', action.statuses, action.next);
case DIRECT_STATUSES_FETCH_SUCCESS:
return normalizeList(state, 'direct', action.statuses, action.next);
case PIN_SUCCESS:
return prependOneToList(state, 'pins', action.status);
case UNPIN_SUCCESS:

View File

@ -1701,8 +1701,8 @@ ko:
does_not_match_previous_name: 이전 이름과 맞지 않습니다
themes:
contrast: 마스토돈 (고대비)
default: 23.4 ~Ad Astra~ 테마 (비일상)
mastodon-bird-ui-light: 23.4 ~Ad Astra~ 테마 (일상)
default: 휘핑 에디션 테마 (어두움)
mastodon-bird-ui-light: 휘핑 에디션 테마 (밝음)
mastodon-light: 마스토돈 (밝음)
mastodon-dark: 마스토돈 (어두움)
mastodon-bird-ui-light-vanilla: 파란새풍 테마 (밝음)

View File

@ -22,6 +22,7 @@ Rails.application.routes.draw do
/search
/publish
/follow_requests
/direct_messages
/blocks
/domain_blocks
/mutes

View File

@ -2,23 +2,23 @@
# important settings can be changed from the admin interface.
defaults: &defaults
site_title: Mastodon Whippy Edition
site_title: Whippy Edition
site_short_description: ''
site_description: ''
site_extended_description: ''
site_terms: ''
site_contact_username: ''
site_contact_email: ''
site_contact_email: 'whippyshou@gmail.com'
registrations_mode: 'open'
profile_directory: true
closed_registrations_message: ''
timeline_preview: true
timeline_preview: false
show_staff_badge: true
preview_sensitive_media: false
noindex: false
noindex: true
theme: 'default'
trends: true
trends_as_landing_page: true
trends: false
trends_as_landing_page: false
trendable_by_default: false
reserved_usernames:
- admin