Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka 2018-11-13 16:28:07 +01:00
commit bfe2b9cc50
11 changed files with 85 additions and 26 deletions

View file

@ -115,7 +115,7 @@ group :test do
gem 'rspec-sidekiq', '~> 3.0' gem 'rspec-sidekiq', '~> 3.0'
gem 'simplecov', '~> 0.16', require: false gem 'simplecov', '~> 0.16', require: false
gem 'webmock', '~> 3.4' gem 'webmock', '~> 3.4'
gem 'parallel_tests', '~> 2.26' gem 'parallel_tests', '~> 2.27'
end end
group :development do group :development do
@ -123,7 +123,7 @@ group :development do
gem 'annotate', '~> 2.7' gem 'annotate', '~> 2.7'
gem 'better_errors', '~> 2.5' gem 'better_errors', '~> 2.5'
gem 'binding_of_caller', '~> 0.7' gem 'binding_of_caller', '~> 0.7'
gem 'bullet', '~> 5.8' gem 'bullet', '~> 5.9'
gem 'letter_opener', '~> 1.4' gem 'letter_opener', '~> 1.4'
gem 'letter_opener_web', '~> 1.3' gem 'letter_opener_web', '~> 1.3'
gem 'memory_profiler' gem 'memory_profiler'

View file

@ -103,7 +103,7 @@ GEM
brakeman (4.3.1) brakeman (4.3.1)
browser (2.5.3) browser (2.5.3)
builder (3.2.3) builder (3.2.3)
bullet (5.8.1) bullet (5.9.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
uniform_notifier (~> 1.11) uniform_notifier (~> 1.11)
bundler-audit (0.6.0) bundler-audit (0.6.0)
@ -361,7 +361,7 @@ GEM
concurrent-ruby (~> 1.0.0) concurrent-ruby (~> 1.0.0)
sidekiq (>= 3.5.0) sidekiq (>= 3.5.0)
statsd-ruby (~> 1.2.0) statsd-ruby (~> 1.2.0)
oj (3.7.0) oj (3.7.1)
omniauth (1.8.1) omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0) hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
@ -388,7 +388,7 @@ GEM
av (~> 0.9.0) av (~> 0.9.0)
paperclip (>= 2.5.2) paperclip (>= 2.5.2)
parallel (1.12.1) parallel (1.12.1)
parallel_tests (2.26.2) parallel_tests (2.27.0)
parallel parallel
parser (2.5.3.0) parser (2.5.3.0)
ast (~> 2.4.0) ast (~> 2.4.0)
@ -596,7 +596,7 @@ GEM
unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (~> 1.1, >= 1.1.1)
terrapin (0.6.0) terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0) climate_control (>= 0.0.3, < 1.0)
thor (0.20.0) thor (0.20.3)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.8) tilt (2.0.8)
timers (4.2.0) timers (4.2.0)
@ -660,7 +660,7 @@ DEPENDENCIES
bootsnap (~> 1.3) bootsnap (~> 1.3)
brakeman (~> 4.3) brakeman (~> 4.3)
browser browser
bullet (~> 5.8) bullet (~> 5.9)
bundler-audit (~> 0.6) bundler-audit (~> 0.6)
capistrano (~> 3.11) capistrano (~> 3.11)
capistrano-rails (~> 1.4) capistrano-rails (~> 1.4)
@ -718,7 +718,7 @@ DEPENDENCIES
ox (~> 2.10) ox (~> 2.10)
paperclip (~> 6.0) paperclip (~> 6.0)
paperclip-av-transcoder (~> 0.6) paperclip-av-transcoder (~> 0.6)
parallel_tests (~> 2.26) parallel_tests (~> 2.27)
pg (~> 1.1) pg (~> 1.1)
pghero (~> 2.2) pghero (~> 2.2)
pkg-config (~> 1.3) pkg-config (~> 1.3)

View file

