Skip to content

Commit

Permalink
merge from v1.4-rc2
Browse files Browse the repository at this point in the history
* merge from v1.4-rc2
* merge Add a Japanese translation for PR mastodon#3175 (mastodon#3192)
* merge Fix mutes_controller error and incorrect statuses_controller report (mastodon#3202)
* merge Union timeline feature
  • Loading branch information
pso2club committed May 21, 2017
1 parent b448c8c commit 5e0c729
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/controllers/api/v1/mutes_controller.rb
Expand Up @@ -7,14 +7,14 @@ class Api::V1::MutesController < ApiController
respond_to :json

def index
@accounts = Account.includes(:muting)
.references(:muting)
@accounts = Account.includes(:muted_by)
.references(:muted_by)
.merge(Mute.where(account: current_account)
.paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
.to_a

next_path = api_v1_mutes_url(pagination_params(max_id: @accounts.last.mutings_accounts.last.id)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
prev_path = api_v1_mutes_url(pagination_params(since_id: @accounts.first.mutings_accounts.first.id)) unless @accounts.empty?
next_path = api_v1_mutes_url(pagination_params(max_id: @accounts.last.muted_by_ids.last)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
prev_path = api_v1_mutes_url(pagination_params(since_id: @accounts.first.muted_by_ids.first)) unless @accounts.empty?

set_pagination_headers(next_path, prev_path)
end
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/api/v1/statuses_controller.rb
Expand Up @@ -47,14 +47,14 @@ def reblogged_by
end

def favourited_by
@accounts = Account.includes(statuses: :favourites)
.references(statuses: :favourites)
.where(statuses: { id: @status.id })
.merge(@status.favourites.paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
@accounts = Account.includes(:favourites)
.references(:favourites)
.where(favourites: { status_id: @status.id })
.merge(Favourite.paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
.to_a

next_path = favourited_by_api_v1_status_url(pagination_params(max_id: @accounts.last.statuses.last.favourites.last.id)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
prev_path = favourited_by_api_v1_status_url(pagination_params(since_id: @accounts.first.statuses.first.favourites.first.id)) unless @accounts.empty?
next_path = favourited_by_api_v1_status_url(pagination_params(max_id: @accounts.last.favourites.last.id)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
prev_path = favourited_by_api_v1_status_url(pagination_params(since_id: @accounts.first.favourites.first.id)) unless @accounts.empty?

set_pagination_headers(next_path, prev_path)

Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/features/getting_started/index.js
Expand Up @@ -15,6 +15,7 @@ const messages = defineMessages({
navigation_subheading: { id: 'column_subheading.navigation', defaultMessage: 'Navigation'},
settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings'},
community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
union_timeline: { id: 'navigation_bar.union_timeline', defaultMessage: 'Union timeline' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
Expand Down Expand Up @@ -49,6 +50,7 @@ class GettingStarted extends ImmutablePureComponent {
<div className='getting-started__wrapper'>
<ColumnSubheading text={intl.formatMessage(messages.navigation_subheading)}/>
<ColumnLink icon='users' hideOnMobile={true} text={intl.formatMessage(messages.community_timeline)} to='/timelines/public/local' />
<ColumnLink icon='production-hunt' hideOnMobile={true} text={intl.formatMessage(messages.union_timeline)} to='/timelines/public/union' />
<ColumnLink icon='globe' hideOnMobile={true} text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
<ColumnLink icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />
{followRequests}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/features/public_timeline/index.js
Expand Up @@ -86,7 +86,7 @@ class PublicTimeline extends React.PureComponent {
return (
<Column icon='globe' active={hasUnread} heading={intl.formatMessage(messages.title)}>
<ColumnBackButtonSlim />
<StatusListContainer {...this.props} type='public' scrollKey='public_timeline' emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other instances to fill it up' />} />
<StatusListContainer {...this.props} type='public' scrollKey='public_timeline' emptyMessage={<FormattedMessage id='empty_column.union' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other union instances to fill it up'' />} />
</Column>
);
}
Expand Down
2 changes: 2 additions & 0 deletions app/models/concerns/account_interactions.rb
Expand Up @@ -50,6 +50,8 @@ def domain_blocking_map(target_account_ids, account_id)
# Mute relationships
has_many :mute_relationships, class_name: 'Mute', foreign_key: 'account_id', dependent: :destroy
has_many :muting, -> { order('mutes.id desc') }, through: :mute_relationships, source: :target_account
has_many :muted_by_relationships, class_name: 'Mute', foreign_key: :target_account_id, dependent: :destroy
has_many :muted_by, -> { order('mutes.id desc') }, through: :muted_by_relationships, source: :account
has_many :conversation_mutes, dependent: :destroy
has_many :domain_blocks, class_name: 'AccountDomainBlock', dependent: :destroy
end
Expand Down
3 changes: 3 additions & 0 deletions config/locales/simple_form.ja.yml
Expand Up @@ -12,6 +12,8 @@ ja:
data: 他の Mastodon インスタンスからエクスポートしたCSVファイルを選択して下さい
sessions:
otp: 携帯電話に表示された2段階認証コードを入力するか、生成したリカバリーコードを使用してください。
user:
filtered_languages: 選択した言語があなたの公開タイムラインから取り除かれます。
labels:
defaults:
avatar: アイコン
Expand All @@ -21,6 +23,7 @@ ja:
data: データ
display_name: 表示名
email: メールアドレス
filtered_languages: 除外する言語
header: ヘッダー
locale: 言語
locked: 非公開アカウントにする
Expand Down
1 change: 0 additions & 1 deletion streaming/index.js
Expand Up @@ -357,7 +357,6 @@ if (cluster.isMaster) {
streamFrom('timeline:public:union', req, streamToHttp(req, res), streamHttpEnd(req), true);
});


app.get('/api/v1/streaming/hashtag', (req, res) => {
streamFrom(`timeline:hashtag:${req.query.tag}`, req, streamToHttp(req, res), streamHttpEnd(req), true);
});
Expand Down

0 comments on commit 5e0c729

Please sign in to comment.