Skip to content

Commit

Permalink
Merge branch 'master' into glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Conflicts:
- `package.json`
  • Loading branch information
ClearlyClaire committed Nov 6, 2019
2 parents 00793a8 + 42d9ca2 commit 0ae7d84
Show file tree
Hide file tree
Showing 31 changed files with 492 additions and 312 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ npm-debug.log
yarn-error.log yarn-error.log
yarn-debug.log yarn-debug.log


# Ignore vagrant log files
ubuntu-xenial-16.04-cloudimg-console.log

# Ignore Docker option files # Ignore Docker option files
docker-compose.override.yml docker-compose.override.yml


2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Bug reports and feature suggestions can be submitted to [GitHub Issues](https://


You can submit translations via [Crowdin](https://crowdin.com/project/mastodon). They are periodically merged into the codebase. You can submit translations via [Crowdin](https://crowdin.com/project/mastodon). They are periodically merged into the codebase.


[![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin] [![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)](https://crowdin.com/project/mastodon)


## Pull requests ## Pull requests


Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ RUN cd ~ && \
# Set the work dir and the container entry point # Set the work dir and the container entry point
WORKDIR /opt/mastodon WORKDIR /opt/mastodon
ENTRYPOINT ["/tini", "--"] ENTRYPOINT ["/tini", "--"]
EXPOSE 3000 4000
14 changes: 7 additions & 7 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '>= 2.4.0', '< 2.7.0' ruby '>= 2.4.0', '< 2.7.0'


gem 'pkg-config', '~> 1.3' gem 'pkg-config', '~> 1.4'


gem 'puma', '~> 4.2' gem 'puma', '~> 4.2'
gem 'rails', '~> 5.2.3' gem 'rails', '~> 5.2.3'
Expand All @@ -15,7 +15,7 @@ gem 'makara', '~> 0.4'
gem 'pghero', '~> 2.3' gem 'pghero', '~> 2.3'
gem 'dotenv-rails', '~> 2.7' gem 'dotenv-rails', '~> 2.7'


gem 'aws-sdk-s3', '~> 1.48', require: false gem 'aws-sdk-s3', '~> 1.52', require: false
gem 'fog-core', '<= 2.1.0' gem 'fog-core', '<= 2.1.0'
gem 'fog-openstack', '~> 0.3', require: false gem 'fog-openstack', '~> 0.3', require: false
gem 'paperclip', '~> 6.0' gem 'paperclip', '~> 6.0'
Expand Down Expand Up @@ -86,7 +86,7 @@ gem 'sidekiq-scheduler', '~> 3.0'
gem 'sidekiq-unique-jobs', '~> 6.0' gem 'sidekiq-unique-jobs', '~> 6.0'
gem 'sidekiq-bulk', '~>0.2.0' gem 'sidekiq-bulk', '~>0.2.0'
gem 'simple-navigation', '~> 4.1' gem 'simple-navigation', '~> 4.1'
gem 'simple_form', '~> 4.1' gem 'simple_form', '~> 5.0'
gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie' gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie'
gem 'stoplight', '~> 2.1.3' gem 'stoplight', '~> 2.1.3'
gem 'strong_migrations', '~> 0.4' gem 'strong_migrations', '~> 0.4'
Expand All @@ -109,7 +109,7 @@ group :development, :test do
gem 'i18n-tasks', '~> 0.9', require: false gem 'i18n-tasks', '~> 0.9', require: false
gem 'pry-byebug', '~> 3.7' gem 'pry-byebug', '~> 3.7'
gem 'pry-rails', '~> 0.3' gem 'pry-rails', '~> 0.3'
gem 'rspec-rails', '~> 3.8' gem 'rspec-rails', '~> 3.9'
end end


group :production, :test do group :production, :test do
Expand All @@ -119,7 +119,7 @@ end
group :test do group :test do
gem 'capybara', '~> 3.29' gem 'capybara', '~> 3.29'
gem 'climate_control', '~> 0.2' gem 'climate_control', '~> 0.2'
gem 'faker', '~> 2.5' gem 'faker', '~> 2.6'
gem 'microformats', '~> 4.1' gem 'microformats', '~> 4.1'
gem 'rails-controller-testing', '~> 1.0' gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-sidekiq', '~> 3.0' gem 'rspec-sidekiq', '~> 3.0'
Expand All @@ -129,8 +129,8 @@ group :test do
end end


group :development do group :development do
gem 'active_record_query_trace', '~> 1.6' gem 'active_record_query_trace', '~> 1.7'
gem 'annotate', '~> 2.7' gem 'annotate', '~> 3.0'
gem 'better_errors', '~> 2.5' gem 'better_errors', '~> 2.5'
gem 'binding_of_caller', '~> 0.7' gem 'binding_of_caller', '~> 0.7'
gem 'bullet', '~> 6.0' gem 'bullet', '~> 6.0'
Expand Down
76 changes: 38 additions & 38 deletions Gemfile.lock
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ GEM
activemodel (>= 4.1, < 6.1) activemodel (>= 4.1, < 6.1)
case_transform (>= 0.2) case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3) jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
active_record_query_trace (1.6.2) active_record_query_trace (1.7)
activejob (5.2.3) activejob (5.2.3)
activesupport (= 5.2.3) activesupport (= 5.2.3)
globalid (>= 0.3.6) globalid (>= 0.3.6)
Expand All @@ -95,7 +95,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.3.4) airbrussh (1.3.4)
sshkit (>= 1.6.1, != 1.7.0) sshkit (>= 1.6.1, != 1.7.0)
annotate (2.7.5) annotate (3.0.2)
activerecord (>= 3.2, < 7.0) activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 13.0) rake (>= 10.4, < 13.0)
arel (9.0.0) arel (9.0.0)
Expand All @@ -105,17 +105,17 @@ GEM
av (0.9.0) av (0.9.0)
cocaine (~> 0.5.3) cocaine (~> 0.5.3)
aws-eventstream (1.0.3) aws-eventstream (1.0.3)
aws-partitions (1.207.0) aws-partitions (1.230.0)
aws-sdk-core (3.65.1) aws-sdk-core (3.72.0)
aws-eventstream (~> 1.0, >= 1.0.2) aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0) aws-partitions (~> 1, >= 1.228.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-kms (1.24.0) aws-sdk-kms (1.25.0)
aws-sdk-core (~> 3, >= 3.61.1) aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.48.0) aws-sdk-s3 (1.52.0)
aws-sdk-core (~> 3, >= 3.61.1) aws-sdk-core (~> 3, >= 3.71.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0) aws-sigv4 (1.1.0)
Expand Down Expand Up @@ -235,13 +235,13 @@ GEM
multi_json multi_json
encryptor (3.0.0) encryptor (3.0.0)
equatable (0.6.1) equatable (0.6.1)
erubi (1.8.0) erubi (1.9.0)
et-orbi (1.1.6) et-orbi (1.1.6)
tzinfo tzinfo
excon (0.62.0) excon (0.62.0)
fabrication (2.20.2) fabrication (2.20.2)
faker (2.5.0) faker (2.6.0)
i18n (~> 1.6.0) i18n (>= 1.6, < 1.8)
faraday (0.15.4) faraday (0.15.4)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
fast_blank (1.0.0) fast_blank (1.0.0)
Expand Down Expand Up @@ -307,7 +307,7 @@ GEM
httplog (1.3.2) httplog (1.3.2)
rack (>= 1.0) rack (>= 1.0)
rainbow (>= 2.0.0) rainbow (>= 2.0.0)
i18n (1.6.0) i18n (1.7.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-tasks (0.9.29) i18n-tasks (0.9.29)
activesupport (>= 4.0.2) activesupport (>= 4.0.2)
Expand Down Expand Up @@ -380,7 +380,7 @@ GEM
mimemagic (0.3.3) mimemagic (0.3.3)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.12.0) minitest (5.12.2)
msgpack (1.3.1) msgpack (1.3.1)
multi_json (1.13.1) multi_json (1.13.1)
multipart-post (2.1.1) multipart-post (2.1.1)
Expand Down Expand Up @@ -437,7 +437,7 @@ GEM
pg (1.1.4) pg (1.1.4)
pghero (2.3.0) pghero (2.3.0)
activerecord (>= 5) activerecord (>= 5)
pkg-config (1.3.9) pkg-config (1.4.0)
premailer (1.11.1) premailer (1.11.1)
addressable addressable
css_parser (>= 1.6.0) css_parser (>= 1.6.0)
Expand Down Expand Up @@ -490,8 +490,8 @@ GEM
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.2.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.2, >= 2.2.2) loofah (~> 2.3)
rails-i18n (5.1.3) rails-i18n (5.1.3)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 5.0, < 6) railties (>= 5.0, < 6)
Expand Down Expand Up @@ -540,26 +540,26 @@ GEM
rpam2 (4.0.2) rpam2 (4.0.2)
rqrcode (0.10.1) rqrcode (0.10.1)
chunky_png (~> 1.0) chunky_png (~> 1.0)
rspec-core (3.8.0) rspec-core (3.9.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.9.0)
rspec-expectations (3.8.2) rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.9.0)
rspec-mocks (3.8.0) rspec-mocks (3.9.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.9.0)
rspec-rails (3.8.2) rspec-rails (3.9.0)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec-core (~> 3.8.0) rspec-core (~> 3.9.0)
rspec-expectations (~> 3.8.0) rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.8.0) rspec-mocks (~> 3.9.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.9.0)
rspec-sidekiq (3.0.3) rspec-sidekiq (3.0.3)
rspec-core (~> 3.0, >= 3.0.0) rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0) sidekiq (>= 2.4.0)
rspec-support (3.8.0) rspec-support (3.9.0)
rubocop (0.75.1) rubocop (0.75.1)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
Expand Down Expand Up @@ -599,7 +599,7 @@ GEM
thor (~> 0) thor (~> 0)
simple-navigation (4.1.0) simple-navigation (4.1.0)
activesupport (>= 2.3.2) activesupport (>= 2.3.2)
simple_form (4.1.0) simple_form (5.0.1)
actionpack (>= 5.0) actionpack (>= 5.0)
activemodel (>= 5.0) activemodel (>= 5.0)
simplecov (0.17.1) simplecov (0.17.1)
Expand All @@ -622,7 +622,7 @@ GEM
stoplight (2.1.3) stoplight (2.1.3)
streamio-ffmpeg (3.0.2) streamio-ffmpeg (3.0.2)
multi_json (~> 1.8) multi_json (~> 1.8)
strong_migrations (0.4.1) strong_migrations (0.4.2)
activerecord (>= 5) activerecord (>= 5)
temple (0.8.1) temple (0.8.1)
terminal-table (1.8.0) terminal-table (1.8.0)
Expand Down Expand Up @@ -681,10 +681,10 @@ PLATFORMS