@ -136,7 +136,7 @@ export default class ScrollableList extends PureComponent {
React.Children.count(prevProps.children) < React.Children.count(this.props.children) && React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props); this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
if ((someItemInserted && this.node.scrollTop > 0) || this.mouseMovedRecently) { if (someItemInserted && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {
return this.node.scrollHeight - this.node.scrollTop; return this.node.scrollHeight - this.node.scrollTop;
} else { } else {
return null; return null;

View file

@ -73,7 +73,7 @@ export default class Card extends React.PureComponent {
}; };
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (this.props.card !== nextProps.card) { if (!Immutable.is(this.props.card, nextProps.card)) {
this.setState({ embedded: false }); this.setState({ embedded: false });
} }
} }

View file

@ -349,6 +349,10 @@
{ {
"defaultMessage": "{name} boosted", "defaultMessage": "{name} boosted",
"id": "status.reblogged_by" "id": "status.reblogged_by"
},
{
"defaultMessage": "Show thread",
"id": "status.show_thread"
} }
], ],
"path": "app/javascript/mastodon/components/status.json" "path": "app/javascript/mastodon/components/status.json"
@ -471,6 +475,15 @@
], ],
"path": "app/javascript/mastodon/features/account_timeline/containers/header_container.json" "path": "app/javascript/mastodon/features/account_timeline/containers/header_container.json"
}, },
{
"descriptors": [
{
"defaultMessage": "No toots here!",
"id": "empty_column.account_timeline"
}
],
"path": "app/javascript/mastodon/features/account_timeline/index.json"
},
{ {
"descriptors": [ "descriptors": [
{ {
@ -578,6 +591,7 @@
"id": "account.unendorse" "id": "account.unendorse"
}, },
{ {
"defaultMessage": "Add or Remove from lists",
"id": "account.add_or_remove_from_list" "id": "account.add_or_remove_from_list"
}, },
{ {
@ -1277,6 +1291,39 @@
}, },
{ {
"descriptors": [ "descriptors": [
{
"defaultMessage": "Any of these",
"id": "hashtag.column_settings.tag_mode.any"
},
{
"defaultMessage": "All of these",
"id": "hashtag.column_settings.tag_mode.all"
},
{
"defaultMessage": "None of these",
"id": "hashtag.column_settings.tag_mode.none"
},
{
"defaultMessage": "Include additional tags in this column",
"id": "hashtag.column_settings.tag_toggle"
}
],
"path": "app/javascript/mastodon/features/hashtag_timeline/components/column_settings.json"
},
{
"descriptors": [
{
"defaultMessage": "or {additional}",
"id": "hashtag.column_header.tag_mode.any"
},
{
"defaultMessage": "and {additional}",
"id": "hashtag.column_header.tag_mode.all"
},
{
"defaultMessage": "without {additional}",
"id": "hashtag.column_header.tag_mode.none"
},
{ {
"defaultMessage": "There is nothing in this hashtag yet.", "defaultMessage": "There is nothing in this hashtag yet.",
"id": "empty_column.hashtag" "id": "empty_column.hashtag"

View file

@ -116,6 +116,7 @@
"emoji_button.search_results": "Search results", "emoji_button.search_results": "Search results",
"emoji_button.symbols": "Symbols", "emoji_button.symbols": "Symbols",
"emoji_button.travel": "Travel & Places", "emoji_button.travel": "Travel & Places",
"empty_column.account_timeline": "No toots here!",
"empty_column.blocks": "You haven't blocked any users yet.", "empty_column.blocks": "You haven't blocked any users yet.",
"empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!", "empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!",
"empty_column.direct": "You don't have any direct messages yet. When you send or receive one, it will show up here.", "empty_column.direct": "You don't have any direct messages yet. When you send or receive one, it will show up here.",
@ -141,13 +142,13 @@
"getting_started.open_source_notice": "Mastodon is open source software. You can contribute or report issues on GitHub at {github}.", "getting_started.open_source_notice": "Mastodon is open source software. You can contribute or report issues on GitHub at {github}.",
"getting_started.security": "Security", "getting_started.security": "Security",
"getting_started.terms": "Terms of service", "getting_started.terms": "Terms of service",
"hashtag.column_settings.tag_toggle": "Include additional tags for this column",
"hashtag.column_settings.tag_mode.any": "Any of these",
"hashtag.column_settings.tag_mode.all": "All of these",
"hashtag.column_settings.tag_mode.none": "None of these",
"hashtag.column_header.tag_mode.any": "{tag} or {additional}",
"hashtag.column_header.tag_mode.all": "{tag} and {additional}", "hashtag.column_header.tag_mode.all": "{tag} and {additional}",
"hashtag.column_header.tag_mode.any": "{tag} or {additional}",
"hashtag.column_header.tag_mode.none": "{tag} without {additional}", "hashtag.column_header.tag_mode.none": "{tag} without {additional}",
"hashtag.column_settings.tag_mode.all": "All of these",
"hashtag.column_settings.tag_mode.any": "Any of these",
"hashtag.column_settings.tag_mode.none": "None of these",
"hashtag.column_settings.tag_toggle": "Include additional tags for this column",
"home.column_settings.basic": "Basic", "home.column_settings.basic": "Basic",
"home.column_settings.show_reblogs": "Show boosts", "home.column_settings.show_reblogs": "Show boosts",
"home.column_settings.show_replies": "Show replies", "home.column_settings.show_replies": "Show replies",
@ -325,6 +326,7 @@
"status.show_less_all": "Show less for all", "status.show_less_all": "Show less for all",
"status.show_more": "Show more", "status.show_more": "Show more",
"status.show_more_all": "Show more for all", "status.show_more_all": "Show more for all",
"status.show_thread": "Show thread",
"status.unmute_conversation": "Unmute conversation", "status.unmute_conversation": "Unmute conversation",
"status.unpin": "Unpin from profile", "status.unpin": "Unpin from profile",
"suggestions.dismiss": "Dismiss suggestion", "suggestions.dismiss": "Dismiss suggestion",

View file

@ -1,5 +1,5 @@
{ {
"account.add_or_remove_from_list": "Add or Remove from lists", "account.add_or_remove_from_list": "リストに追加または外す",
"account.badges.bot": "Bot", "account.badges.bot": "Bot",
"account.block": "@{name}さんをブロック", "account.block": "@{name}さんをブロック",
"account.block_domain": "{domain}全体を非表示", "account.block_domain": "{domain}全体を非表示",
@ -116,6 +116,7 @@
"emoji_button.search_results": "検索結果", "emoji_button.search_results": "検索結果",
"emoji_button.symbols": "記号", "emoji_button.symbols": "記号",
"emoji_button.travel": "旅行と場所", "emoji_button.travel": "旅行と場所",
"empty_column.account_timeline": "トゥートがありません!",
"empty_column.blocks": "まだ誰もブロックしていません。", "empty_column.blocks": "まだ誰もブロックしていません。",
"empty_column.community": "ローカルタイムラインはまだ使われていません。何か書いてみましょう!", "empty_column.community": "ローカルタイムラインはまだ使われていません。何か書いてみましょう!",
"empty_column.direct": "ダイレクトメッセージはまだありません。ダイレクトメッセージをやりとりすると、ここに表示されます。", "empty_column.direct": "ダイレクトメッセージはまだありません。ダイレクトメッセージをやりとりすると、ここに表示されます。",
@ -141,6 +142,13 @@
"getting_started.open_source_notice": "Mastodonはオープンソースソフトウェアです。誰でもGitHub{github})から開発に参加したり、問題を報告したりできます。", "getting_started.open_source_notice": "Mastodonはオープンソースソフトウェアです。誰でもGitHub{github})から開発に参加したり、問題を報告したりできます。",
"getting_started.security": "セキュリティ", "getting_started.security": "セキュリティ",
"getting_started.terms": "プライバシーポリシー", "getting_started.terms": "プライバシーポリシー",
"hashtag.column_header.tag_mode.all": " と {additional}",
"hashtag.column_header.tag_mode.any": " か {additional}",
"hashtag.column_header.tag_mode.none": " ({additional} を除く)",
"hashtag.column_settings.tag_mode.all": "すべてを含む",
"hashtag.column_settings.tag_mode.any": "いずれかを含む",
"hashtag.column_settings.tag_mode.none": "これらを除く",
"hashtag.column_settings.tag_toggle": "このカラムに追加のタグを含める",
"home.column_settings.basic": "基本設定", "home.column_settings.basic": "基本設定",
"home.column_settings.show_reblogs": "ブースト表示", "home.column_settings.show_reblogs": "ブースト表示",
"home.column_settings.show_replies": "返信表示", "home.column_settings.show_replies": "返信表示",
@ -318,10 +326,11 @@
"status.show_less_all": "全て隠す", "status.show_less_all": "全て隠す",
"status.show_more": "もっと見る", "status.show_more": "もっと見る",
"status.show_more_all": "全て見る", "status.show_more_all": "全て見る",
"status.show_thread": "続きを読む",
"status.unmute_conversation": "会話のミュートを解除", "status.unmute_conversation": "会話のミュートを解除",
"status.unpin": "プロフィールの固定表示を解除", "status.unpin": "プロフィールの固定表示を解除",
"suggestions.dismiss": "Dismiss suggestion", "suggestions.dismiss": "隠す",
"suggestions.header": "You might be interested in…", "suggestions.header": "興味あるかもしれません…",
"tabs_bar.federated_timeline": "連合", "tabs_bar.federated_timeline": "連合",
"tabs_bar.home": "ホーム", "tabs_bar.home": "ホーム",
"tabs_bar.local_timeline": "ローカル", "tabs_bar.local_timeline": "ローカル",

View file

@ -38,11 +38,11 @@ export default function statuses(state = initialState, action) {
case FAVOURITE_REQUEST: case FAVOURITE_REQUEST:
return state.setIn([action.status.get('id'), 'favourited'], true); return state.setIn([action.status.get('id'), 'favourited'], true);
case FAVOURITE_FAIL: case FAVOURITE_FAIL:
return state.setIn([action.status.get('id'), 'favourited'], false); return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false);
case REBLOG_REQUEST: case REBLOG_REQUEST:
return state.setIn([action.status.get('id'), 'reblogged'], true); return state.setIn([action.status.get('id'), 'reblogged'], true);
case REBLOG_FAIL: case REBLOG_FAIL:
return state.setIn([action.status.get('id'), 'reblogged'], false); return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'reblogged'], false);
case STATUS_MUTE_SUCCESS: case STATUS_MUTE_SUCCESS:
return state.setIn([action.id, 'muted'], true); return state.setIn([action.id, 'muted'], true);
case STATUS_UNMUTE_SUCCESS: case STATUS_UNMUTE_SUCCESS:

View file

@ -177,7 +177,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
updated = tag['updated'] updated = tag['updated']
emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain)
return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && emoji.updated_at >= updated) return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && updated >= emoji.updated_at)
emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri) emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri)
emoji.image_remote_url = image_url emoji.image_remote_url = image_url

View file

@ -232,7 +232,7 @@ class ActivityPub::ProcessAccountService < BaseService
updated = tag['updated'] updated = tag['updated']
emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain)
return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && emoji.updated_at >= updated) return unless emoji.nil? || image_url != emoji.image_remote_url || (updated && updated >= emoji.updated_at)
emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri) emoji ||= CustomEmoji.new(domain: @account.domain, shortcode: shortcode, uri: uri)
emoji.image_remote_url = image_url emoji.image_remote_url = image_url

View file

@ -138,12 +138,13 @@ class FetchLinkCardService < BaseService
guess = detector.detect(@html, @html_charset) guess = detector.detect(@html, @html_charset)
page = Nokogiri::HTML(@html, nil, guess&.fetch(:encoding, nil)) page = Nokogiri::HTML(@html, nil, guess&.fetch(:encoding, nil))
player_url = meta_property(page, 'twitter:player')
if meta_property(page, 'twitter:player') if player_url && !bad_url?(Addressable::URI.parse(player_url))
@card.type = :video @card.type = :video
@card.width = meta_property(page, 'twitter:player:width') || 0 @card.width = meta_property(page, 'twitter:player:width') || 0
@card.height = meta_property(page, 'twitter:player:height') || 0 @card.height = meta_property(page, 'twitter:player:height') || 0
@card.html = content_tag(:iframe, nil, src: meta_property(page, 'twitter:player'), @card.html = content_tag(:iframe, nil, src: player_url,
width: @card.width, width: @card.width,
height: @card.height, height: @card.height,
allowtransparency: 'true', allowtransparency: 'true',