]> cat aescling's git repositories - mastodon.git/commitdiff
Merge tag 'v1.6.0rc4' into sync/upstream-1.6.0rc4
authorDavid Yip <yipdw@member.fsf.org>
Sun, 10 Sep 2017 04:56:21 +0000 (23:56 -0500)
committerDavid Yip <yipdw@member.fsf.org>
Sun, 10 Sep 2017 04:56:21 +0000 (23:56 -0500)
Conflicts:
      app/javascript/mastodon/features/getting_started/index.js
      app/javascript/packs/public.js
      app/javascript/styles/components.scss

67 files changed:
Gemfile
Gemfile.lock
app/helpers/settings_helper.rb
app/javascript/mastodon/actions/compose.js
app/javascript/mastodon/actions/pin_statuses.js [new file with mode: 0644]
app/javascript/mastodon/components/scrollable_list.js
app/javascript/mastodon/components/status_action_bar.js
app/javascript/mastodon/components/video_player.js
app/javascript/mastodon/features/getting_started/index.js
app/javascript/mastodon/features/pinned_statuses/index.js [new file with mode: 0644]
app/javascript/mastodon/features/ui/components/embed_modal.js
app/javascript/mastodon/features/ui/index.js
app/javascript/mastodon/features/ui/util/async-components.js
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/fr.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/ko.json
app/javascript/mastodon/locales/oc.json
app/javascript/mastodon/locales/pl.json
app/javascript/mastodon/reducers/reports.js
app/javascript/mastodon/reducers/status_lists.js
app/javascript/mastodon/reducers/statuses.js
app/javascript/packs/public.js
app/javascript/styles/admin.scss
app/javascript/styles/basics.scss
app/javascript/styles/components.scss
app/javascript/styles/tables.scss
app/lib/activitypub/tag_manager.rb
app/lib/language_detector.rb
app/models/report.rb
app/models/status.rb
app/serializers/oembed_serializer.rb
app/services/activitypub/process_account_service.rb
app/services/follow_service.rb
app/services/post_status_service.rb
app/services/unsubscribe_service.rb
app/views/admin/accounts/_card.html.haml
app/views/admin/accounts/index.html.haml
app/views/admin/accounts/show.html.haml
app/views/admin/domain_blocks/index.html.haml
app/views/admin/instances/index.html.haml
app/views/admin/reports/index.html.haml
app/views/admin/subscriptions/index.html.haml
app/views/auth/registrations/_sessions.html.haml
app/views/oauth/authorized_applications/index.html.haml
app/views/settings/applications/index.html.haml
app/views/settings/applications/show.html.haml
app/views/settings/exports/show.html.haml
app/views/settings/follower_domains/show.html.haml
app/views/settings/preferences/show.html.haml
app/views/user_mailer/confirmation_instructions.oc.html.erb
app/views/user_mailer/confirmation_instructions.oc.text.erb
app/views/user_mailer/password_change.oc.html.erb
app/views/user_mailer/password_change.oc.text.erb
app/views/user_mailer/reset_password_instructions.oc.html.erb
app/views/user_mailer/reset_password_instructions.oc.text.erb
config/initializers/sidekiq.rb
config/locales/pl.yml
lib/mastodon/version.rb
lib/tasks/mastodon.rake
public/embed.js [new file with mode: 0644]
spec/helpers/settings_helper_spec.rb
spec/lib/activitypub/activity/update_spec.rb
spec/lib/activitypub/tag_manager_spec.rb
spec/models/report_spec.rb
spec/services/activitypub/fetch_remote_account_service_spec.rb
spec/services/unsubscribe_service_spec.rb

diff --git a/Gemfile b/Gemfile
index 486e72cc4ad96a9770a83eb777439a5462ce076c..637bf53eebe21276039fe6baabcb517cb9cd2c0a 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -24,6 +24,7 @@ gem 'addressable', '~> 2.5'
 gem 'bootsnap'
 gem 'browser'
 gem 'charlock_holmes', '~> 0.7.5'
+gem 'iso-639'
 gem 'cld3', '~> 3.1'
 gem 'devise', '~> 4.2'
 gem 'devise-two-factor', '~> 3.0'
index ef99e0d7b3c69b4503983c1a5306a52e1303fe5d..ddb97dd940adad3e19c9e351a2329ec555858879 100644 (file)
@@ -225,6 +225,7 @@ GEM
       terminal-table (>= 1.5.1)
     idn-ruby (0.1.0)
     ipaddress (0.8.3)
+    iso-639 (0.2.8)
     jmespath (1.3.1)
     json (2.1.0)
     json-ld (2.1.5)
@@ -560,6 +561,7 @@ DEPENDENCIES
   httplog (~> 0.99)
   i18n-tasks (~> 0.9)
   idn-ruby
+  iso-639
   json-ld-preloaded (~> 2.2.1)
   kaminari (~> 1.0)
   letter_opener (~> 1.4)
index af950aa634f27d71e32881d96d2d35aa110f9538..369a456809943e48314287ff62c22804e307c28d 100644 (file)
@@ -30,6 +30,7 @@ module SettingsHelper
     th: 'ภาษาไทย',
     tr: 'Türkçe',
     uk: 'Українська',
+    zh: '中文',
     'zh-CN': '简体中文',
     'zh-HK': '繁體中文(香港)',
     'zh-TW': '繁體中文(臺灣)',
@@ -39,6 +40,10 @@ module SettingsHelper
     HUMAN_LOCALES[locale]
   end
 
+  def filterable_languages
+    I18n.available_locales.map { |locale| locale.to_s.split('-').first.to_sym }.uniq
+  end
+
   def hash_to_object(hash)
     HashObject.new(hash)
   end
index 5a486f9bbd281b6d8cbf5eafdaf8a4afdb006a31..5f265a750116a996600dae5b9ced94cdb8b2e3b1 100644 (file)
@@ -1,6 +1,11 @@
 import api from '../api';
 
-import { updateTimeline } from './timelines';
+import {
+  updateTimeline,
+  refreshHomeTimeline,
+  refreshCommunityTimeline,
+  refreshPublicTimeline,
+} from './timelines';
 
 export const COMPOSE_CHANGE          = 'COMPOSE_CHANGE';
 export const COMPOSE_SUBMIT_REQUEST  = 'COMPOSE_SUBMIT_REQUEST';
