Permalink
Browse files

Merge remote-tracking branch 'tootsuite/master' into hota/master

  • Loading branch information...
lindwurm committed Nov 14, 2018
2 parents 134bd92 + c875f19 commit 5e5a9adc46d748f4fd9be104480ba8f086f4d77d
Showing with 1,322 additions and 193 deletions.
  1. +2 −2 Gemfile
  2. +24 −26 Gemfile.lock
  3. +1 −1 app/controllers/api/v1/accounts_controller.rb
  4. +1 −1 app/controllers/api/v1/timelines/tag_controller.rb
  5. +6 −1 app/controllers/concerns/signature_verification.rb
  6. +4 −3 app/controllers/tags_controller.rb
  7. +14 −4 app/javascript/mastodon/actions/accounts.js
  8. +3 −0 app/javascript/mastodon/actions/custom_emojis.js
  9. +3 −0 app/javascript/mastodon/actions/favourites.js
  10. +54 −0 app/javascript/mastodon/actions/lists.js
  11. +10 −6 app/javascript/mastodon/actions/notifications.js
  12. +3 −3 app/javascript/mastodon/actions/streaming.js
  13. +35 −10 app/javascript/mastodon/actions/timelines.js
  14. +87 −11 app/javascript/mastodon/components/scrollable_list.js
  15. +8 −1 app/javascript/mastodon/components/status.js
  16. +1 −4 app/javascript/mastodon/components/status_action_bar.js
  17. +4 −2 app/javascript/mastodon/components/status_list.js
  18. +3 −0 app/javascript/mastodon/features/account/components/action_bar.js
  19. +6 −0 app/javascript/mastodon/features/account_timeline/components/header.js
  20. +6 −0 app/javascript/mastodon/features/account_timeline/containers/header_container.js
  21. +3 −0 app/javascript/mastodon/features/account_timeline/index.js
  22. +102 −0 app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js
  23. +31 −0 app/javascript/mastodon/features/hashtag_timeline/containers/column_settings_container.js
  24. +56 −16 app/javascript/mastodon/features/hashtag_timeline/index.js
  25. +43 −0 app/javascript/mastodon/features/list_adder/components/account.js
  26. +68 −0 app/javascript/mastodon/features/list_adder/components/list.js
  27. +73 −0 app/javascript/mastodon/features/list_adder/index.js
  28. +1 −0 app/javascript/mastodon/features/notifications/index.js
  29. +1 −1 app/javascript/mastodon/features/standalone/hashtag_timeline/index.js
  30. +1 −1 app/javascript/mastodon/features/status/components/action_bar.js
  31. +1 −1 app/javascript/mastodon/features/status/components/card.js
  32. +2 −0 app/javascript/mastodon/features/ui/components/modal_root.js
  33. +4 −0 app/javascript/mastodon/features/ui/util/async-components.js
  34. +1 −0 app/javascript/mastodon/locales/ar.json
  35. +1 −0 app/javascript/mastodon/locales/ast.json
  36. +1 −0 app/javascript/mastodon/locales/bg.json
  37. +1 −0 app/javascript/mastodon/locales/ca.json
  38. +1 −0 app/javascript/mastodon/locales/co.json
  39. +1 −0 app/javascript/mastodon/locales/cs.json
  40. +1 −0 app/javascript/mastodon/locales/cy.json
  41. +1 −0 app/javascript/mastodon/locales/da.json
  42. +1 −0 app/javascript/mastodon/locales/de.json
  43. +63 −0 app/javascript/mastodon/locales/defaultMessages.json
  44. +1 −0 app/javascript/mastodon/locales/el.json
  45. +10 −0 app/javascript/mastodon/locales/en.json
  46. +1 −0 app/javascript/mastodon/locales/eo.json
  47. +1 −0 app/javascript/mastodon/locales/es.json
  48. +1 −0 app/javascript/mastodon/locales/eu.json
  49. +1 −0 app/javascript/mastodon/locales/fa.json
  50. +1 −0 app/javascript/mastodon/locales/fi.json
  51. +1 −0 app/javascript/mastodon/locales/fr.json
  52. +1 −0 app/javascript/mastodon/locales/gl.json
  53. +1 −0 app/javascript/mastodon/locales/he.json
  54. +1 −0 app/javascript/mastodon/locales/hr.json
  55. +1 −0 app/javascript/mastodon/locales/hu.json
  56. +1 −0 app/javascript/mastodon/locales/hy.json
  57. +1 −0 app/javascript/mastodon/locales/id.json
  58. +1 −0 app/javascript/mastodon/locales/io.json
  59. +1 −0 app/javascript/mastodon/locales/it.json
  60. +12 −2 app/javascript/mastodon/locales/ja.json
  61. +1 −0 app/javascript/mastodon/locales/ka.json
  62. +1 −0 app/javascript/mastodon/locales/ko.json
  63. +1 −0 app/javascript/mastodon/locales/nl.json
  64. +1 −0 app/javascript/mastodon/locales/no.json
  65. +1 −0 app/javascript/mastodon/locales/oc.json
  66. +1 −0 app/javascript/mastodon/locales/pl.json
  67. +1 −0 app/javascript/mastodon/locales/pt-BR.json
  68. +1 −0 app/javascript/mastodon/locales/pt.json
  69. +1 −0 app/javascript/mastodon/locales/ro.json
  70. +1 −0 app/javascript/mastodon/locales/ru.json
  71. +1 −0 app/javascript/mastodon/locales/sk.json
  72. +1 −0 app/javascript/mastodon/locales/sl.json
  73. +1 −0 app/javascript/mastodon/locales/sr-Latn.json
  74. +1 −0 app/javascript/mastodon/locales/sr.json
  75. +1 −0 app/javascript/mastodon/locales/sv.json
  76. +1 −0 app/javascript/mastodon/locales/ta.json
  77. +1 −0 app/javascript/mastodon/locales/te.json
  78. +1 −0 app/javascript/mastodon/locales/th.json
  79. +1 −0 app/javascript/mastodon/locales/tr.json
  80. +1 −0 app/javascript/mastodon/locales/uk.json
  81. +1 −0 app/javascript/mastodon/locales/zh-CN.json
  82. +1 −0 app/javascript/mastodon/locales/zh-HK.json
  83. +1 −0 app/javascript/mastodon/locales/zh-TW.json
  84. +7 −1 app/javascript/mastodon/reducers/conversations.js
  85. +2 −0 app/javascript/mastodon/reducers/index.js
  86. +47 −0 app/javascript/mastodon/reducers/list_adder.js
  87. +12 −0 app/javascript/mastodon/reducers/relationships.js
  88. +2 −2 app/javascript/mastodon/reducers/statuses.js
  89. +7 −0 app/javascript/mastodon/reducers/timelines.js
  90. +31 −0 app/javascript/styles/mastodon/_mixins.scss
  91. +73 −28 app/javascript/styles/mastodon/components.scss
  92. +5 −2 app/javascript/styles/mastodon/forms.scss
  93. +1 −2 app/javascript/styles/mastodon/reset.scss
  94. +1 −1 app/lib/activitypub/activity/create.rb
  95. +1 −1 app/lib/request.rb
  96. +11 −0 app/models/status.rb
  97. +1 −1 app/services/activitypub/process_account_service.rb
  98. +1 −1 app/services/concerns/author_extractor.rb
  99. +5 −4 app/services/fetch_link_card_service.rb
  100. +4 −4 app/services/follow_service.rb
  101. +21 −0 app/services/hashtag_query_service.rb
  102. +1 −1 app/services/process_mentions_service.rb
  103. +21 −11 app/services/resolve_account_service.rb
  104. +1 −1 app/services/resolve_url_service.rb
  105. +1 −1 app/validators/follow_limit_validator.rb
  106. +1 −1 app/views/shared/_error_messages.html.haml
  107. +10 −3 app/workers/local_notification_worker.rb
  108. +43 −22 config/brakeman.ignore
  109. +3 −1 config/puma.rb
  110. +9 −4 lib/mastodon/media_cli.rb
  111. +1 −0 package.json
  112. +3 −1 spec/controllers/authorize_interactions_controller_spec.rb
  113. +60 −0 spec/services/hashtag_query_service_spec.rb
  114. +143 −4 yarn.lock