DEPENDENCIES DEPENDENCIES
active_model_serializers (~> 0.10) active_model_serializers (~> 0.10)
active_record_query_trace (~> 1.6) active_record_query_trace (~> 1.7)
addressable (~> 2.7) addressable (~> 2.7)
annotate (~> 2.7) annotate (~> 3.0)
aws-sdk-s3 (~> 1.48) aws-sdk-s3 (~> 1.52)
better_errors (~> 2.5) better_errors (~> 2.5)
binding_of_caller (~> 0.7) binding_of_caller (~> 0.7)
blurhash (~> 0.1) blurhash (~> 0.1)
Expand Down Expand Up @@ -712,7 +712,7 @@ DEPENDENCIES
doorkeeper (~> 5.2) doorkeeper (~> 5.2)
dotenv-rails (~> 2.7) dotenv-rails (~> 2.7)
fabrication (~> 2.20) fabrication (~> 2.20)
faker (~> 2.5) faker (~> 2.6)
fast_blank (~> 1.0) fast_blank (~> 1.0)
fastimage fastimage
fog-core (<= 2.1.0) fog-core (<= 2.1.0)
Expand Down Expand Up @@ -760,7 +760,7 @@ DEPENDENCIES
parslet parslet
pg (~> 1.1) pg (~> 1.1)
pghero (~> 2.3) pghero (~> 2.3)
pkg-config (~> 1.3) pkg-config (~> 1.4)
posix-spawn! posix-spawn!
premailer-rails premailer-rails
private_address_check (~> 0.5) private_address_check (~> 0.5)
Expand All @@ -780,7 +780,7 @@ DEPENDENCIES
redis-namespace (~> 1.5) redis-namespace (~> 1.5)
redis-rails (~> 5.0) redis-rails (~> 5.0)
rqrcode (~> 0.10) rqrcode (~> 0.10)
rspec-rails (~> 3.8) rspec-rails (~> 3.9)
rspec-sidekiq (~> 3.0) rspec-sidekiq (~> 3.0)
rubocop (~> 0.75) rubocop (~> 0.75)
rubocop-rails (~> 2.3) rubocop-rails (~> 2.3)
Expand All @@ -791,7 +791,7 @@ DEPENDENCIES
sidekiq-scheduler (~> 3.0) sidekiq-scheduler (~> 3.0)
sidekiq-unique-jobs (~> 6.0) sidekiq-unique-jobs (~> 6.0)
simple-navigation (~> 4.1) simple-navigation (~> 4.1)
simple_form (~> 4.1) simple_form (~> 5.0)
simplecov (~> 0.17) simplecov (~> 0.17)
sprockets-rails (~> 3.2) sprockets-rails (~> 3.2)
stackprof stackprof
Expand Down
6 changes: 6 additions & 0 deletions app/javascript/mastodon/actions/importer/normalizer.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const makeEmojiMap = record => record.emojis.reduce((obj, emoji) => {
return obj; return obj;
}, {}); }, {});


