From fdda54272d324175f0697ad83cd67b86a235d5c8 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Sun, 27 Oct 2019 20:45:33 +0900 Subject: [PATCH 01/39] Change message of public timeline for local only (#12224) --- app/views/public_timelines/show.html.haml | 6 +++++- config/locales/en.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/public_timelines/show.html.haml b/app/views/public_timelines/show.html.haml index 07215efdfd..0e4ba877df 100644 --- a/app/views/public_timelines/show.html.haml +++ b/app/views/public_timelines/show.html.haml @@ -7,7 +7,11 @@ .page-header %h1= t('about.see_whats_happening') - %p= t('about.browse_public_posts') + + - if Setting.show_known_fediverse_at_about_page + %p= t('about.browse_public_posts') + - else + %p= t('about.browse_local_posts') #mastodon-timeline{ data: { props: Oj.dump(default_props) }} #modal-container diff --git a/config/locales/en.yml b/config/locales/en.yml index 6fc191e1a5..38fe1a3828 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -11,6 +11,7 @@ en: apps: Mobile apps apps_platforms: Use Mastodon from iOS, Android and other platforms browse_directory: Browse a profile directory and filter by interests + browse_local_posts: Browse a live stream of public posts from this server browse_public_posts: Browse a live stream of public posts on Mastodon contact: Contact contact_missing: Not set From 6665362f10cc7f0af5fff7461b986b04f822bd75 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 27 Oct 2019 20:45:55 +0900 Subject: [PATCH 02/39] Fix an issue where polls with 'expires_at' not set expired (#12222) --- app/javascript/mastodon/components/poll.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/poll.js b/app/javascript/mastodon/components/poll.js index cdbcf8f709..0edd064e06 100644 --- a/app/javascript/mastodon/components/poll.js +++ b/app/javascript/mastodon/components/poll.js @@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent { static getDerivedStateFromProps (props, state) { 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 }; } From d99acc9587643eb227513b6b1b97ad00d187b117 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Sun, 27 Oct 2019 20:46:35 +0900 Subject: [PATCH 03/39] Fix notification message for own poll (#12219) --- .../notifications/components/notification.js | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js index 41e9324e6f..e81ef00def 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/mastodon/features/notifications/components/notification.js @@ -1,13 +1,22 @@ import React from 'react'; -import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import StatusContainer from '../../../containers/status_container'; -import AccountContainer from '../../../containers/account_container'; -import { injectIntl, FormattedMessage } from 'react-intl'; -import Permalink from '../../../components/permalink'; -import ImmutablePureComponent from 'react-immutable-pure-component'; +import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import { HotKeys } from 'react-hotkeys'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { me } from 'mastodon/initial_state'; +import StatusContainer from 'mastodon/containers/status_container'; +import AccountContainer from 'mastodon/containers/account_container'; import Icon from 'mastodon/components/icon'; +import Permalink from 'mastodon/components/permalink'; + +const messages = defineMessages({ + favourite: { id: 'notification.favourite', defaultMessage: '{name} favourited your status' }, + follow: { id: 'notification.follow', defaultMessage: '{name} followed you' }, + ownPoll: { id: 'notification.own_poll', defaultMessage: 'Your poll has ended' }, + poll: { id: 'notification.poll', defaultMessage: 'A poll you have voted in has ended' }, + reblog: { id: 'notification.reblog', defaultMessage: '{name} boosted your status' }, +}); const notificationForScreenReader = (intl, message, timestamp) => { const output = [message]; @@ -107,7 +116,7 @@ class Notification extends ImmutablePureComponent { return ( -
+
@@ -146,7 +155,7 @@ class Notification extends ImmutablePureComponent { return ( -
+
@@ -178,7 +187,7 @@ class Notification extends ImmutablePureComponent { return ( -
+
@@ -205,25 +214,31 @@ class Notification extends ImmutablePureComponent { ); } - renderPoll (notification) { + renderPoll (notification, account) { const { intl } = this.props; + const ownPoll = me === account.get('id'); + const message = ownPoll ? intl.formatMessage(messages.ownPoll) : intl.formatMessage(messages.poll); return ( -
+
- + {ownPoll ? ( + + ) : ( + + )}