@@ -114,15 +114,15 @@ group :test do
gem 'rspec-sidekiq', '~> 3.0'
gem 'simplecov', '~> 0.16', require: false
gem 'webmock', '~> 3.4'
gem 'parallel_tests', '~> 2.26'
gem 'parallel_tests', '~> 2.27'
end

group :development do
gem 'active_record_query_trace', '~> 1.5'
gem 'annotate', '~> 2.7'
gem 'better_errors', '~> 2.5'
gem 'binding_of_caller', '~> 0.7'
gem 'bullet', '~> 5.7'
gem 'bullet', '~> 5.9'
gem 'letter_opener', '~> 1.4'
gem 'letter_opener_web', '~> 1.3'
gem 'memory_profiler'
@@ -38,7 +38,7 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_model_serializers (0.10.7)
active_model_serializers (0.10.8)
actionpack (>= 4.1, < 6)
activemodel (>= 4.1, < 6)
case_transform (>= 0.2)
@@ -76,16 +76,16 @@ GEM
av (0.9.0)
cocaine (~> 0.5.3)
aws-eventstream (1.0.1)
aws-partitions (1.106.0)
aws-sdk-core (3.35.0)
aws-partitions (1.107.0)
aws-sdk-core (3.36.0)
aws-eventstream (~> 1.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-kms (1.11.0)
aws-sdk-core (~> 3, >= 3.26.0)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.23.0)
aws-sdk-s3 (1.23.1)
aws-sdk-core (~> 3, >= 3.26.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
@@ -103,9 +103,9 @@ GEM
brakeman (4.3.1)
browser (2.5.3)
builder (3.2.3)
bullet (5.7.6)
bullet (5.9.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11.0)
uniform_notifier (~> 1.11)
bundler-audit (0.6.0)
bundler (~> 1.2)
thor (~> 0.18)
@@ -126,7 +126,7 @@ GEM
sshkit (~> 1.3)
capistrano-yarn (2.0.2)
capistrano (~> 3.0)
capybara (3.10.0)
capybara (3.10.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
@@ -254,8 +254,7 @@ GEM
hashie (3.5.7)
heapy (0.1.4)
highline (2.0.0)
hiredis (0.6.1)
hitimes (1.3.0)
hiredis (0.6.3)
hkdf (0.3.0)
htmlentities (4.3.4)
http (3.3.0)
@@ -331,7 +330,7 @@ GEM
mario-redis-lock (1.2.1)
redis (>= 3.0.5)
memory_profiler (0.9.12)
method_source (0.9.0)
method_source (0.9.1)
microformats (4.0.7)
json
nokogiri
@@ -360,7 +359,7 @@ GEM
concurrent-ruby (~> 1.0.0)
sidekiq (>= 3.5.0)
statsd-ruby (~> 1.2.0)
oj (3.7.0)
oj (3.7.1)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
@@ -387,7 +386,7 @@ GEM
av (~> 0.9.0)
paperclip (>= 2.5.2)
parallel (1.12.1)
parallel_tests (2.26.0)
parallel_tests (2.27.0)
parallel
parser (2.5.3.0)
ast (~> 2.4.0)
@@ -397,7 +396,7 @@ GEM
pg (1.1.3)
pghero (2.2.0)
activerecord
pkg-config (1.3.1)
pkg-config (1.3.2)
powerpack (0.1.2)
premailer (1.11.1)
addressable
@@ -407,21 +406,21 @@ GEM
actionmailer (>= 3, < 6)
premailer (~> 1.7, >= 1.7.9)
private_address_check (0.5.0)
pry (0.11.3)
pry (0.12.0)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
pry-rails (0.3.6)
pry-rails (0.3.7)
pry (>= 0.10.4)
public_suffix (3.0.3)
puma (3.12.0)
pundit (2.0.0)
activesupport (>= 3.0.0)
raabro (1.1.6)
rack (2.0.5)
rack-attack (5.4.1)
rack (2.0.6)
rack-attack (5.4.2)
rack (>= 1.0, < 3)
rack-cors (1.0.2)
rack-protection (2.0.4)
@@ -473,7 +472,7 @@ GEM
link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.3.3)
rdf (>= 2.2, < 4.0)
redis (4.0.2)
redis (4.0.3)
redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6)
redis-rack (>= 1, < 3)
@@ -548,7 +547,7 @@ GEM
scss_lint (0.57.1)
rake (>= 0.9, < 13)
sass (~> 3.5, >= 3.5.5)
sidekiq (5.2.2)
sidekiq (5.2.3)
connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
@@ -595,16 +594,15 @@ GEM
unicode-display_width (~> 1.1, >= 1.1.1)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (0.20.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
timers (4.1.2)
hitimes
timers (4.2.0)
tty-color (0.4.3)
tty-command (0.8.2)
pastel (~> 0.7.0)
tty-cursor (0.6.0)
tty-prompt (0.17.1)
tty-prompt (0.17.2)
necromancer (~> 0.4.0)
pastel (~> 0.7.0)
timers (~> 4.0)
@@ -625,7 +623,7 @@ GEM
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
uniform_notifier (1.11.0)
uniform_notifier (1.12.1)
warden (1.2.7)
rack (>= 1.0)
webmock (3.4.2)
@@ -660,7 +658,7 @@ DEPENDENCIES
bootsnap (~> 1.3)
brakeman (~> 4.3)
browser
bullet (~> 5.7)
bullet (~> 5.9)
bundler-audit (~> 0.6)
capistrano (~> 3.11)
capistrano-rails (~> 1.4)
@@ -718,7 +716,7 @@ DEPENDENCIES
ox (~> 2.10)
paperclip (~> 6.0)
paperclip-av-transcoder (~> 0.6)
parallel_tests (~> 2.26)
parallel_tests (~> 2.27)
pg (~> 1.1)
pghero (~> 2.2)
pkg-config (~> 1.3)
@@ -17,7 +17,7 @@ def show
end

def follow
FollowService.new.call(current_user.account, @account.acct, reblogs: truthy_param?(:reblogs))
FollowService.new.call(current_user.account, @account, reblogs: truthy_param?(:reblogs))

options = @account.locked? ? {} : { following_map: { @account.id => { reblogs: truthy_param?(:reblogs) } }, requested_map: { @account.id => false } }

@@ -45,7 +45,7 @@ def tagged_statuses
end

def tag_timeline_statuses
Status.as_tag_timeline(@tag, current_account, truthy_param?(:local))
HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, truthy_param?(:local))
end