export function searchTextFromRawStatus (status) {
const spoilerText = status.spoiler_text || '';
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
}

export function normalizeAccount(account) { export function normalizeAccount(account) {
account = { ...account }; account = { ...account };


Expand Down
3 changes: 2 additions & 1 deletion app/javascript/mastodon/actions/notifications.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { unescapeHTML } from '../utils/html';
import { getFiltersRegex } from '../selectors'; import { getFiltersRegex } from '../selectors';
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state'; import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
import compareId from 'mastodon/compare_id'; import compareId from 'mastodon/compare_id';
import { searchTextFromRawStatus } from 'mastodon/actions/importer/normalizer';


export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
Expand Down Expand Up @@ -60,7 +61,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
if (notification.type === 'mention') { if (notification.type === 'mention') {
const dropRegex = filters[0]; const dropRegex = filters[0];
const regex = filters[1]; const regex = filters[1];
const searchIndex = notification.status.spoiler_text + '\n' + unescapeHTML(notification.status.content); const searchIndex = searchTextFromRawStatus(notification.status);


if (dropRegex && dropRegex.test(searchIndex)) { if (dropRegex && dropRegex.test(searchIndex)) {
return; return;
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/components/modal_root.js
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import 'wicg-inert';


export default class ModalRoot extends React.PureComponent { export default class ModalRoot extends React.PureComponent {


Expand Down
3 changes: 2 additions & 1 deletion app/javascript/mastodon/components/poll.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent {


static getDerivedStateFromProps (props, state) { static getDerivedStateFromProps (props, state) {
const { poll, intl } = props; const { poll, intl } = props;
const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now(); const expires_at = poll.get('expires_at');
const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now();
return (expired === state.expired) ? null : { expired }; return (expired === state.expired) ? null : { expired };
} }


Expand Down
Loading

0 comments on commit 0ae7d84

Please sign in to comment.