@@ -98,16 +103,20 @@ export function submitCompose() {
       dispatch(submitComposeSuccess({ ...response.data }));
 
       // To make the app more responsive, immediately get the status into the columns
-      dispatch(updateTimeline('home', { ...response.data }));
 
-      if (response.data.in_reply_to_id === null && response.data.visibility === 'public') {
-        if (getState().getIn(['timelines', 'community', 'loaded'])) {
-          dispatch(updateTimeline('community', { ...response.data }));
+      const insertOrRefresh = (timelineId, refreshAction) => {
+        if (getState().getIn(['timelines', timelineId, 'online'])) {
+          dispatch(updateTimeline(timelineId, { ...response.data }));
+        } else if (getState().getIn(['timelines', timelineId, 'loaded'])) {
+          dispatch(refreshAction());
         }
+      };
 
-        if (getState().getIn(['timelines', 'public', 'loaded'])) {
-          dispatch(updateTimeline('public', { ...response.data }));
-        }
+      insertOrRefresh('home', refreshHomeTimeline);
+
+      if (response.data.in_reply_to_id === null && response.data.visibility === 'public') {
+        insertOrRefresh('community', refreshCommunityTimeline);
+        insertOrRefresh('public', refreshPublicTimeline);
       }
     }).catch(function (error) {
       dispatch(submitComposeFail(error));
diff --git a/app/javascript/mastodon/actions/pin_statuses.js b/app/javascript/mastodon/actions/pin_statuses.js
new file mode 100644 (file)
index 0000000..01bf893
--- /dev/null
@@ -0,0 +1,39 @@
+import api from '../api';
+
+export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST';
+export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS';
+export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL';
+
+export function fetchPinnedStatuses() {
+  return (dispatch, getState) => {
+    dispatch(fetchPinnedStatusesRequest());
+
+    const accountId = getState().getIn(['meta', 'me']);
+    api(getState).get(`/api/v1/accounts/${accountId}/statuses`, { params: { pinned: true } }).then(response => {
+      dispatch(fetchPinnedStatusesSuccess(response.data, null));
+    }).catch(error => {
+      dispatch(fetchPinnedStatusesFail(error));
+    });
+  };
+};
+
+export function fetchPinnedStatusesRequest() {
+  return {
+    type: PINNED_STATUSES_FETCH_REQUEST,
+  };
+};
+
+export function fetchPinnedStatusesSuccess(statuses, next) {
+  return {
+    type: PINNED_STATUSES_FETCH_SUCCESS,
+    statuses,
+    next,
+  };
+};
+
+export function fetchPinnedStatusesFail(error) {
+  return {
+    type: PINNED_STATUSES_FETCH_FAIL,
+    error,
+  };
+};
index e47b1e9aa5ec96a8bf5fc89020cc8b01cd87c9df..723dd322b06a32830c53f9ca736f385d38a19e86 100644 (file)
@@ -27,6 +27,10 @@ export default class ScrollableList extends PureComponent {
     trackScroll: true,
   };
 
+  state = {
+    lastMouseMove: null,
+  };
+
   intersectionObserverWrapper = new IntersectionObserverWrapper();
 
   handleScroll = throttle(() => {
@@ -47,6 +51,14 @@ export default class ScrollableList extends PureComponent {
     trailing: true,
   });
 
+  handleMouseMove = throttle(() => {
+    this._lastMouseMove = new Date();
+  }, 300);
+
+  handleMouseLeave = () => {
+    this._lastMouseMove = null;
+  }
+
   componentDidMount () {
     this.attachScrollListener();
     this.attachIntersectionObserver();
@@ -56,17 +68,20 @@ export default class ScrollableList extends PureComponent {
   }
 
   componentDidUpdate (prevProps) {
+    const someItemInserted = React.Children.count(prevProps.children) > 0 &&
+      React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
+      this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
+
     // Reset the scroll position when a new child comes in in order not to
     // jerk the scrollbar around if you're already scrolled down the page.
-    if (React.Children.count(prevProps.children) < React.Children.count(this.props.children) && this._oldScrollPosition && this.node.scrollTop > 0) {
-      if (this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props)) {
-        const newScrollTop = this.node.scrollHeight - this._oldScrollPosition;
-        if (this.node.scrollTop !== newScrollTop) {
-          this.node.scrollTop = newScrollTop;
-        }
-      } else {
-        this._oldScrollPosition = this.node.scrollHeight - this.node.scrollTop;
+    if (someItemInserted && this._oldScrollPosition && this.node.scrollTop > 0) {
+      const newScrollTop = this.node.scrollHeight - this._oldScrollPosition;
+
+      if (this.node.scrollTop !== newScrollTop) {
+        this.node.scrollTop = newScrollTop;
       }
+    } else {
+      this._oldScrollPosition = this.node.scrollHeight - this.node.scrollTop;
     }
   }
 
@@ -114,6 +129,10 @@ export default class ScrollableList extends PureComponent {
     this.props.onScrollToBottom();
   }
 
+  _recentlyMoved () {
+    return this._lastMouseMove !== null && ((new Date()) - this._lastMouseMove < 600);
+  }
+
   handleKeyDown = (e) => {
     if (['PageDown', 'PageUp'].includes(e.key) || (e.ctrlKey && ['End', 'Home'].includes(e.key))) {
       const article = (() => {
@@ -149,7 +168,7 @@ export default class ScrollableList extends PureComponent {
 
     if (isLoading || childrenCount > 0 || !emptyMessage) {
       scrollableArea = (
-        <div className='scrollable' ref={this.setRef}>
+        <div className='scrollable' ref={this.setRef} onMouseMove={this.handleMouseMove} onMouseLeave={this.handleMouseLeave}>
           <div role='feed' className='item-list' onKeyDown={this.handleKeyDown}>
             {prepend}
 
index de99f88509ee1a75bc2c1d711b10a7c99546cfc0..b8f5dbce7691780f5bc603bd1a18b55035b75a5d 100644 (file)
@@ -137,7 +137,7 @@ export default class StatusActionBar extends ImmutablePureComponent {
 
     menu.push(null);
 
-    if (withDismiss) {
+    if (status.getIn(['account', 'id']) === me || withDismiss) {
       menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
       menu.push(null);
     }
index f499e3e01faecb74e133b357e8e1f6ede213ab62..26914f11391e84907be467e6337e64a9d13ca7dd 100644 (file)
@@ -149,29 +149,29 @@ export default class VideoPlayer extends React.PureComponent {
     if (!this.state.visible) {
       if (sensitive) {
         return (
-          <div role='button' tabIndex='0' style={{ width: `${width}px`, height: `${height}px`, marginTop: '8px' }} className='media-spoiler__video' onClick={this.handleVisibility}>
+          <button style={{ width: `${width}px`, height: `${height}px`, marginTop: '8px' }} className='media-spoiler' onClick={this.handleVisibility}>
             {spoilerButton}
             <span className='media-spoiler__warning'><FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' /></span>
             <span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
-          </div>
+          </button>
         );
       } else {
         return (
-          <div role='button' tabIndex='0' style={{ width: `${width}px`, height: `${height}px`, marginTop: '8px' }} className='media-spoiler__video' onClick={this.handleVisibility}>
+          <button style={{ width: `${width}px`, height: `${height}px`, marginTop: '8px' }} className='media-spoiler' onClick={this.handleVisibility}>
             {spoilerButton}
             <span className='media-spoiler__warning'><FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' /></span>
             <span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
-          </div>
+          </button>
         );
       }
     }
 
     if (this.state.preview && !autoplay) {
       return (
-        <div role='button' tabIndex='0' className='media-spoiler-video' style={{ width: `${width}px`, height: `${height}px`, backgroundImage: `url(${media.get('preview_url')})` }} onClick={this.handleOpen}>
+        <button className='media-spoiler-video' style={{ width: `${width}px`, height: `${height}px`, backgroundImage: `url(${media.get('preview_url')})` }} onClick={this.handleOpen}>
           {spoilerButton}
           <div className='media-spoiler-video-play-icon'><i className='fa fa-play' /></div>
-        </div>
+        </button>
       );
     }
 
index 2efab66f50761f3a1e5d894af976d23da7b7ea27..9b729e03501e1e6655b4e6bc7d38ddb3b7a75833 100644 (file)
@@ -26,6 +26,7 @@ const messages = defineMessages({
   mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
   info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' },
   show_me_around: { id: 'getting_started.onboarding', defaultMessage: 'Show me around' },
+  pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },
 });
 
 const mapStateToProps = state => ({
@@ -79,15 +80,16 @@ export default class GettingStarted extends ImmutablePureComponent {
 
     navItems = navItems.concat([
       <ColumnLink key='4' icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
+      <ColumnLink key='5' icon='thumb-tack' text={intl.formatMessage(messages.pins)} to='/pinned' />,
     ]);
 
     if (me.get('locked')) {
-      navItems.push(<ColumnLink key='5' icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />);
+      navItems.push(<ColumnLink key='6' icon='users' text={intl.formatMessage(messages.follow_requests)} to='/follow_requests' />);
     }
 
     navItems = navItems.concat([
-      <ColumnLink key='6' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />,
-      <ColumnLink key='7' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />,
+      <ColumnLink key='7' icon='volume-off' text={intl.formatMessage(messages.mutes)} to='/mutes' />,
+      <ColumnLink key='8' icon='ban' text={intl.formatMessage(messages.blocks)} to='/blocks' />,
     ]);
 
     return (
diff --git a/app/javascript/mastodon/features/pinned_statuses/index.js b/app/javascript/mastodon/features/pinned_statuses/index.js
new file mode 100644 (file)
index 0000000..b4a6c1e
--- /dev/null
@@ -0,0 +1,59 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import { fetchPinnedStatuses } from '../../actions/pin_statuses';
+import Column from '../ui/components/column';
+import ColumnBackButtonSlim from '../../components/column_back_button_slim';
+import StatusList from '../../components/status_list';
+import { defineMessages, injectIntl } from 'react-intl';
+import ImmutablePureComponent from 'react-immutable-pure-component';
+
+const messages = defineMessages({
+  heading: { id: 'column.pins', defaultMessage: 'Pinned toot' },
+});
+
+const mapStateToProps = state => ({
+  statusIds: state.getIn(['status_lists', 'pins', 'items']),
+  hasMore: !!state.getIn(['status_lists', 'pins', 'next']),
+});
+
+@connect(mapStateToProps)
+@injectIntl
+export default class PinnedStatuses extends ImmutablePureComponent {
+
+  static propTypes = {
+    dispatch: PropTypes.func.isRequired,
+    statusIds: ImmutablePropTypes.list.isRequired,
+    intl: PropTypes.object.isRequired,
+    hasMore: PropTypes.bool.isRequired,
+  };
+
+  componentWillMount () {
+    this.props.dispatch(fetchPinnedStatuses());
+  }
+
+  handleHeaderClick = () => {
+    this.column.scrollTop();
+  }
+
+  setRef = c => {
+    this.column = c;
+  }
+
+  render () {
+    const { intl, statusIds, hasMore } = this.props;
+
+    return (
+      <Column icon='thumb-tack' heading={intl.formatMessage(messages.heading)} ref={this.setRef}>
+        <ColumnBackButtonSlim />
+        <StatusList
+          statusIds={statusIds}
+          scrollKey='pinned_statuses'
+          hasMore={hasMore}
+        />
+      </Column>
+    );
+  }
+
+}
index 992aed8a3fa047e6b051f83e09620f12d452f8c8..1afffb51bc92e193b80cdcf5e2889f270197eb6a 100644 (file)
@@ -33,7 +33,8 @@ export default class EmbedModal extends ImmutablePureComponent {
       iframeDocument.close();
 
       iframeDocument.body.style.margin = 0;
-      this.iframe.height = iframeDocument.body.scrollHeight + 'px';
+      this.iframe.width  = iframeDocument.body.scrollWidth;
+      this.iframe.height = iframeDocument.body.scrollHeight;
     });
   }
 
@@ -71,7 +72,6 @@ export default class EmbedModal extends ImmutablePureComponent {
 
           <iframe
             className='embed-modal__iframe'
-            scrolling='no'
             frameBorder='0'
             ref={this.setIframeRef}
             title='preview'
index a14547ed89933b73ed1c1b0da9b122385a280e1b..7d12210bb5912a4cc08849a4cbf44b883b8576ab 100644 (file)
@@ -36,6 +36,7 @@ import {
   FavouritedStatuses,
   Blocks,
   Mutes,
+  PinnedStatuses,
 } from './util/async-components';
 
 // Dummy import, to make sure that <Status /> ends up in the application bundle.
@@ -235,6 +236,7 @@ export default class UI extends React.PureComponent {
 
             <WrappedRoute path='/notifications' component={Notifications} content={children} />
             <WrappedRoute path='/favourites' component={FavouritedStatuses} content={children} />
+            <WrappedRoute path='/pinned' component={PinnedStatuses} content={children} />
 
             <WrappedRoute path='/statuses/new' component={Compose} content={children} />
             <WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
index 108ffc1424188294c7052fc18edfee51789d3253..3f335c4f84f4c2543a896010a71d61d86716bf54 100644 (file)
@@ -34,6 +34,10 @@ export function GettingStarted () {
   return import(/* webpackChunkName: "features/getting_started" */'../../getting_started');
 }
 
+export function PinnedStatuses () {
+  return import(/* webpackChunkName: "features/pinned_statuses" */'../../pinned_statuses');
+}
+
 export function AccountTimeline () {
   return import(/* webpackChunkName: "features/account_timeline" */'../../account_timeline');
 }
index 6d9b9c20873c0f42742df72ccb9eacdc2d98db33..f42851f45981548b46c82ebdaad5daba0e9e0778 100644 (file)
@@ -34,6 +34,7 @@
   "column.mutes": "Muted users",
   "column.notifications": "Notifications",
   "column.public": "Federated timeline",
+  "column.pins": "Pinned toots",
   "column_back_button.label": "Back",
   "column_header.hide_settings": "Hide settings",
   "column_header.moveLeft_settings": "Move column to the left",
   "navigation_bar.mutes": "Muted users",
   "navigation_bar.preferences": "Preferences",
   "navigation_bar.public_timeline": "Federated timeline",
+  "navigation_bar.pins": "Pinned toots",
   "notification.favourite": "{name} favourited your status",
   "notification.follow": "{name} followed you",
   "notification.mention": "{name} mentioned you",
index fa8ea6c7360f7a5af4e26598059b38e5edbfad43..8ca632accd60560094c935d5faa25f2784576548 100644 (file)
@@ -34,6 +34,7 @@
   "column.mutes": "Comptes masqués",
   "column.notifications": "Notifications",
   "column.public": "Fil public global",
+  "column.pins": "Pouets épinglés",
   "column_back_button.label": "Retour",
   "column_header.hide_settings": "Masquer les paramètres",
   "column_header.moveLeft_settings": "Déplacer la colonne vers la gauche",
@@ -62,9 +63,9 @@
   "confirmations.mute.confirm": "Masquer",
   "confirmations.mute.message": "Confirmez vous le masquage de {name} ?",
   "confirmations.unfollow.confirm": "Ne plus suivre",
-  "confirmations.unfollow.message": "Vous voulez-vous arrêter de suivre {name} ?",
-  "embed.instructions": "Embed this status on your website by copying the code below.",
-  "embed.preview": "Here is what it will look like:",
+  "confirmations.unfollow.message": "Voulez-vous arrêter de suivre {name} ?",
+  "embed.instructions": "Intégrez ce statut à votre site en copiant ce code ci-dessous.",
+  "embed.preview": "Il apparaîtra comme cela : ",
   "emoji_button.activity": "Activités",
   "emoji_button.flags": "Drapeaux",
   "emoji_button.food": "Boire et manger",
   "navigation_bar.mutes": "Comptes masqués",
   "navigation_bar.preferences": "Préférences",
   "navigation_bar.public_timeline": "Fil public global",
+  "navigation_bar.pins": "Pouets épinglés",
   "notification.favourite": "{name} a ajouté à ses favoris :",
   "notification.follow": "{name} vous suit.",
   "notification.mention": "{name} vous a mentionné⋅e :",
index 560d2b6684c7e18a3db01707750ad98f3e69e088..65838a3f80993f4199ccb6764ed12cee6b4cf591 100644 (file)
@@ -34,6 +34,7 @@
   "column.mutes": "ミュートしたユーザー",
   "column.notifications": "通知",
   "column.public": "連合タイムライン",
+  "column.pins": "固定されたトゥート",
   "column_back_button.label": "戻る",
   "column_header.hide_settings": "設定を隠す",
   "column_header.moveLeft_settings": "カラムを左に移動する",
   "navigation_bar.mutes": "ミュートしたユーザー",
   "navigation_bar.preferences": "ユーザー設定",
   "navigation_bar.public_timeline": "連合タイムライン",
+  "navigation_bar.pins": "固定されたトゥート",
   "notification.favourite": "{name}さんがあなたのトゥートをお気に入りに登録しました",
   "notification.follow": "{name}さんにフォローされました",
   "notification.mention": "{name}さんがあなたに返信しました",
index 7d573506cf17398f4cab99b1aeeacf202f63e930..8393e82e5719f9e22790f0cdac48bd0f0b8e8462 100644 (file)
@@ -34,6 +34,7 @@
   "column.mutes": "뮤트 중인 사용자",
   "column.notifications": "알림",
   "column.public": "연합 타임라인",
+  "column.pins": "고정된 Toot",
   "column_back_button.label": "돌아가기",
   "column_header.hide_settings": "Hide settings",
   "column_header.moveLeft_settings": "Move column to the left",
   "navigation_bar.mutes": "뮤트 중인 사용자",
   "navigation_bar.preferences": "사용자 설정",
   "navigation_bar.public_timeline": "연합 타임라인",
+  "navigation_bar.pins": "고정된 Toot",
   "notification.favourite": "{name}님이 즐겨찾기 했습니다",
   "notification.follow": "{name}님이 나를 팔로우 했습니다",
   "notification.mention": "{name}님이 답글을 보냈습니다",
index a86033e6f6481516f90de30f86a64bf12f6d913f..d2b2dd48f748b8571574a8c9ee22522fe9dac6b3 100644 (file)
@@ -34,6 +34,7 @@
   "column.mutes": "Personas en silenci",
   "column.notifications": "Notificacions",
   "column.public": "Flux public global",
+  "column.pins": "Tuts penjats",
   "column_back_button.label": "Tornar",
   "column_header.hide_settings": "Amagar los paramètres",
   "column_header.moveLeft_settings": "Desplaçar la colomna a man drecha",
@@ -87,7 +88,7 @@
   "getting_started.appsshort": "Apps",
   "getting_started.faq": "FAQ",
   "getting_started.heading": "Per començar",
-  "getting_started.open_source_notice": "Mastodon es un logicial liure. Podètz contribuir e mandar vòstres comentaris e rapòrt de bug via{github} sus GitHub.",
+  "getting_started.open_source_notice": "Mastodon es un logicial liure. Podètz contribuir e mandar vòstres comentaris e rapòrt de bug via {github} sus GitHub.",
   "getting_started.userguide": "Guida d’utilizacion",
   "home.column_settings.advanced": "Avançat",
   "home.column_settings.basic": "Basic",
   "navigation_bar.mutes": "Personas rescondudas",
   "navigation_bar.preferences": "Preferéncias",
   "navigation_bar.public_timeline": "Flux public global",
+  "navigation_bar.pins": "Tuts penjats",
   "notification.favourite": "{name} a ajustat a sos favorits :",
   "notification.follow": "{name} vos sèc",
   "notification.mention": "{name} vos a mencionat :",
   "notifications.column_settings.reblog": "Partatges :",
   "notifications.column_settings.show": "Mostrar dins la colomna",
   "notifications.column_settings.sound": "Emetre un son",
-  "onboarding.done": "Fach",
+  "onboarding.done": "Sortir",
   "onboarding.next": "Seguent",
-  "onboarding.page_five.public_timelines": "Lo flux local mòstra los estatuts publics del monde de vòstra instància, aquí {domain}. Lo flux federat mòstra los estatuts publics de tot lo mond sus {domain} sègon. Son los fluxes publics, un bon biais de trobar de mond.",
+  "onboarding.page_five.public_timelines": "Lo flux local mòstra los estatuts publics del monde de vòstra instància, aquí {domain}. Lo flux federat mòstra los estatuts publics de la gent que los de {domain} sègon. Son los fluxes publics, un bon biais de trobar de mond.",
   "onboarding.page_four.home": "Lo flux d’acuèlh mòstra los estatuts del mond que seguètz.",
   "onboarding.page_four.notifications": "La colomna de notificacions vos fa veire quand qualqu’un interagís amb vos",
-  "onboarding.page_one.federation": "Mastodon es un malhum de servidors independents que comunican per bastir un malhum ma larg. Òm los apèla instàncias.",
+  "onboarding.page_one.federation": "Mastodon es un malhum de servidors independents que comunican per bastir un malhum mai larg. Òm los apèla instàncias.",
   "onboarding.page_one.handle": "Sètz sus {domain}, doncas vòstre identificant complet es {handle}",
   "onboarding.page_one.welcome": "Benvengut a Mastodon !",
   "onboarding.page_six.admin": "Vòstre administrator d’instància es {admin}.",
   "onboarding.page_six.almost_done": "Gaireben acabat…",
-  "onboarding.page_six.appetoot": "Bon Appetut!",
+  "onboarding.page_six.appetoot": "Bon Appetut!",
   "onboarding.page_six.apps_available": "I a d’aplicacions per mobil per iOS, Android e mai.",
   "onboarding.page_six.github": "Mastodon es un logicial liure e open-source.  Podètz senhalar de bugs, demandar de foncionalitats e contribuir al còdi sus {github}.",
   "onboarding.page_six.guidelines": "guida de la comunitat",
-  "onboarding.page_six.read_guidelines": "Mercés de legir la {guidelines} a {domain} !",
+  "onboarding.page_six.read_guidelines": "Mercés de legir la {guidelines} de {domain} !",
   "onboarding.page_six.various_app": "aplicacions per mobil",
   "onboarding.page_three.profile": "Modificatz vòstre perfil per cambiar vòstre avatar, bio e escais-nom. I a enlà totas las preferéncias.",
   "onboarding.page_three.search": "Emplegatz la barra de recèrca per trobar de mond e engachatz las etiquetas coma {illustration} e {introductions}. Per trobar una persona d’una autra instància, picatz son identificant complet.",
   "status.show_less": "Tornar plegar",
   "status.show_more": "Desplegar",
   "status.unmute_conversation": "Conversacions amb silenci levat",
-  "status.unpin": "Despenjar del perfil",
+  "status.unpin": "Tirar del perfil",
   "tabs_bar.compose": "Compausar",
   "tabs_bar.federated_timeline": "Flux public global",
   "tabs_bar.home": "Acuèlh",
index e3e6529700669d3aec3ff60c061cb4560fd8e470..daa60128d53235c7c4072cedc79d1deec9b82bc5 100644 (file)
@@ -12,7 +12,7 @@
   "account.mute": "Wycisz @{name}",
   "account.posts": "Wpisy",
   "account.report": "Zgłoś @{name}",
-  "account.requested": "Oczekująca prośba",
+  "account.requested": "Oczekująca prośba, kliknij aby anulować",
   "account.share": "Udostępnij profil @{name}",
   "account.unblock": "Odblokuj @{name}",
   "account.unblock_domain": "Odblokuj domenę {domain}",
@@ -33,6 +33,7 @@
   "column.home": "Strona główna",
   "column.mutes": "Wyciszeni użytkownicy",
   "column.notifications": "Powiadomienia",
+  "column.pins": "Przypięte wpisy",
   "column.public": "Globalna oś czasu",
   "column_back_button.label": "Wróć",
   "column_header.hide_settings": "Ukryj ustawienia",
   "navigation_bar.info": "Szczegółowe informacje",
   "navigation_bar.logout": "Wyloguj",
   "navigation_bar.mutes": "Wyciszeni użytkownicy",
+  "navigation_bar.pins": "Przypięte wpisy",
   "navigation_bar.preferences": "Preferencje",
   "navigation_bar.public_timeline": "Oś czasu federacji",
   "notification.favourite": "{name} dodał Twój status do ulubionych",
   "privacy.private.short": "Tylko dla śledzących",
   "privacy.public.long": "Widoczny na publicznych osiach czasu",
   "privacy.public.short": "Publiczny",
-  "privacy.unlisted.long": "Niewidoczne na publicznych osiach czasu",
-  "privacy.unlisted.short": "Niewidoczne",
+  "privacy.unlisted.long": "Niewidoczny na publicznych osiach czasu",
+  "privacy.unlisted.short": "Niewidoczny",
   "reply_indicator.cancel": "Anuluj",
   "report.placeholder": "Dodatkowe komentarze",
   "report.submit": "Wyślij",
index 283c5b6f5e3340942711829bd8c6653d4890d2ef..a08bbec387dbdb00cff5b6dadee596994012e5cf 100644 (file)
@@ -28,7 +28,7 @@ export default function reports(state = initialState, action) {
       if (state.getIn(['new', 'account_id']) !== action.account.get('id')) {
         map.setIn(['new', 'status_ids'], action.status ? ImmutableSet([action.status.getIn(['reblog', 'id'], action.status.get('id'))]) : ImmutableSet());
         map.setIn(['new', 'comment'], '');
-      } else {
+      } else if (action.status) {
         map.updateIn(['new', 'status_ids'], ImmutableSet(), set => set.add(action.status.getIn(['reblog', 'id'], action.status.get('id'))));
       }
     });
index 2ce27a45459c8781129434d05cc24f011938f663..c4aeb338f4725d3d12df739498ebfffb02d28b1f 100644 (file)
@@ -2,10 +2,15 @@ import {
   FAVOURITED_STATUSES_FETCH_SUCCESS,
   FAVOURITED_STATUSES_EXPAND_SUCCESS,
 } from '../actions/favourites';
+import {
+  PINNED_STATUSES_FETCH_SUCCESS,
+} from '../actions/pin_statuses';
 import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
 import {
   FAVOURITE_SUCCESS,
   UNFAVOURITE_SUCCESS,
+  PIN_SUCCESS,
+  UNPIN_SUCCESS,
 } from '../actions/interactions';
 
 const initialState = ImmutableMap({
@@ -14,6 +19,11 @@ const initialState = ImmutableMap({
     loaded: false,
     items: ImmutableList(),
   }),
+  pins: ImmutableMap({
+    next: null,
+    loaded: false,
+    items: ImmutableList(),
+  }),
 });
 
 const normalizeList = (state, listType, statuses, next) => {
@@ -53,6 +63,12 @@ export default function statusLists(state = initialState, action) {
     return prependOneToList(state, 'favourites', action.status);
   case UNFAVOURITE_SUCCESS:
     return removeOneFromList(state, 'favourites', action.status);
+  case PINNED_STATUSES_FETCH_SUCCESS:
+    return normalizeList(state, 'pins', action.statuses, action.next);
+  case PIN_SUCCESS:
+    return prependOneToList(state, 'pins', action.status);
+  case UNPIN_SUCCESS:
+    return removeOneFromList(state, 'pins', action.status);
   default:
     return state;
   }
index 38691dc43062740c6e7af860dc2fd033a48dcf33..eec2a5f165fb74c56dd91378894c818130726ff0 100644 (file)
@@ -36,6 +36,9 @@ import {
   FAVOURITED_STATUSES_FETCH_SUCCESS,
   FAVOURITED_STATUSES_EXPAND_SUCCESS,
 } from '../actions/favourites';
+import {
+  PINNED_STATUSES_FETCH_SUCCESS,
+} from '../actions/pin_statuses';
 import { SEARCH_FETCH_SUCCESS } from '../actions/search';
 import emojify from '../emoji';
 import { Map as ImmutableMap, fromJS } from 'immutable';
@@ -138,6 +141,7 @@ export default function statuses(state = initialState, action) {
   case NOTIFICATIONS_EXPAND_SUCCESS:
   case FAVOURITED_STATUSES_FETCH_SUCCESS:
   case FAVOURITED_STATUSES_EXPAND_SUCCESS:
+  case PINNED_STATUSES_FETCH_SUCCESS:
   case SEARCH_FETCH_SUCCESS:
     return normalizeStatuses(state, action.statuses);
   case TIMELINE_DELETE:
index 2058fad9189bb5a3f7a7dff2766b4f9db72022a2..8b201ecf8ad33e23494733fb69d8d6cf8314ff86 100644 (file)
@@ -1,5 +1,22 @@
 import loadPolyfills from '../mastodon/load_polyfills';
 import { processBio } from '../glitch/util/bio_metadata';
+import ready from '../mastodon/ready';
+
+window.addEventListener('message', e => {
+  const data = e.data || {};
+
+  if (!window.parent || data.type !== 'setHeight') {
+    return;
+  }
+
+  ready(() => {
+    window.parent.postMessage({
+      type: 'setHeight',
+      id: data.id,
+      height: document.getElementsByTagName('html')[0].scrollHeight,
+    }, '*');
+  });
+});
 
 function main() {
   const { length } = require('stringz');
@@ -7,13 +24,13 @@ function main() {
   const { delegate } = require('rails-ujs');
   const emojify = require('../mastodon/emoji').default;
   const { getLocale } = require('../mastodon/locales');
-  const ready = require('../mastodon/ready').default;
-
   const { localeData } = getLocale();
+
   localeData.forEach(IntlRelativeFormat.__addLocaleData);
 
   ready(() => {
     const locale = document.documentElement.lang;
+
     const dateTimeFormat = new Intl.DateTimeFormat(locale, {
       year: 'numeric',
       month: 'long',
@@ -21,6 +38,7 @@ function main() {
       hour: 'numeric',
       minute: 'numeric',
     });
+
     const relativeFormat = new IntlRelativeFormat(locale);
 
     [].forEach.call(document.querySelectorAll('.emojify'), (content) => {
@@ -30,12 +48,14 @@ function main() {
     [].forEach.call(document.querySelectorAll('time.formatted'), (content) => {
       const datetime = new Date(content.getAttribute('datetime'));
       const formattedDate = dateTimeFormat.format(datetime);
+
       content.title = formattedDate;
       content.textContent = formattedDate;
     });
 
     [].forEach.call(document.querySelectorAll('time.time-ago'), (content) => {
       const datetime = new Date(content.getAttribute('datetime'));
+
       content.title = dateTimeFormat.format(datetime);
       content.textContent = relativeFormat.format(datetime);
     });
@@ -46,10 +66,6 @@ function main() {
         window.open(e.target.href, 'mastodon-intent', 'width=400,height=400,resizable=no,menubar=no,status=no,scrollbars=yes');
       });
     });
-
-    if (window.parent) {
-      window.parent.postMessage(['setHeight', document.getElementsByTagName('html')[0].scrollHeight], '*');
-    }
   });
 
   delegate(document, '.video-player video', 'click', ({ target }) => {
@@ -78,6 +94,7 @@ function main() {
 
   delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {
     const contentEl = target.parentNode.parentNode.querySelector('.e-content');
+
     if (contentEl.style.display === 'block') {
       contentEl.style.display = 'none';
       target.parentNode.style.marginBottom = 0;
@@ -85,11 +102,13 @@ function main() {
       contentEl.style.display = 'block';
       target.parentNode.style.marginBottom = null;
     }
+
     return false;
   });
 
   delegate(document, '.account_display_name', 'input', ({ target }) => {
     const nameCounter = document.querySelector('.name-counter');
+
     if (nameCounter) {
       nameCounter.textContent = 30 - length(target.value);
     }
@@ -97,6 +116,7 @@ function main() {
 
   delegate(document, '.account_note', 'input', ({ target }) => {
     const noteCounter = document.querySelector('.note-counter');
+
     if (noteCounter) {
       const noteWithoutMetadata = processBio(target.value).text;
       noteCounter.textContent = 500 - length(noteWithoutMetadata);
@@ -107,6 +127,7 @@ function main() {
     const avatar = document.querySelector('.card.compact .avatar img');
     const [file] = target.files || [];
     const url = URL.createObjectURL(file);
+
     avatar.src = url;
   });
 
@@ -114,6 +135,7 @@ function main() {
     const header = document.querySelector('.card.compact');
     const [file] = target.files || [];
     const url = URL.createObjectURL(file);
+
     header.style.backgroundImage = `url(${url})`;
   });
 }
index b86de75b67744a0ec184ccddb501ca7e476a4050..fa7859e38f8e7c0a2538a3587b560f4b1943e911 100644 (file)
 
 .filters {
   display: flex;
-  margin-bottom: 20px;
+  flex-wrap: wrap;
 
   .filter-subset {
     flex: 0 0 auto;
-    margin-right: 40px;
+    margin: 0 40px 10px 0;
+
+    &:last-child {
+      margin-bottom: 20px;
+    }
 
     ul {
       margin-top: 5px;
index 05c93b42e72a1f491a7e29d0840e1b246244646c..c5f98750cdd9f1c1ff5b2c149d102cb475ca7d47 100644 (file)
@@ -45,6 +45,7 @@ body {
   &.embed {
     background: transparent;
     margin: 0;
+    padding-bottom: 0;
 
     .container {
       position: absolute;
index 5573552601a85a3b8ad6c81dd03bd6e5e9a9e1d7..16a87fcd8963d8d63070d1b2277e9f788db7a03b 100644 (file)
@@ -2716,22 +2716,6 @@ button.icon-button.active i.fa-retweet {
   }
 }
 
-.media-spoiler__video {
-  align-items: center;
-  background: $base-overlay-background;
-  color: $primary-text-color;
-  cursor: pointer;
-  display: flex;
-  flex-direction: column;
-  border: 0;
-  width: 100%;
-  height: 100%;
-  justify-content: center;
-  position: relative;
-  text-align: center;
-  z-index: 100;
-}
-
 .media-spoiler__warning {
   display: block;
   font-size: 14px;
@@ -4302,6 +4286,9 @@ button.icon-button.active i.fa-retweet {
     margin-left: -68px;
     width: calc(100% + 80px);
   }
+
+  border: 0;
+  display: block;
 }
 
 .media-spoiler-video-play-icon {
index f6e57e1961a3fc52390a518921a21ef48243cfaf..ad46f5f9f50a99fe1fb4b7c1f16f0b80f08f2386 100644 (file)
@@ -3,7 +3,6 @@
   max-width: 100%;
   border-spacing: 0;
   border-collapse: collapse;
-  margin-bottom: 20px;
 
   th,
   td {
     font-weight: 500;
   }
 
-  &.inline-table {
-    td,
-    th {
-      padding: 8px 2px;
-    }
-
-    & > tbody > tr:nth-child(odd) > td,
-    & > tbody > tr:nth-child(odd) > th {
-      background: transparent;
-    }
+  &.inline-table > tbody > tr:nth-child(odd) > td,
+  &.inline-table > tbody > tr:nth-child(odd) > th {
+    background: transparent;
   }
 }
 
+.table-wrapper {
+  overflow: auto;
+  margin-bottom: 20px;
+}
+
 samp {
   font-family: 'mastodon-font-monospace', monospace;
 }
index de575d9e6f6ddbaa494614e21fde75f7711a977f..929e87852cd632b77074aabfc9235b2164e9d3ca 100644 (file)
@@ -96,12 +96,14 @@ class ActivityPub::TagManager
       when 'Account'
         klass.find_local(uri_to_local_id(uri, :username))
       else
-        klass.find_by(id: uri_to_local_id(uri))
+        StatusFinder.new(uri).status
       end
     elsif ::TagManager.instance.local_id?(uri)
       klass.find_by(id: ::TagManager.instance.unique_tag_to_local_id(uri, klass.to_s))
     else
       klass.find_by(uri: uri.split('#').first)
     end
+  rescue ActiveRecord::RecordNotFound
+    nil
   end
 end
index cc7509fdc8e9f9eace0644417c88d4389398182c..1d9932b528055e099d9a90da89b179c61ea06014 100644 (file)
@@ -20,7 +20,16 @@ class LanguageDetector
   private
 
   def detected_language_code
-    result.language.to_sym if detected_language_reliable?
+    iso6391(result.language).to_sym if detected_language_reliable?
+  end
+
+  def iso6391(bcp47)
+    iso639 = bcp47.split('-').first
+
+    # CLD3 returns grandfathered language code for Hebrew
+    return 'he' if iso639 == 'iw'
+
+    ISO_639.find(iso639).alpha2
   end
 
   def result
index 4d2552d30af43c7145f42b96552168fe0fb5c7a4..479aa17bb1ea66d533143705a4033e5ebf3f3013 100644 (file)
@@ -22,6 +22,8 @@ class Report < ApplicationRecord
   scope :unresolved, -> { where(action_taken: false) }
   scope :resolved,   -> { where(action_taken: true) }
 
+  validates :comment, length: { maximum: 1000 }
+
   def statuses
     Status.where(id: status_ids).includes(:account, :media_attachments, :mentions)
   end
index fdc230d8f661afa2c4001e73aa122c483fa6a1c4..514cab2e4d57342ff5316ff3f7b11b0fdf18aeea 100644 (file)
@@ -63,8 +63,8 @@ class Status < ApplicationRecord
   default_scope { recent }
 
   scope :recent, -> { reorder(id: :desc) }
-  scope :remote, -> { where.not(uri: nil) }
-  scope :local, -> { where(uri: nil) }
+  scope :remote, -> { where(local: false).or(where.not(uri: nil)) }
+  scope :local,  -> { where(local: true).or(where(uri: nil)) }
 
   scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
   scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
index bd05da585a7f0257e9d679ddbf8448eddcfb7cd2..af03fd47aca4885101a34fc4f2f872f9bba37549 100644 (file)
@@ -40,12 +40,12 @@ class OEmbedSerializer < ActiveModel::Serializer
     attributes = {
       src: embed_short_account_status_url(object.account, object),
       class: 'mastodon-embed',
-      style: 'max-width: 100%; border: none;',
+      style: 'max-width: 100%; border: 0',
       width: width,
       height: height,
     }
 
-    content_tag :iframe, nil, attributes
+    content_tag(:iframe, nil, attributes) + content_tag(:script, nil, src: full_asset_url('embed.js'), async: true)
   end
 
   def width
index 29eb1c2e10a1a1b422e251dfac96786048457899..b54e447ad06d7055ae1461ca3dbd01cb56e21ffe 100644 (file)
@@ -8,11 +8,12 @@ class ActivityPub::ProcessAccountService < BaseService
   def call(username, domain, json)
     return if json['inbox'].blank?
 
-    @json     = json
-    @uri      = @json['id']
-    @username = username
-    @domain   = domain
-    @account  = Account.find_by(uri: @uri)
+    @json        = json
+    @uri         = @json['id']
+    @username    = username
+    @domain      = domain
+    @account     = Account.find_by(uri: @uri)
+    @collections = {}
 
     create_account  if @account.nil?
     upgrade_account if @account.ostatus?
@@ -47,11 +48,14 @@ class ActivityPub::ProcessAccountService < BaseService
     @account.url                 = url || @uri
     @account.display_name        = @json['name'] || ''
     @account.note                = @json['summary'] || ''
-    @account.avatar_remote_url   = image_url('icon')
-    @account.header_remote_url   = image_url('image')
+    @account.avatar_remote_url   = image_url('icon')  unless skip_download?
+    @account.header_remote_url   = image_url('image') unless skip_download?
     @account.public_key          = public_key || ''
     @account.locked              = @json['manuallyApprovesFollowers'] || false
-    @account.save!
+    @account.statuses_count      = outbox_total_items    if outbox_total_items.present?
+    @account.following_count     = following_total_items if following_total_items.present?
+    @account.followers_count     = followers_total_items if followers_total_items.present?
+    @account.save_with_optional_media!
   end
 
   def upgrade_account
@@ -88,6 +92,33 @@ class ActivityPub::ProcessAccountService < BaseService
     value['href']
   end
 
+  def outbox_total_items
+    collection_total_items('outbox')
+  end
+
+  def following_total_items
+    collection_total_items('following')
+  end
+
+  def followers_total_items
+    collection_total_items('followers')
+  end
+
+  def collection_total_items(type)
+    return if @json[type].blank?
+    return @collections[type] if @collections.key?(type)
+
+    collection = fetch_resource(@json[type])
+
+    @collections[type] = collection.is_a?(Hash) && collection['totalItems'].present? && collection['totalItems'].is_a?(Numeric) ? collection['totalItems'] : nil
+  rescue HTTP::Error, OpenSSL::SSL::SSLError
+    @collections[type] = nil
+  end
+
+  def skip_download?
+    @account.suspended? || domain_block&.reject_media?
+  end
+
   def auto_suspend?
     domain_block && domain_block.suspend?
   end
index a92eb6b888150a3a7e92a466c77ed91906625c35..941556b60462f0301dd58652377963fa589fd349 100644 (file)
@@ -12,7 +12,7 @@ class FollowService < BaseService
     raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
     raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account)
 
-    return if source_account.following?(target_account)
+    return if source_account.following?(target_account) || source_account.requested?(target_account)
 
     if target_account.locked? || target_account.activitypub?
       request_follow(source_account, target_account)
index 56011a0056b2ecaaf38183cc38d6a15c55b2dc25..e5b0fe438e7d907fcafcdf65546d0fadc035f454 100644 (file)
@@ -27,9 +27,10 @@ class PostStatusService < BaseService
                                         thread: in_reply_to,
                                         sensitive: options[:sensitive],
                                         spoiler_text: options[:spoiler_text] || '',
-                                        visibility: options[:visibility],
+                                        visibility: options[:visibility] || account.user&.setting_default_privacy,
                                         language: detect_language_for(text, account),
                                         application: options[:application])
+
       attach_media(status, media)
     end
 
index 865f783bc84adfe9fdef19e73bbdf90f7341ec0e..b99046712c7a8fe6186365c48ce2c70fba997c68 100644 (file)
@@ -4,16 +4,19 @@ class UnsubscribeService < BaseService
   def call(account)
     return if account.hub_url.blank?
 
-    @account  = account
-    @response = build_request.perform
+    @account = account
 
-    Rails.logger.debug "PuSH unsubscribe for #{@account.acct} failed: #{@response.status}" unless @response.status.success?
+    begin
+      @response = build_request.perform
+
+      Rails.logger.debug "PuSH unsubscribe for #{@account.acct} failed: #{@response.status}" unless @response.status.success?
+    rescue HTTP::Error, OpenSSL::SSL::SSLError => e
+      Rails.logger.debug "PuSH unsubscribe for #{@account.acct} failed: #{e}"
+    end
 
     @account.secret = ''
     @account.subscription_expires_at = nil
     @account.save!
-  rescue HTTP::Error, OpenSSL::SSL::SSLError
-    Rails.logger.debug "PuSH subscription request for #{@account.acct} could not be made due to HTTP or SSL error"
   end
 
   private
index bb33582eba6820fcb055389e60d9f353f520defe..2f59550113fa5188600adea6a7887f8b38324578 100644 (file)
@@ -1,16 +1,17 @@
-%table.table
-  %tbody
-    %tr
-      %td= t('admin.accounts.show.created_reports')
-      %td= link_to pluralize(account.reports.count, t('admin.accounts.show.report')), admin_reports_path(account_id: account.id)
-    %tr
-      %td= t('admin.accounts.show.targeted_reports')
-      %td= link_to pluralize(account.targeted_reports.count, t('admin.accounts.show.report')), admin_reports_path(target_account_id: account.id)
-    - if account.silenced? || account.suspended?
+.table-wrapper
+  %table.table
+    %tbody
       %tr
-        %td= t('admin.accounts.moderation.title')
-        %td
-          - if account.silenced?
-            %p= t('admin.accounts.moderation.silenced')
-          - if account.suspended?
-            %p= t('admin.accounts.moderation.suspended')
+        %td= t('admin.accounts.show.created_reports')
+        %td= link_to pluralize(account.reports.count, t('admin.accounts.show.report')), admin_reports_path(account_id: account.id)
+      %tr
+        %td= t('admin.accounts.show.targeted_reports')
+        %td= link_to pluralize(account.targeted_reports.count, t('admin.accounts.show.report')), admin_reports_path(target_account_id: account.id)
+      - if account.silenced? || account.suspended?
+        %tr
+          %td= t('admin.accounts.moderation.title')
+          %td
+            - if account.silenced?
+              %p= t('admin.accounts.moderation.silenced')
+            - if account.suspended?
+              %p= t('admin.accounts.moderation.suspended')
index 1f36aeb312b9c38a4553f1c79057b24ec5b770a8..1b56a3a3164128437dc9a2c07d9816a5a6b9670a 100644 (file)
       %button= t('admin.accounts.search')
       = link_to t('admin.accounts.reset'), admin_accounts_path, class: 'button negative'
 
-%table.table
-  %thead
-    %tr
-      %th= t('admin.accounts.username')
-      %th= t('admin.accounts.domain')
-      %th= t('admin.accounts.protocol')
-      %th= t('admin.accounts.confirmed')
-      %th= fa_icon 'paper-plane-o'
-      %th
-  %tbody
-    = render @accounts
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('admin.accounts.username')
+        %th= t('admin.accounts.domain')
+        %th= t('admin.accounts.protocol')
+        %th= t('admin.accounts.confirmed')
+        %th= fa_icon 'paper-plane-o'
+        %th
+    %tbody
+      = render @accounts
 
 = paginate @accounts
index dc2f16cc99ce1bb69bc57a7710f1ec5d8ccf6cdb..89355281a39b7065f14b642946aeae4d2057cd6d 100644 (file)
@@ -1,86 +1,86 @@
 - content_for :page_title do
   = @account.acct
 
-%table.table
-  %tbody
-    %tr
-      %th= t('admin.accounts.username')
-      %td= @account.username
-    %tr
-      %th= t('admin.accounts.domain')
-      %td= @account.domain
-    %tr
-      %th= t('admin.accounts.display_name')
-      %td= @account.display_name
-
-    - if @account.local?
-      %tr
-        %th= t('admin.accounts.email')
-        %td= @account.user_email
+.table-wrapper
+  %table.table
+    %tbody
       %tr
-        %th= t('admin.accounts.most_recent_ip')
-        %td= @account.user_current_sign_in_ip
-      %tr
-        %th= t('admin.accounts.most_recent_activity')
-        %td
-          - if @account.user_current_sign_in_at
-            %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }
-              = l @account.user_current_sign_in_at
-          - else
-            Never
-    - else
+        %th= t('admin.accounts.username')
+        %td= @account.username
       %tr
-        %th= t('admin.accounts.profile_url')
-        %td= link_to @account.url, @account.url
+        %th= t('admin.accounts.domain')
+        %td= @account.domain
       %tr
-        %th= t('admin.accounts.protocol')
-        %td= @account.protocol.humanize
+        %th= t('admin.accounts.display_name')
+        %td= @account.display_name
 
-      - if @account.ostatus?
+      - if @account.local?
         %tr
-          %th= t('admin.accounts.feed_url')
-          %td= link_to @account.remote_url, @account.remote_url
+          %th= t('admin.accounts.email')
+          %td= @account.user_email
         %tr
-          %th= t('admin.accounts.push_subscription_expires')
+          %th= t('admin.accounts.most_recent_ip')
+          %td= @account.user_current_sign_in_ip
+        %tr
+          %th= t('admin.accounts.most_recent_activity')
           %td
-            - if @account.subscribed?
-              %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
-                = l @account.subscription_expires_at
+            - if @account.user_current_sign_in_at
+              %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }
+                = l @account.user_current_sign_in_at
             - else
-              = t('admin.accounts.not_subscribed')
-        %tr
-          %th= t('admin.accounts.salmon_url')
-          %td= link_to @account.salmon_url, @account.salmon_url
-      - elsif @account.activitypub?
+              Never
+      - else
         %tr
-          %th= t('admin.accounts.inbox_url')
-          %td= link_to @account.inbox_url, @account.inbox_url
+          %th= t('admin.accounts.profile_url')
+          %td= link_to @account.url, @account.url
         %tr
-          %th= t('admin.accounts.outbox_url')
-          %td= link_to @account.outbox_url, @account.outbox_url
+          %th= t('admin.accounts.protocol')
+          %td= @account.protocol.humanize
 
-    %tr
-      %th= t('admin.accounts.follows')
-      %td= @account.following_count
-    %tr
-      %th= t('admin.accounts.followers')
-      %td= @account.followers_count
-    %tr
-      %th= t('admin.accounts.statuses')
-      %td= link_to @account.statuses_count, admin_account_statuses_path(@account.id)
-    %tr
-      %th= t('admin.accounts.media_attachments')
-      %td
-        = link_to @account.media_attachments.count, admin_account_statuses_path(@account.id, { media: true })
-        = surround '(', ')' do
-          = number_to_human_size @account.media_attachments.sum('file_file_size')
-    %tr
-      %th= t('.created_reports')
-      %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
-    %tr
-      %th= t('.targeted_reports')
-      %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
+        - if @account.ostatus?
+          %tr
+            %th= t('admin.accounts.feed_url')
+            %td= link_to @account.remote_url, @account.remote_url
+          %tr
+            %th= t('admin.accounts.push_subscription_expires')
+            %td
+              - if @account.subscribed?
+                %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
+                  = l @account.subscription_expires_at
+              - else
+                = t('admin.accounts.not_subscribed')
+          %tr
+            %th= t('admin.accounts.salmon_url')
+            %td= link_to @account.salmon_url, @account.salmon_url
+        - elsif @account.activitypub?
+          %tr
+            %th= t('admin.accounts.inbox_url')
+            %td= link_to @account.inbox_url, @account.inbox_url
+          %tr
+            %th= t('admin.accounts.outbox_url')
+            %td= link_to @account.outbox_url, @account.outbox_url
 
+      %tr
+        %th= t('admin.accounts.follows')
+        %td= @account.following_count
+      %tr
+        %th= t('admin.accounts.followers')
+        %td= @account.followers_count
+      %tr
+        %th= t('admin.accounts.statuses')
+        %td= link_to @account.statuses_count, admin_account_statuses_path(@account.id)
+      %tr
+        %th= t('admin.accounts.media_attachments')
+        %td
+          = link_to @account.media_attachments.count, admin_account_statuses_path(@account.id, { media: true })
+          = surround '(', ')' do
+            = number_to_human_size @account.media_attachments.sum('file_file_size')
+      %tr
+        %th= t('.created_reports')
+        %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
+      %tr
+        %th= t('.targeted_reports')
+        %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
 
 %div{ style: 'float: right' }
   - if @account.local?
index 5ae9fec5305182bf0692bf4c36fb7533132b757e..42b8ca53f484fa2af4527c14c0f9f8094635334a 100644 (file)
@@ -1,15 +1,16 @@
 - content_for :page_title do
   = t('admin.domain_blocks.title')
 
-%table.table
-  %thead
-    %tr
-      %th= t('admin.domain_blocks.domain')
-      %th= t('admin.domain_blocks.severity')
-      %th= t('admin.domain_blocks.reject_media')
-      %th
-  %tbody
-    = render @domain_blocks
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('admin.domain_blocks.domain')
+        %th= t('admin.domain_blocks.severity')
+        %th= t('admin.domain_blocks.reject_media')
+        %th
+    %tbody
+      = render @domain_blocks
 
 = paginate @domain_blocks
 = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button'
index be21d6bf7b88ff5a5056e2619f6f790005075ef0..edbd3b2173d5e0c471cafba411d1119039ac60bb 100644 (file)
@@ -1,12 +1,13 @@
 - content_for :page_title do
   = t('admin.instances.title')
 
-%table.table
-  %thead
-    %tr
-      %th= t('admin.instances.domain_name')
-      %th= t('admin.instances.account_count')
-  %tbody
-    = render @instances
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('admin.instances.domain_name')
+        %th= t('admin.instances.account_count')
+    %tbody
+      = render @instances
 
 = paginate paginated_instances
index f1c4a93c47180359f230ebef3bf03d726c97c1c9..577c68a86403597d574b71e6fda3773cfb887495 100644 (file)
 
 = form_tag do
 
-  %table.table
-    %thead
-      %tr
-        -# %th
-        %th= t('admin.reports.id')
-        %th= t('admin.reports.target')
-        %th= t('admin.reports.reported_by')
-        %th= t('admin.reports.comment.label')
-        %th= t('admin.reports.report_contents')
-        %th
-    %tbody
-      = render @reports
+  .table-wrapper
+    %table.table
+      %thead
+        %tr
+          -# %th
+          %th= t('admin.reports.id')
+          %th= t('admin.reports.target')
+          %th= t('admin.reports.reported_by')
+          %th= t('admin.reports.comment.label')
+          %th= t('admin.reports.report_contents')
+          %th
+      %tbody
+        = render @reports
 
 = paginate @reports
index 21b3238a6baac02b03bf27cb0c0300f1ecd09ff7..83704c8ee5bbff940f92baf48906af87b19a6ec8 100644 (file)
@@ -1,15 +1,16 @@
 - content_for :page_title do
   = t('admin.subscriptions.title')
 
-%table.table
-  %thead
-    %tr
-      %th= t('admin.subscriptions.topic')
-      %th= t('admin.subscriptions.callback_url')
-      %th= t('admin.subscriptions.confirmed')
-      %th= t('admin.subscriptions.expires_in')
-      %th= t('admin.subscriptions.last_delivery')
-  %tbody
-    = render @subscriptions
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('admin.subscriptions.topic')
+        %th= t('admin.subscriptions.callback_url')
+        %th= t('admin.subscriptions.confirmed')
+        %th= t('admin.subscriptions.expires_in')
+        %th= t('admin.subscriptions.last_delivery')
+    %tbody
+      = render @subscriptions
 
 = paginate @subscriptions
index 7ac578bb179b917a69b0bd7a71c8fab6c8ab08cb..c1e9764b3c2bc2887df6acbfe71c77da3a9e9a4e 100644 (file)
@@ -1,28 +1,29 @@
 %h6= t 'sessions.title'
 %p.muted-hint= t 'sessions.explanation'
 
-%table.table.inline-table
-  %thead
-    %tr
-      %th= t 'sessions.browser'
-      %th= t 'sessions.ip'
-      %th= t 'sessions.activity'
-      %td
-  %tbody
-    - @sessions.each do |session|
+.table-wrapper
+  %table.table.inline-table
+    %thead
       %tr
+        %th= t 'sessions.browser'
+        %th= t 'sessions.ip'
+        %th= t 'sessions.activity'
         %td
-          %span{ title: session.user_agent }<
-            = fa_icon "#{session_device_icon(session)} fw", 'aria-label' => session_device_icon(session)
-            = ' '
-            = t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
-        %td
-          %samp= session.ip
-        %td
-          - if current_session.session_id == session.session_id
-            = t 'sessions.current_session'
-          - else
-            %time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
-        %td
-          - if current_session.session_id != session.session_id
-            = table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete
+    %tbody
+      - @sessions.each do |session|
+        %tr
+          %td
+            %span{ title: session.user_agent }<
+              = fa_icon "#{session_device_icon(session)} fw", 'aria-label' => session_device_icon(session)
+              = ' '
+              = t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
+          %td
+            %samp= session.ip
+          %td
+            - if current_session.session_id == session.session_id
+              = t 'sessions.current_session'
+            - else
+              %time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
+          %td
+            - if current_session.session_id != session.session_id
+              = table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete
index ba0c084950cb3e5fc3abd35a3685082f0bc4a1e0..19af5f55db28456bac549ecba8be2b5a249178f3 100644 (file)
@@ -1,23 +1,24 @@
 - content_for :page_title do
   = t('doorkeeper.authorized_applications.index.title')
 
-%table.table
-  %thead
-    %tr
-      %th= t('doorkeeper.authorized_applications.index.application')
-      %th= t('doorkeeper.authorized_applications.index.scopes')
-      %th= t('doorkeeper.authorized_applications.index.created_at')
-      %th
-  %tbody
-    - @applications.each do |application|
+.table-wrapper
+  %table.table
+    %thead
       %tr
-        %td
-          - if application.website.blank?
-            = application.name
-          - else
-            = link_to application.name, application.website, target: '_blank', rel: 'noopener'
-        %th!= application.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.join('<br />')
-        %td= l application.created_at
-        %td
-          - unless application.superapp?
-            = table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
+        %th= t('doorkeeper.authorized_applications.index.application')
+        %th= t('doorkeeper.authorized_applications.index.scopes')
+        %th= t('doorkeeper.authorized_applications.index.created_at')
+        %th
+    %tbody
+      - @applications.each do |application|
+        %tr
+          %td
+            - if application.website.blank?
+              = application.name
+            - else
+              = link_to application.name, application.website, target: '_blank', rel: 'noopener'
+          %th!= application.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.join('<br />')
+          %td= l application.created_at
+          %td
+            - unless application.superapp?
+              = table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
index eea550388a9693c68478ed200f9d3783dd1c66ec..919472c2e8babc0cc9ec5e605574b499a1f8eb77 100644 (file)
@@ -1,19 +1,20 @@
 - content_for :page_title do
   = t('doorkeeper.applications.index.title')
 
-%table.table
-  %thead
-    %tr
-      %th= t('doorkeeper.applications.index.application')
-      %th= t('doorkeeper.applications.index.scopes')
-      %th
-  %tbody
-    - @applications.each do |application|
+.table-wrapper
+  %table.table
+    %thead
       %tr
-        %td= link_to application.name, settings_application_path(application)
-        %th= application.scopes
-        %td
-          = table_link_to 'times', t('doorkeeper.applications.index.delete'), settings_application_path(application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy') }
+        %th= t('doorkeeper.applications.index.application')
+        %th= t('doorkeeper.applications.index.scopes')
+        %th
+    %tbody
+      - @applications.each do |application|
+        %tr
+          %td= link_to application.name, settings_application_path(application)
+          %th= application.scopes
+          %td
+            = table_link_to 'times', t('doorkeeper.applications.index.delete'), settings_application_path(application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy') }
 
 = paginate @applications
 = link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
index 4d8555111169ed67af925a9f1aad7d185af93cf3..12baed088133ecffbc46b8b13373a9bae6d63e0f 100644 (file)
@@ -3,22 +3,23 @@
 
 %p.hint= t('applications.warning')
 
-%table.table
-  %tbody
-    %tr  
-      %th= t('doorkeeper.applications.show.application_id')
-      %td
-        %code= @application.uid
-    %tr
-      %th= t('doorkeeper.applications.show.secret')
-      %td
-        %code= @application.secret
-    %tr
-      %th{ rowspan: 2}= t('applications.your_token')
-      %td
-        %code= current_user.token_for_app(@application).token
-    %tr
-      %td= table_link_to 'refresh', t('applications.regenerate_token'), regenerate_settings_application_path(@application), method: :post
+.table-wrapper
+  %table.table
+    %tbody
+      %tr  
+        %th= t('doorkeeper.applications.show.application_id')
+        %td
+          %code= @application.uid
+      %tr
+        %th= t('doorkeeper.applications.show.secret')
+        %td
+          %code= @application.secret
+      %tr
+        %th{ rowspan: 2}= t('applications.your_token')
+        %td
+          %code= current_user.token_for_app(@application).token
+      %tr
+        %td= table_link_to 'refresh', t('applications.regenerate_token'), regenerate_settings_application_path(@application), method: :post
 
 %hr/
 
index f2f6f95563efd7730fe7a36a025010ae99d40707..e0df1c48023d35df147591d5f71da8817581096b 100644 (file)
@@ -1,21 +1,22 @@
 - content_for :page_title do
   = t('settings.export')
 
-%table.table
-  %tbody
-    %tr
-      %th= t('exports.storage')
-      %td= number_to_human_size @export.total_storage
-      %td
-    %tr
-      %th= t('exports.follows')
-      %td= @export.total_follows
-      %td= table_link_to 'download', t('exports.csv'), settings_exports_follows_path(format: :csv)
-    %tr
-      %th= t('exports.blocks')
-      %td= @export.total_blocks
-      %td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv)
-    %tr
-      %th= t('exports.mutes')
-      %td= @export.total_mutes
-      %td= table_link_to 'download', t('exports.csv'), settings_exports_mutes_path(format: :csv)
+.table-wrapper
+  %table.table
+    %tbody
+      %tr
+        %th= t('exports.storage')
+        %td= number_to_human_size @export.total_storage
+        %td
+      %tr
+        %th= t('exports.follows')
+        %td= @export.total_follows
+        %td= table_link_to 'download', t('exports.csv'), settings_exports_follows_path(format: :csv)
+      %tr
+        %th= t('exports.blocks')
+        %td= @export.total_blocks
+        %td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv)
+      %tr
+        %th= t('exports.mutes')
+        %td= @export.total_mutes
+        %td= table_link_to 'download', t('exports.csv'), settings_exports_mutes_path(format: :csv)
index dad2770f10811f9d685c9c88fde67b14175231ef..f1687d4d2f176ed70c3ae28e99914ac56bee2168 100644 (file)
   %p= t('followers.explanation_html')
   %p= t('followers.true_privacy_html')
 
-  %table.table
-    %thead
-      %tr
-        %th
-        %th= t('followers.domain')
-        %th= t('followers.followers_count')
-    %tbody
-      - @domains.each do |domain|
+  .table-wrapper
+    %table.table
+      %thead
         %tr
-          %td
-            = check_box_tag 'select[]', domain.domain, false, disabled: !@account.locked? unless domain.domain.nil?
-          %td
-            %samp= domain.domain.presence || Rails.configuration.x.local_domain
-          %td= number_with_delimiter domain.accounts_from_domain
+          %th
+          %th= t('followers.domain')
+          %th= t('followers.followers_count')
+      %tbody
+        - @domains.each do |domain|
+          %tr
+            %td
+              = check_box_tag 'select[]', domain.domain, false, disabled: !@account.locked? unless domain.domain.nil?
+            %td
+              %samp= domain.domain.presence || Rails.configuration.x.local_domain
+            %td= number_with_delimiter domain.accounts_from_domain
 
   .action-pagination
     .actions
index fae6090c81b31f057a4f7bf1a3b945d578ee108d..f42f92508075effedcb2cb2cc9bf2ee680edc0ca 100644 (file)
@@ -13,7 +13,7 @@
       selected: I18n.locale
 
     = f.input :filtered_languages,
-      collection: I18n.available_locales,
+      collection: filterable_languages,
       wrapper: :with_block_label,
       include_blank: false,
       label_method: lambda { |locale| human_locale(locale) },
index 9e9732bd8b180e54a4fc4fd51e1176b2039a2b83..ed1428a55c42a5a0505c1e3b1feeb83a4eac2411 100644 (file)
@@ -1,8 +1,8 @@
-<p>Bonjorn <%= @resource.email %>&nbsp;!<p>
+<p>Bonjorn <%= @resource.email %> ! <p>
 
 <p>Venètz de vos crear un compte sus <%= @instance %> e vos mercegem :)</p>
 
-<p>Per confirmar vòstre inscripcion, mercés de clicar sul ligam seguent : <br>
+<p>Per confirmar vòstre inscripcion, mercés de clicar sul ligam seguent : <br>
 <%= link_to 'Confirmar mon compte', confirmation_url(@resource, confirmation_token: @token) %></p>
 
 <p>Aprèp vòstra primièra connexion, poiretz accedir a la documentacion de l’aisina.</p>
index ff1abf62dd7ef4468c9b7732fd47a35a3db42db0..444d296ce68c2eb641ca3ea63aca7a11804b9583 100644 (file)
@@ -1,8 +1,8 @@
-Bonjorn <%= @resource.email %>&nbsp;!
+Bonjorn <%= @resource.email %> ! 
 
 Venètz de vos crear un compte sus <%= @instance %> e vos mercegem :)
 
-er confirmar vòstre inscripcion, mercés de clicar sul ligam seguent :
+er confirmar vòstre inscripcion, mercés de clicar sul ligam seguent : 
 <%= link_to 'Confirmar mon compte', confirmation_url(@resource, confirmation_token: @token) %>
 
 Aprèp vòstra primièra connexion, poiretz accedir a la documentacion de l’aisina.
index a6b506f5e07b009ec26219489d15dc982fd0c491..476db95366fc730553652379ff130ba4b106cd15 100644 (file)
@@ -1,3 +1,3 @@
-<p>Bonjorn <%= @resource.email %>&nbsp;!</p>
+<p>Bonjorn <%= @resource.email %> ! </p>
 
-<p>Vos contactem per vos avisar que vòstre senhal per Mastodon es ben estat cambiat.</p>
+<p>Vos contactem per vos avisar qu’avèm ben cambiat vòstre senhal Mastodon.</p>
index 1caebde69a1673241912166cc9c2acd819fa4820..e6caa045cd77dd8edadfe6e6a89615c547d4fd15 100644 (file)
@@ -1,3 +1,3 @@
-Bonjorn <%= @resource.email %>&nbsp;!
+Bonjorn <%= @resource.email %> ! 
 
-Vos contactem per vos avisar que vòstre senhal per Mastodon es ben estat cambiat.
+Vos contactem per vos avisar qu’avèm ben cambiat vòstre senhal Mastodon.
index acf2c0abde159942952c922dc04eb0fe202df388..7363ee4b6a53ced09ca90625d23c578c1a794792 100644 (file)
@@ -1,4 +1,4 @@
-<p>Bonjorn <%= @resource.email %>&nbsp;!</p>
+<p>Bonjorn <%= @resource.email %> ! </p>
 
 <p>Qualqu’un a demandat una reĩnicializacion de vòstre senhal per Mastodon. Podètz realizar la reĩnicializacion en clicant sul ligam çai-jos.</p>
 
index 211974cc27069586f3b19507357cfcdfcd6886f9..a95a1ae8cd3cc90ef5f0ab3f5afb2f33c5cbcc69 100644 (file)
@@ -1,4 +1,4 @@
-Bonjorn <%= @resource.email %>&nbsp;!
+Bonjorn <%= @resource.email %> ! 
 
 Qualqu’un a demandat una reĩnicializacion de vòstre senhal per Mastodon. Podètz realizar la reĩnicializacion en clicant sul ligam çai-jos.</p>
 
index 61e13133647a0f448575e012bfd5f27dd3c0ec8b..0ee77730e8ae0e3bcf6713a8f611629e65161b7f 100644 (file)
@@ -9,6 +9,9 @@ end
 
 Sidekiq.configure_server do |config|
   config.redis = redis_params
+  config.client_middleware do |chain|
+    chain.add Mastodon::UniqueRetryJobMiddleware
+  end
 end
 
 Sidekiq.configure_client do |config|
index 842baef451dce23ac9b84f87ca1d585768df97a0..88125f69232ae4c0caee52d1b89a644fef6f2c97 100644 (file)
@@ -451,11 +451,11 @@ pl:
     show_more: Pokaż więcej
     visibilities:
       private: Tylko dla śledzących
-      private_long: Widoczny tylko dla osób, które Cię śledzą
-      public: Publiczny
-      public_long: Widoczny dla wszystkich użytkowników
-      unlisted: Niewypisany
-      unlisted_long: Widoczny dla wszystkich, ale nie wyświetlany na publicznych osiach czasu
+      private_long: Widoczne tylko dla osób, które Cię śledzą
+      public: Publiczne
+      public_long: Widoczne dla wszystkich użytkowników
+      unlisted: Niewypisane
+      unlisted_long: Widoczne dla wszystkich, ale nie wyświetlane na publicznych osiach czasu
   stream_entries:
     click_to_show: Naciśnij aby wyświetlić
     pinned: Przypięty wpis
index de2516d6c29112febf1cf6ab4f82f377c586dd88..3ab705e2608da753ba53c0df971f8948d7019079 100644 (file)
@@ -21,7 +21,7 @@ module Mastodon
     end
 
     def flags
-      'rc2'
+      'rc4'
     end
 
     def to_a
index 307bc240db64d52cddaebcd67a0cd1fff9900406..3c65ece4bea2d34277d5f67f23a0174b9c75a305 100644 (file)
@@ -47,7 +47,7 @@ namespace :mastodon do
     confirm = STDIN.gets.chomp
     puts
 
-    if confirm.casecmp?('y')
+    if confirm.casecmp('y').zero?
       password = SecureRandom.hex
       user = User.new(email: email, password: password, account_attributes: { username: username })
       if user.save
@@ -289,13 +289,13 @@ namespace :mastodon do
       puts 'Delete records and associated files from deprecated preview cards? [y/N]: '
       confirm = STDIN.gets.chomp
 
-      if confirm.casecmp?('y')
+      if confirm.casecmp('y').zero?
         DeprecatedPreviewCard.in_batches.destroy_all
 
         puts 'Drop deprecated preview cards table? [y/N]: '
         confirm = STDIN.gets.chomp
 
-        if confirm.casecmp?('y')
+        if confirm.casecmp('y').zero?
           ActiveRecord::Migration.drop_table :deprecated_preview_cards
         end
       end
diff --git a/public/embed.js b/public/embed.js
new file mode 100644 (file)
index 0000000..dac5074
--- /dev/null
@@ -0,0 +1,43 @@
+(function() {
+  'use strict';
+
+  var ready = function(loaded) {
+    if (['interactive', 'complete'].indexOf(document.readyState) !== -1) {
+      loaded();
+    } else {
+      document.addEventListener('DOMContentLoaded', loaded);
+    }
+  };
+
+  ready(function() {
+    var iframes = [];
+
+    window.addEventListener('message', function(e) {
+      var data = e.data || {};
+
+      if (data.type !== 'setHeight' || !iframes[data.id]) {
+        return;
+      }
+
+      iframes[data.id].height = data.height;
+    });
+
+    [].forEach.call(document.querySelectorAll('iframe.mastodon-embed'), function(iframe) {
+      iframe.scrolling      = 'no';
+      iframe.style.overflow = 'hidden';
+
+      iframes.push(iframe);
+
+      var id = iframes.length - 1;
+
+      iframe.onload = function() {
+        iframe.contentWindow.postMessage({
+          type: 'setHeight',
+          id: id,
+        }, '*');
+      };
+
+      iframe.onload();
+    });
+  });
+})();
index 5a51e0ef1f190b70c945c745f5ff8d38b87818a2..092c37583699f0186a2f03f6670678ba52ab7f51 100644 (file)
@@ -4,10 +4,10 @@ require 'rails_helper'
 
 describe SettingsHelper do
   describe 'the HUMAN_LOCALES constant' do
-    it 'has the same number of keys as I18n locales exist' do
+    it 'includes all I18n locales' do
       options = I18n.available_locales
 
-      expect(described_class::HUMAN_LOCALES.keys).to eq(options)
+      expect(described_class::HUMAN_LOCALES.keys).to include(*options)
     end
   end
 
index 0bd6d00d9cafb51d673cdfd9e5b30460867e0cfa..ea308e35cd532dc320992224c9a178704e19f19c 100644 (file)
@@ -2,12 +2,16 @@ require 'rails_helper'
 
 RSpec.describe ActivityPub::Activity::Update do
   let!(:sender) { Fabricate(:account) }
-  
+
   before do
+    stub_request(:get, actor_json[:outbox]).to_return(status: 404)
+    stub_request(:get, actor_json[:followers]).to_return(status: 404)
+    stub_request(:get, actor_json[:following]).to_return(status: 404)
+
     sender.update!(uri: ActivityPub::TagManager.instance.uri_for(sender))
   end
 
-  let(:modified_sender) do 
+  let(:modified_sender) do
     sender.dup.tap do |modified_sender|
       modified_sender.display_name = 'Totally modified now'
     end
index 8f7662e24a39c14b4f305688e0d12d2229b038e1..dea8abc6559496db33acc789ce6d24906d105acf 100644 (file)
@@ -91,9 +91,35 @@ RSpec.describe ActivityPub::TagManager do
   end
 
   describe '#uri_to_resource' do
-    it 'returns the local resource' do
+    it 'returns the local account' do
       account = Fabricate(:account)
       expect(subject.uri_to_resource(subject.uri_for(account), Account)).to eq account
     end
+
+    it 'returns the remote account by matching URI without fragment part' do
+      account = Fabricate(:account, uri: 'https://example.com/123')
+      expect(subject.uri_to_resource('https://example.com/123#456', Account)).to eq account
+    end
+
+    it 'returns the local status for ActivityPub URI' do
+      status = Fabricate(:status)
+      expect(subject.uri_to_resource(subject.uri_for(status), Status)).to eq status
+    end
+
+    it 'returns the local status for OStatus tag: URI' do
+      status = Fabricate(:status)
+      expect(subject.uri_to_resource(::TagManager.instance.uri_for(status), Status)).to eq status
+    end
+
+    it 'returns the local status for OStatus StreamEntry URL' do
+      status = Fabricate(:status)
+      stream_entry_url = account_stream_entry_url(status.account, status.stream_entry)
+      expect(subject.uri_to_resource(stream_entry_url, Status)).to eq status
+    end
+
+    it 'returns the remote status by matching URI without fragment part' do
+      status = Fabricate(:status, uri: 'https://example.com/123')
+      expect(subject.uri_to_resource('https://example.com/123#456', Status)).to eq status
+    end
   end
 end
index 6c2723845709653afbef837f05d8c222de48140b..d40ebf6dc3dee8dbd9e84a19bc8284cfcca5dab6 100644 (file)
@@ -21,4 +21,18 @@ describe Report do
       expect(report.media_attachments).to eq [media_attachment]
     end
   end
+
+  describe 'validatiions' do
+    it 'has a valid fabricator' do
+      report = Fabricate(:report)
+      report.valid?
+      expect(report).to be_valid
+    end
+
+    it 'is invalid if comment is longer than 1000 characters' do
+      report = Fabricate.build(:report, comment: Faker::Lorem.characters(1001))
+      report.valid?
+      expect(report).to model_have_error_on_field(:comment)
+    end
+  end
 end
index 391d051c1a1388bf3d7659ae878a35f3aaea6140..ed7e9bba839f480a7c75c8fccc45df604c7be25b 100644 (file)
@@ -41,7 +41,7 @@ RSpec.describe ActivityPub::FetchRemoteAccountService do
 
       before do
         actor[:inbox] = nil
-        
+
         stub_request(:get, 'https://example.com/alice').to_return(body: Oj.dump(actor))
         stub_request(:get, 'https://example.com/.well-known/webfinger?resource=acct:alice@example.com').to_return(body: Oj.dump(webfinger), headers: { 'Content-Type': 'application/jrd+json' })
       end
index c81772037e15ccf9a76897ade9a2e9a2c7c50061..2a02f4c75559af9a402d271fb355aa0825c7dcfc 100644 (file)
@@ -26,7 +26,7 @@ RSpec.describe UnsubscribeService do
     stub_request(:post, 'http://hub.example.com/').to_raise(HTTP::Error)
     subject.call(account)
 
-    expect(logger).to have_received(:debug).with(/PuSH subscription request for bob@example.com could not be made due to HTTP or SSL error/)
+    expect(logger).to have_received(:debug).with(/unsubscribe for bob@example.com failed/)
   end
 
   def stub_logger
This page took 0.176637 seconds and 4 git commands to generate.