def insert_pagination_headers
@@ -43,7 +43,12 @@ def signed_request_account
return
end

account = account_from_key_id(signature_params['keyId'])
account_stoplight = Stoplight("source:#{request.ip}") { account_from_key_id(signature_params['keyId']) }
.with_fallback { nil }
.with_threshold(1)
.with_cool_off_time(5.minutes.seconds)

account = account_stoplight.run

if account.nil?
@signature_verification_failure_reason = "Public key not found for key #{signature_params['keyId']}"
@@ -16,14 +16,15 @@ def show
end

format.rss do
@statuses = Status.as_tag_timeline(@tag).limit(PAGE_SIZE)
@statuses = HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none)).limit(PAGE_SIZE)
@statuses = cache_collection(@statuses, Status)

render xml: RSS::TagSerializer.render(@tag, @statuses)
end

format.json do
@statuses = Status.as_tag_timeline(@tag, current_account, params[:local]).paginate_by_max_id(PAGE_SIZE, params[:max_id])
@statuses = HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, params[:local])
.paginate_by_max_id(PAGE_SIZE, params[:max_id])
@statuses = cache_collection(@statuses, Status)

render json: collection_presenter,
@@ -46,7 +47,7 @@ def set_instance_presenter

def collection_presenter
ActivityPub::CollectionPresenter.new(
id: tag_url(@tag),
id: tag_url(@tag, params.slice(:any, :all, :none)),
type: :ordered,
size: @tag.statuses.count,
items: @statuses.map { |s| ActivityPub::TagManager.instance.uri_for(s) }
@@ -145,12 +145,14 @@ export function fetchAccountFail(id, error) {
export function followAccount(id, reblogs = true) {
return (dispatch, getState) => {
const alreadyFollowing = getState().getIn(['relationships', id, 'following']);
dispatch(followAccountRequest(id));
const locked = getState().getIn(['accounts', id, 'locked'], false);

dispatch(followAccountRequest(id, locked));

api(getState).post(`/api/v1/accounts/${id}/follow`, { reblogs }).then(response => {
dispatch(followAccountSuccess(response.data, alreadyFollowing));
}).catch(error => {
dispatch(followAccountFail(error));
dispatch(followAccountFail(error, locked));
});
};
};
@@ -167,10 +169,12 @@ export function unfollowAccount(id) {
};
};

export function followAccountRequest(id) {
export function followAccountRequest(id, locked) {
return {
type: ACCOUNT_FOLLOW_REQUEST,
id,
locked,
skipLoading: true,
};
};

@@ -179,20 +183,24 @@ export function followAccountSuccess(relationship, alreadyFollowing) {
type: ACCOUNT_FOLLOW_SUCCESS,
relationship,
alreadyFollowing,
skipLoading: true,
};
};

export function followAccountFail(error) {
export function followAccountFail(error, locked) {
return {
type: ACCOUNT_FOLLOW_FAIL,
error,
locked,
skipLoading: true,
};
};

export function unfollowAccountRequest(id) {
return {
type: ACCOUNT_UNFOLLOW_REQUEST,
id,
skipLoading: true,
};
};

@@ -201,13 +209,15 @@ export function unfollowAccountSuccess(relationship, statuses) {
type: ACCOUNT_UNFOLLOW_SUCCESS,
relationship,
statuses,
skipLoading: true,
};
};

export function unfollowAccountFail(error) {
return {
type: ACCOUNT_UNFOLLOW_FAIL,
error,
skipLoading: true,
};
};

@@ -19,19 +19,22 @@ export function fetchCustomEmojis() {
export function fetchCustomEmojisRequest() {
return {
type: CUSTOM_EMOJIS_FETCH_REQUEST,
skipLoading: true,
};
};

export function fetchCustomEmojisSuccess(custom_emojis) {
return {
type: CUSTOM_EMOJIS_FETCH_SUCCESS,
custom_emojis,
skipLoading: true,
};
};

export function fetchCustomEmojisFail(error) {
return {
type: CUSTOM_EMOJIS_FETCH_FAIL,
error,
skipLoading: true,
};
};
@@ -30,6 +30,7 @@ export function fetchFavouritedStatuses() {
export function fetchFavouritedStatusesRequest() {
return {
type: FAVOURITED_STATUSES_FETCH_REQUEST,
skipLoading: true,
};
};

@@ -38,13 +39,15 @@ export function fetchFavouritedStatusesSuccess(statuses, next) {
type: FAVOURITED_STATUSES_FETCH_SUCCESS,
statuses,
next,
skipLoading: true,
};
};

export function fetchFavouritedStatusesFail(error) {
return {
type: FAVOURITED_STATUSES_FETCH_FAIL,
error,
skipLoading: true,
};
};

Oops, something went wrong.

0 comments on commit 5e5a9ad

Please sign in to comment.