From 3cc3992d1d04515321c5c5c3a1b477926c45f5b9 Mon Sep 17 00:00:00 2001 From: Z Date: Wed, 8 Jul 2020 12:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4orig=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BB=86=E8=8A=82=20=E5=8C=BF=E5=90=8D=E5=8F=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/statuses_controller.rb | 11 +- .../api/v1/statuses_controller.rb.orig | 126 ---- app/helpers/statuses_helper.rb.orig | 218 ------ .../mastodon/components/icon_button.js.orig | 153 ---- .../mastodon/components/status.js.orig | 631 ---------------- .../components/status_action_bar.js.orig | 349 --------- .../containers/status_container.js.orig | 286 -------- .../features/getting_started/index.js.orig | 183 ----- .../status/components/action_bar.js.orig | 294 -------- .../status/components/detailed_status.js.orig | 271 ------- .../mastodon/features/status/index.js.orig | 673 ------------------ .../ui/components/columns_area.js.orig | 247 ------- .../ui/components/navigation_panel.js.orig | 41 -- .../mastodon/locales/zh-HK.json.orig | 475 ------------ app/models/status.rb.orig | 523 -------------- app/serializers/initial_state_serializer.rb | 2 +- app/services/fetch_link_card_service.rb.orig | 182 ----- app/views/about/_registration.html.haml.orig | 39 - app/views/about/show.html.haml.orig | 91 --- app/views/accounts/show.html.haml.orig | 91 --- .../statuses/_detailed_status.html.haml.orig | 87 --- .../statuses/_simple_status.html.haml.orig | 81 --- app/views/tags/show.html.haml.orig | 22 - config/initializers/2_whitelist_mode.rb.orig | 9 - config/initializers/blacklists.rb | 1 - config/initializers/blacklists.rb.orig | 12 - config/initializers/new_features.rb | 7 + config/locales/doorkeeper.zh-TW.yml.orig | 159 ----- package.json.orig | 207 ------ 29 files changed, 14 insertions(+), 5457 deletions(-) delete mode 100644 app/controllers/api/v1/statuses_controller.rb.orig delete mode 100644 app/helpers/statuses_helper.rb.orig delete mode 100644 app/javascript/mastodon/components/icon_button.js.orig delete mode 100644 app/javascript/mastodon/components/status.js.orig delete mode 100644 app/javascript/mastodon/components/status_action_bar.js.orig delete mode 100644 app/javascript/mastodon/containers/status_container.js.orig delete mode 100644 app/javascript/mastodon/features/getting_started/index.js.orig delete mode 100644 app/javascript/mastodon/features/status/components/action_bar.js.orig delete mode 100644 app/javascript/mastodon/features/status/components/detailed_status.js.orig delete mode 100644 app/javascript/mastodon/features/status/index.js.orig delete mode 100644 app/javascript/mastodon/features/ui/components/columns_area.js.orig delete mode 100644 app/javascript/mastodon/features/ui/components/navigation_panel.js.orig delete mode 100644 app/javascript/mastodon/locales/zh-HK.json.orig delete mode 100644 app/models/status.rb.orig delete mode 100644 app/services/fetch_link_card_service.rb.orig delete mode 100644 app/views/about/_registration.html.haml.orig delete mode 100644 app/views/about/show.html.haml.orig delete mode 100644 app/views/accounts/show.html.haml.orig delete mode 100644 app/views/statuses/_detailed_status.html.haml.orig delete mode 100644 app/views/statuses/_simple_status.html.haml.orig delete mode 100644 app/views/tags/show.html.haml.orig delete mode 100644 config/initializers/2_whitelist_mode.rb.orig delete mode 100644 config/initializers/blacklists.rb.orig create mode 100644 config/initializers/new_features.rb delete mode 100644 config/locales/doorkeeper.zh-TW.yml.orig delete mode 100644 package.json.orig diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 10c548b29..c1197a696 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -25,8 +25,8 @@ class Api::V1::StatusesController < Api::BaseController def context ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(CONTEXT_LIMIT, current_account) - treeId = ENV['TREE_ADDRESS'].split('/')[-1].to_i - depth = @status.id == treeId ? 1 : ((!ancestors_results.empty? && ancestors_results[0].id == treeId) ? 2 : nil) + treeId = Rails.configuration.x.tree_address.split('/')[-1].to_i + depth = (@status.id == treeId || (!ancestors_results.empty? && ancestors_results[0].id == treeId)) ? 1 : nil descendants_results = @status.descendants(CONTEXT_LIMIT, current_account, nil, nil, depth) loaded_ancestors = cache_collection(ancestors_results, Status) @@ -50,9 +50,10 @@ class Api::V1::StatusesController < Api::BaseController end def create - masked = status_params[:status].end_with?('[mask]') - sender = masked ? Account.find_local('mask_bot') : current_user.account - st_text = masked ? ("$#{to_cn(7919**(current_account.id + 1000 * Time.new.day) % 1000000007)}:\n" + status_params[:status][0..4900]) : status_params[:status] + p Rails.configuration.x.anon_tag + anon = Rails.configuration.x.anon_acc && status_params[:status].end_with?(Rails.configuration.x.anon_tag) + sender = anon ? Account.find(Rails.configuration.x.anon_acc) : current_user.account + st_text = anon ? ("$#{to_cn(7919**(current_account.id + 1000 * Time.new.day) % 1000000007)}:\n" + status_params[:status][0..4990]) : status_params[:status] @status = PostStatusService.new.call(sender, text: st_text, diff --git a/app/controllers/api/v1/statuses_controller.rb.orig b/app/controllers/api/v1/statuses_controller.rb.orig deleted file mode 100644 index 3aefc886f..000000000 --- a/app/controllers/api/v1/statuses_controller.rb.orig +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::StatusesController < Api::BaseController - include Authorization - - before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :destroy] - before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:create, :destroy] - before_action :require_user!, except: [:show, :context] - before_action :set_status, only: [:show, :context] - before_action :set_thread, only: [:create] - - override_rate_limit_headers :create, family: :statuses - - # This API was originally unlimited, pagination cannot be introduced without - # breaking backwards-compatibility. Arbitrarily high number to cover most - # conversations as quasi-unlimited, it would be too much work to render more - # than this anyway - CONTEXT_LIMIT = 4_096 - - def show - @status = cache_collection([@status], Status).first - render json: @status, serializer: REST::StatusSerializer - end - - def context - ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(CONTEXT_LIMIT, current_account) - - treeId = ENV['TREE_ADDRESS'].split('/')[-1].to_i - depth = @status.id == treeId ? 1 : ((!ancestors_results.empty? && ancestors_results[0].id == treeId) ? 2 : nil) - - descendants_results = @status.descendants(CONTEXT_LIMIT, current_account, nil, nil, depth) - loaded_ancestors = cache_collection(ancestors_results, Status) - loaded_descendants = cache_collection(descendants_results, Status) - - @context = Context.new(ancestors: loaded_ancestors, descendants: loaded_descendants) - statuses = [@status] + @context.ancestors + @context.descendants - - render json: @context, serializer: REST::ContextSerializer, relationships: StatusRelationshipsPresenter.new(statuses, current_user&.account_id) - end - - def to_cn(n) - case Time.new.wday - when 0, 3 - "秦汉魏晋隋唐宋元明清"[n % 10] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*') - when 1, 4, 6 - "甲乙丙丁戊己庚辛壬癸"[n % 10] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*') - else - "鼠牛虎兔龙蛇马羊猴鸡狗猪" [n % 12] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*') - end - end - - def create -<<<<<<< HEAD - thread = status_params[:in_reply_to_id].blank? ? nil : Status.find(status_params[:in_reply_to_id]) - masked = status_params[:status].end_with?('[mask]') - sender = masked ? Account.find_local('mask_bot') : current_account - st_text = masked ? ("$#{to_cn(7919**(current_account.id + 1000 * Time.new.day) % 1000000007)}:\n" + status_params[:status][0..4900]) : status_params[:status] - - @status = PostStatusService.new.call(sender, - text: st_text, - thread: thread, -======= - @status = PostStatusService.new.call(current_user.account, - text: status_params[:status], - thread: @thread, ->>>>>>> master - media_ids: status_params[:media_ids], - sensitive: status_params[:sensitive], - spoiler_text: status_params[:spoiler_text], - visibility: status_params[:visibility], - scheduled_at: status_params[:scheduled_at], - application: doorkeeper_token.application, - poll: status_params[:poll], - idempotency: request.headers['Idempotency-Key'], - with_rate_limit: true) - - render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer - end - - def destroy - @status = Status.where(account_id: current_user.account).find(params[:id]) - authorize @status, :destroy? - - @status.discard - RemovalWorker.perform_async(@status.id, redraft: true) - - render json: @status, serializer: REST::StatusSerializer, source_requested: true - end - - private - - def set_status - @status = Status.find(params[:id]) - authorize @status, :show? - rescue Mastodon::NotPermittedError - not_found - end - - def set_thread - @thread = status_params[:in_reply_to_id].blank? ? nil : Status.find(status_params[:in_reply_to_id]) - rescue ActiveRecord::RecordNotFound - render json: { error: I18n.t('statuses.errors.in_reply_not_found') }, status: 404 - end - - def status_params - params.permit( - :status, - :in_reply_to_id, - :sensitive, - :spoiler_text, - :visibility, - :scheduled_at, - media_ids: [], - poll: [ - :multiple, - :hide_totals, - :expires_in, - options: [], - ] - ) - end - - def pagination_params(core_params) - params.slice(:limit).permit(:limit).merge(core_params) - end -end diff --git a/app/helpers/statuses_helper.rb.orig b/app/helpers/statuses_helper.rb.orig deleted file mode 100644 index 771537c5a..000000000 --- a/app/helpers/statuses_helper.rb.orig +++ /dev/null @@ -1,218 +0,0 @@ -# frozen_string_literal: true - -module StatusesHelper - EMBEDDED_CONTROLLER = 'statuses' - EMBEDDED_ACTION = 'embed' - -<<<<<<< HEAD - def display_name(account, **options) - if options[:custom_emojify] - Formatter.instance.format_display_name(account, options) - else - account.display_name.presence || account.username - end - end - - def account_action_button(account) - if user_signed_in? - if account.id == current_user.account_id - link_to settings_profile_url, class: 'button logo-button' do - safe_join([svg_logo, t('settings.edit_profile')]) - end - elsif current_account.following?(account) || current_account.requested?(account) - link_to account_unfollow_path(account), class: 'button logo-button button--destructive', data: { method: :post } do - safe_join([svg_logo, t('accounts.unfollow')]) - end - elsif !(account.memorial? || account.moved?) - link_to account_follow_path(account), class: "button logo-button#{account.blocking?(current_account) ? ' disabled' : ''}", data: { method: :post } do - safe_join([svg_logo, t('accounts.follow')]) - end - end - elsif !(account.memorial? || account.moved?) - link_to account_remote_follow_path(account), class: 'button logo-button modal-button', target: '_new' do - safe_join([svg_logo, t('accounts.follow')]) - end - end - end - - def minimal_account_action_button(account) - if user_signed_in? - return if account.id == current_user.account_id - - if current_account.following?(account) || current_account.requested?(account) - link_to account_unfollow_path(account), class: 'icon-button active', data: { method: :post }, title: t('accounts.unfollow') do - fa_icon('user-times fw') - end - elsif !(account.memorial? || account.moved?) - link_to account_follow_path(account), class: "icon-button#{account.blocking?(current_account) ? ' disabled' : ''}", data: { method: :post }, title: t('accounts.follow') do - fa_icon('user-plus fw') - end - end - elsif !(account.memorial? || account.moved?) - link_to account_remote_follow_path(account), class: 'icon-button modal-button', target: '_new', title: t('accounts.follow') do - fa_icon('user-plus fw') - end - end - end - - def svg_logo - content_tag(:svg, tag(:use, 'xlink:href' => '#mastodon-svg-logo'), 'viewBox' => '0 0 216.4144 232.00976') - end - - def svg_logo_full - content_tag(:svg, tag(:use, 'xlink:href' => '#mastodon-svg-logo-full'), 'viewBox' => '0 0 180 80') - end - - def account_badge(account, all: false) - if account.bot? - content_tag(:div, content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot'), class: 'roles') - elsif (Setting.show_staff_badge && account.user_staff?) || all - content_tag(:div, class: 'roles') do - if all && !account.user_staff? - content_tag(:div, t('admin.accounts.roles.user'), class: 'account-role') - elsif account.user_admin? - content_tag(:div, t('accounts.roles.admin'), class: 'account-role admin') - elsif account.user_moderator? - content_tag(:div, t('accounts.roles.moderator'), class: 'account-role moderator') - end - end - end - end - -======= ->>>>>>> master - def link_to_more(url) - link_to t('statuses.show_more'), url, class: 'load-more load-gap' - end - - def nothing_here(extra_classes = '') - content_tag(:div, class: "nothing-here #{extra_classes}") do - t('accounts.nothing_here') - end - end - - def media_summary(status) - attachments = { image: 0, video: 0, audio: 0 } - - status.media_attachments.each do |media| - if media.video? - attachments[:video] += 1 - elsif media.audio? - attachments[:audio] += 1 - else - attachments[:image] += 1 - end - end - - text = attachments.to_a.reject { |_, value| value.zero? }.map { |key, value| I18n.t("statuses.attached.#{key}", count: value) }.join(' · ') - - return if text.blank? - - I18n.t('statuses.attached.description', attached: text) - end - - def status_text_summary(status) - return if status.spoiler_text.blank? - - I18n.t('statuses.content_warning', warning: status.spoiler_text) - end - - def poll_summary(status) - return unless status.preloadable_poll - - status.preloadable_poll.options.map { |o| "[ ] #{o}" }.join("\n") - end - - def status_description(status) - components = [[media_summary(status), status_text_summary(status)].reject(&:blank?).join(' · ')] - - if status.spoiler_text.blank? - components << status.text - components << poll_summary(status) - end - - components.reject(&:blank?).join("\n\n") - end - - def stream_link_target - embedded_view? ? '_blank' : nil - end - - def style_classes(status, is_predecessor, is_successor, include_threads) - classes = ['entry'] - classes << 'entry-predecessor' if is_predecessor - classes << 'entry-reblog' if status.reblog? - classes << 'entry-successor' if is_successor - classes << 'entry-center' if include_threads - classes.join(' ') - end - - def microformats_classes(status, is_direct_parent, is_direct_child) - classes = [] - classes << 'p-in-reply-to' if is_direct_parent - classes << 'p-repost-of' if status.reblog? && is_direct_parent - classes << 'p-comment' if is_direct_child - classes.join(' ') - end - - def microformats_h_class(status, is_predecessor, is_successor, include_threads) - if is_predecessor || status.reblog? || is_successor - 'h-cite' - elsif include_threads - '' - else - 'h-entry' - end - end - - def rtl_status?(status) - status.local? ? rtl?(status.text) : rtl?(strip_tags(status.text)) - end - - def rtl?(text) - text = simplified_text(text) - rtl_words = text.scan(/[\p{Hebrew}\p{Arabic}\p{Syriac}\p{Thaana}\p{Nko}]+/m) - - if rtl_words.present? - total_size = text.size.to_f - rtl_size(rtl_words) / total_size > 0.3 - else - false - end - end - - def fa_visibility_icon(status) - case status.visibility - when 'public' - fa_icon 'globe fw' - when 'unlisted' - fa_icon 'unlock fw' - when 'private' - fa_icon 'lock fw' - when 'direct' - fa_icon 'envelope fw' - end - end - - private - - def simplified_text(text) - text.dup.tap do |new_text| - URI.extract(new_text).each do |url| - new_text.gsub!(url, '') - end - - new_text.gsub!(Account::MENTION_RE, '') - new_text.gsub!(Tag::HASHTAG_RE, '') - new_text.gsub!(/\s+/, '') - end - end - - def rtl_size(words) - words.reduce(0) { |acc, elem| acc + elem.size }.to_f - end - - def embedded_view? - params[:controller] == EMBEDDED_CONTROLLER && params[:action] == EMBEDDED_ACTION - end -end diff --git a/app/javascript/mastodon/components/icon_button.js.orig b/app/javascript/mastodon/components/icon_button.js.orig deleted file mode 100644 index 101c7e6c0..000000000 --- a/app/javascript/mastodon/components/icon_button.js.orig +++ /dev/null @@ -1,153 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import classNames from 'classnames'; -import Icon from 'mastodon/components/icon'; - -export default class IconButton extends React.PureComponent { - - static propTypes = { - className: PropTypes.string, - title: PropTypes.string.isRequired, - icon: PropTypes.string.isRequired, - onClick: PropTypes.func, - onMouseDown: PropTypes.func, - onKeyDown: PropTypes.func, - onKeyPress: PropTypes.func, - size: PropTypes.number, - active: PropTypes.bool, - pressed: PropTypes.bool, - expanded: PropTypes.bool, - style: PropTypes.object, - activeStyle: PropTypes.object, - disabled: PropTypes.bool, - inverted: PropTypes.bool, - animate: PropTypes.bool, - overlay: PropTypes.bool, - tabIndex: PropTypes.string, - }; - - static defaultProps = { - size: 18, - active: false, - disabled: false, - animate: false, - overlay: false, - tabIndex: '0', - }; - - state = { - activate: false, - deactivate: false, - } - - componentWillReceiveProps (nextProps) { - if (!nextProps.animate) return; - - if (this.props.active && !nextProps.active) { - this.setState({ activate: false, deactivate: true }); - } else if (!this.props.active && nextProps.active) { - this.setState({ activate: true, deactivate: false }); - } - } - - handleClick = (e) => { - e.preventDefault(); - - if (!this.props.disabled) { - this.props.onClick(e); - } - } - - handleKeyPress = (e) => { - if (this.props.onKeyPress && !this.props.disabled) { - this.props.onKeyPress(e); - } - } - - handleMouseDown = (e) => { - if (!this.props.disabled && this.props.onMouseDown) { - this.props.onMouseDown(e); - } - } - - handleKeyDown = (e) => { - if (!this.props.disabled && this.props.onKeyDown) { - this.props.onKeyDown(e); - } - } - - render () { - const style = { - fontSize: `${this.props.size}px`, - width: `${this.props.size * 1.28571429}px`, - height: `${this.props.size * 1.28571429}px`, - lineHeight: `${this.props.size}px`, - ...this.props.style, - ...(this.props.active ? this.props.activeStyle : {}), - }; - - const { - active, - className, - disabled, - expanded, - icon, - inverted, - overlay, - pressed, - tabIndex, - title, - } = this.props; - - const { - activate, - deactivate, - } = this.state; - - const classes = classNames(className, 'icon-button', { - active, - disabled, - inverted, - activate, - deactivate, - overlayed: overlay, - }); - - return ( - - ); - } - -} diff --git a/app/javascript/mastodon/components/status.js.orig b/app/javascript/mastodon/components/status.js.orig deleted file mode 100644 index b0db14614..000000000 --- a/app/javascript/mastodon/components/status.js.orig +++ /dev/null @@ -1,631 +0,0 @@ -import React from 'react'; -import Immutable from 'immutable'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import Avatar from './avatar'; -import AvatarOverlay from './avatar_overlay'; -import AvatarComposite from './avatar_composite'; -import RelativeTimestamp from './relative_timestamp'; -import DisplayName from './display_name'; -import StatusContent from './status_content'; -import StatusActionBar from './status_action_bar'; -import AttachmentList from './attachment_list'; -import Card from '../features/status/components/card'; -<<<<<<< HEAD -import { injectIntl, FormattedMessage, FormattedNumber } from 'react-intl'; -======= -import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'; ->>>>>>> master -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { MediaGallery, Video, Audio } from '../features/ui/util/async-components'; -import { HotKeys } from 'react-hotkeys'; -import classNames from 'classnames'; -import Icon from 'mastodon/components/icon'; -import { displayMedia } from '../initial_state'; - -import StatusContainer from '../containers/status_container2'; - -// We use the component (and not the container) since we do not want -// to use the progress bar to show download progress -import Bundle from '../features/ui/components/bundle'; - -export const textForScreenReader = (intl, status, rebloggedByText = false) => { - const displayName = status.getIn(['account', 'display_name']); - - const values = [ - displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName, - status.get('spoiler_text') && status.get('hidden') ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length), - intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }), - status.getIn(['account', 'acct']), - ]; - - if (rebloggedByText) { - values.push(rebloggedByText); - } - - return values.join(', '); -}; - -export const defaultMediaVisibility = (status) => { - if (!status) { - return undefined; - } - - if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') { - status = status.get('reblog'); - } - - return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all'); -}; - -const messages = defineMessages({ - public_short: { id: 'privacy.public.short', defaultMessage: 'Public' }, - unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' }, - private_short: { id: 'privacy.private.short', defaultMessage: 'Followers-only' }, - direct_short: { id: 'privacy.direct.short', defaultMessage: 'Direct' }, -}); - -export default @injectIntl -class Status extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - - static propTypes = { - status: ImmutablePropTypes.map, - account: ImmutablePropTypes.map, - otherAccounts: ImmutablePropTypes.list, - onClick: PropTypes.func, - onReply: PropTypes.func, - onFavourite: PropTypes.func, - onReblog: PropTypes.func, - onDelete: PropTypes.func, - onDirect: PropTypes.func, - onMention: PropTypes.func, - onPin: PropTypes.func, - onOpenMedia: PropTypes.func, - onOpenVideo: PropTypes.func, - onBlock: PropTypes.func, - onEmbed: PropTypes.func, - onHeightChange: PropTypes.func, - onToggleHidden: PropTypes.func, - onToggleCollapsed: PropTypes.func, - muted: PropTypes.bool, - hidden: PropTypes.bool, - unread: PropTypes.bool, - onMoveUp: PropTypes.func, - onMoveDown: PropTypes.func, - showThread: PropTypes.bool, - getScrollPosition: PropTypes.func, - updateScrollBottom: PropTypes.func, - cacheMediaWidth: PropTypes.func, - cachedMediaWidth: PropTypes.number, - - sonsIds: ImmutablePropTypes.list, - onPreview: PropTypes.func - }; - - // Avoid checking props that are functions (and whose equality will always - // evaluate to false. See react-immutable-pure-component for usage. - updateOnProps = [ - 'status', - 'account', - 'muted', - 'hidden', - 'sonsIds', - 'ancestorsText', - ]; - - state = { - showMedia: defaultMediaVisibility(this.props.status), - statusId: undefined, - noStartPD: true - }; - -<<<<<<< HEAD - _isMounted = false; - // Track height changes we know about to compensate scrolling - componentDidMount () { - this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card'); - this._isMounted = true; - setTimeout(this.loadContext, Math.ceil(Math.random() * 4000 + 1000)); - } - - getSnapshotBeforeUpdate () { - if (this.props.getScrollPosition) { - return this.props.getScrollPosition(); - } else { - return null; - } - } - -======= ->>>>>>> master - static getDerivedStateFromProps(nextProps, prevState) { - if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) { - return { - showMedia: defaultMediaVisibility(nextProps.status), - statusId: nextProps.status.get('id'), - }; - } else { - return null; - } - } - -<<<<<<< HEAD - // Compensate height changes - componentDidUpdate (prevProps, prevState, snapshot) { - const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card'); - - if (doShowCard && !this.didShowCard) { - this.didShowCard = true; - - if (snapshot !== null && this.props.updateScrollBottom) { - if (this.node && this.node.offsetTop < snapshot.top) { - this.props.updateScrollBottom(snapshot.height - snapshot.top); - } - } - } - } - - componentWillUnmount() { - if (this.node && this.props.getScrollPosition) { - const position = this.props.getScrollPosition(); - if (position !== null && this.node.offsetTop < position.top) { - requestAnimationFrame(() => { - this.props.updateScrollBottom(position.height - position.top); - }); - } - } - - this._isMounted = false; - } - -======= ->>>>>>> master - handleToggleMediaVisibility = () => { - this.setState({ showMedia: !this.state.showMedia }); - } - - handleClick = () => { - if (this.props.onClick) { - this.props.onClick(); - return; - } - - if (!this.context.router) { - return; - } - - const { status } = this.props; - this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`); - } - - loadContext = () => { - if(!this._isMounted) { - //console.log('cancel'); - return; - } - const { status } = this.props; - const r_status = status.get('reblog') || status; - if(this.props.showThread && this.state.noStartPD && (r_status.get('replies_count') || r_status.get('in_reply_to_id') || r_status.get('visibility') == 'private')) { - this.setState({noStartPD: false}); - this.props.onPreview(r_status.get('id')); - } - } - - handleExpandClick = (e) => { - if (this.props.onClick) { - this.props.onClick(); - return; - } - - if (e.button === 0) { - if (!this.context.router) { - return; - } - - const { status } = this.props; - this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`); - } - } - - handleAccountClick = (e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { - const id = e.currentTarget.getAttribute('data-id'); - e.preventDefault(); - this.context.router.history.push(`/accounts/${id}`); - } - } - - handleExpandedToggle = () => { - this.props.onToggleHidden(this._properStatus()); - } - - handleCollapsedToggle = isCollapsed => { - this.props.onToggleCollapsed(this._properStatus(), isCollapsed); - } - - renderLoadingMediaGallery () { - return
; - } - - renderLoadingVideoPlayer () { - return
; - } - - renderLoadingAudioPlayer () { - return
; - } - - handleOpenVideo = (media, options) => { - this.props.onOpenVideo(media, options); - } - - handleHotkeyOpenMedia = e => { - const { onOpenMedia, onOpenVideo } = this.props; - const status = this._properStatus(); - - e.preventDefault(); - - if (status.get('media_attachments').size > 0) { - if (status.getIn(['media_attachments', 0, 'type']) === 'audio') { - // TODO: toggle play/paused? - } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { - onOpenVideo(status.getIn(['media_attachments', 0]), { startTime: 0 }); - } else { - onOpenMedia(status.get('media_attachments'), 0); - } - } - } - - handleHotkeyReply = e => { - e.preventDefault(); - this.props.onReply(this._properStatus(), this.context.router.history); - } - - handleHotkeyFavourite = () => { - this.props.onFavourite(this._properStatus()); - } - - handleHotkeyBoost = e => { - this.props.onReblog(this._properStatus(), e); - } - - handleHotkeyMention = e => { - e.preventDefault(); - this.props.onMention(this._properStatus().get('account'), this.context.router.history); - } - - handleHotkeyOpen = () => { - this.context.router.history.push(`/statuses/${this._properStatus().get('id')}`); - } - - handleHotkeyOpenProfile = () => { - this.context.router.history.push(`/accounts/${this._properStatus().getIn(['account', 'id'])}`); - } - - handleHotkeyMoveUp = e => { - this.props.onMoveUp(this.props.status.get('id'), e.target.getAttribute('data-featured')); - } - - handleHotkeyMoveDown = e => { - this.props.onMoveDown(this.props.status.get('id'), e.target.getAttribute('data-featured')); - } - - handleHotkeyToggleHidden = () => { - this.props.onToggleHidden(this._properStatus()); - } - - handleHotkeyToggleSensitive = () => { - this.handleToggleMediaVisibility(); - } - - _properStatus () { - const { status } = this.props; - - if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') { - return status.get('reblog'); - } else { - return status; - } - } - - handleRef = c => { - this.node = c; - } - - - renderChildren (list) { - return list.map(e => ( - e.id ? -
- {}} - onMoveDown={()=>{}} - contextType='comments-timeline' - /> - { e.sonsIds && -
{this.renderChildren(e.sonsIds)}
- } -
- : - {}} - onMoveDown={()=>{}} - contextType='comments-timeline' - /> - )); - - } - - render () { - let media = null; - let statusAvatar, prepend, rebloggedByText; - let sons, quote; - - const { intl, hidden, featured, otherAccounts, unread, showThread, deep, tree_type, ancestorsText, sonsIds } = this.props; - - let { status, account, ...other } = this.props; - - if (status === null) { - return null; - } - - const handlers = this.props.muted ? {} : { - reply: this.handleHotkeyReply, - favourite: this.handleHotkeyFavourite, - boost: this.handleHotkeyBoost, - mention: this.handleHotkeyMention, - open: this.handleHotkeyOpen, - openProfile: this.handleHotkeyOpenProfile, - moveUp: this.handleHotkeyMoveUp, - moveDown: this.handleHotkeyMoveDown, - toggleHidden: this.handleHotkeyToggleHidden, - toggleSensitive: this.handleHotkeyToggleSensitive, - openMedia: this.handleHotkeyOpenMedia, - }; - - if (hidden) { - return ( - -
- {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])} - {status.get('content')} -
-
- ); - } - - if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) { - const minHandlers = this.props.muted ? {} : { - moveUp: this.handleHotkeyMoveUp, - moveDown: this.handleHotkeyMoveDown, - }; - - return ( - -
- -
-
- ); - } - - if (featured) { - prepend = ( -
-
- -
- ); - } else if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') { - const display_name_html = { __html: status.getIn(['account', 'display_name_html']) }; - - prepend = ( -
-
- }} /> -
- ); - - rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: status.getIn(['account', 'acct']) }); - - account = status.get('account'); - status = status.get('reblog'); - } - - if (status.get('media_attachments').size > 0) { - if (this.props.muted) { - media = ( - - ); - } else if (status.getIn(['media_attachments', 0, 'type']) === 'audio') { - const attachment = status.getIn(['media_attachments', 0]); - - media = ( - - {Component => ( - - )} - - ); - } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { - const attachment = status.getIn(['media_attachments', 0]); - - media = ( - - {Component => ( - - )} - - ); - } else { - media = ( - - {Component => ( - - )} - - ); - } - } else if (status.get('spoiler_text').length === 0 && status.get('card')) { - media = ( - - ); - } - - if (otherAccounts && otherAccounts.size > 0) { - statusAvatar = ; - } else if (account === undefined || account === null) { - statusAvatar = ; - } else { - statusAvatar = ; - } - -<<<<<<< HEAD - if (sonsIds && sonsIds.size > 0) { - sons =
{this.renderChildren(sonsIds)}
; - } - - if (rebloggedByText && status.get('in_reply_to_id')) { - quote = ancestorsText ? -
- - {ancestorsText} -
- : -
- {}} - onMoveDown={()=>{}} - contextType='quote' - /> -
; - } - - let deepRec; - if(deep != null) { - deepRec = ( -
- - - 【】 - -
- ); - } - -======= - const visibilityIconInfo = { - 'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) }, - 'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) }, - 'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) }, - 'direct': { icon: 'envelope', text: intl.formatMessage(messages.direct_short) }, - }; - - const visibilityIcon = visibilityIconInfo[status.get('visibility')]; ->>>>>>> master - - return ( - -
- {prepend} - -
-
- - -<<<<<<< HEAD - {deepRec} - - - {media} - - {quote} - - {showThread && status.get('in_reply_to_id') && ( - - )} - - {(deep == null || tree_type != 'ance') && ( - - )} -======= - - - {media} - - ->>>>>>> master -
-
- {sons} - - ); - } - -} diff --git a/app/javascript/mastodon/components/status_action_bar.js.orig b/app/javascript/mastodon/components/status_action_bar.js.orig deleted file mode 100644 index 5e48e3acd..000000000 --- a/app/javascript/mastodon/components/status_action_bar.js.orig +++ /dev/null @@ -1,349 +0,0 @@ -import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import IconButton from './icon_button'; -import DropdownMenuContainer from '../containers/dropdown_menu_container'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me, isStaff } from '../initial_state'; - -const messages = defineMessages({ - delete: { id: 'status.delete', defaultMessage: 'Delete' }, - redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' }, - direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' }, - mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' }, - mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, - block: { id: 'account.block', defaultMessage: 'Block @{name}' }, - reply: { id: 'status.reply', defaultMessage: 'Reply' }, - comment: {id: 'status.comment', defaultMessage: 'Comment' }, - share: { id: 'status.share', defaultMessage: 'Share' }, - more: { id: 'status.more', defaultMessage: 'More' }, - replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' }, - reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, - reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' }, - cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, - cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, - favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, - bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, - removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' }, - open: { id: 'status.open', defaultMessage: 'Expand this status' }, - report: { id: 'status.report', defaultMessage: 'Report @{name}' }, - muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' }, - unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' }, - pin: { id: 'status.pin', defaultMessage: 'Pin on profile' }, - unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' }, - embed: { id: 'status.embed', defaultMessage: 'Embed' }, - admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' }, - admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' }, - copy: { id: 'status.copy', defaultMessage: 'Copy link to status' }, - blockDomain: { id: 'account.block_domain', defaultMessage: 'Block domain {domain}' }, - unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' }, - unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, -}); - -const obfuscatedCount = count => { - if (count < 0) { - return 0; - } else if (count <= 10) { - return count; - } else { - return '10+'; - } -}; - -const mapStateToProps = (state, { status }) => ({ - relationship: state.getIn(['relationships', status.getIn(['account', 'id'])]), -}); - -export default @connect(mapStateToProps) -@injectIntl -class StatusActionBar extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - - static propTypes = { - status: ImmutablePropTypes.map.isRequired, - relationship: ImmutablePropTypes.map, - onReply: PropTypes.func, - onFavourite: PropTypes.func, - onReblog: PropTypes.func, - onDelete: PropTypes.func, - onDirect: PropTypes.func, - onMention: PropTypes.func, - onMute: PropTypes.func, - onUnmute: PropTypes.func, - onBlock: PropTypes.func, - onUnblock: PropTypes.func, - onBlockDomain: PropTypes.func, - onUnblockDomain: PropTypes.func, - onReport: PropTypes.func, - onEmbed: PropTypes.func, - onMuteConversation: PropTypes.func, - onPin: PropTypes.func, - onBookmark: PropTypes.func, - withDismiss: PropTypes.bool, - intl: PropTypes.object.isRequired, - }; - - // Avoid checking props that are functions (and whose equality will always - // evaluate to false. See react-immutable-pure-component for usage. - updateOnProps = [ - 'status', - 'relationship', - 'withDismiss', - ] - - handleReplyClick = () => { - if (me) { - this.props.onReply(this.props.status, this.context.router.history); - } else { - this._openInteractionDialog('reply'); - } - } - - handleShareClick = () => { - navigator.share({ - text: this.props.status.get('search_index'), - url: this.props.status.get('url'), - }).catch((e) => { - if (e.name !== 'AbortError') console.error(e); - }); - } - - handleFavouriteClick = () => { - if (me) { - this.props.onFavourite(this.props.status); - } else { - this._openInteractionDialog('favourite'); - } - } - - handleReblogClick = e => { - if (me) { - this.props.onReblog(this.props.status, e); - } else { - this._openInteractionDialog('reblog'); - } - } - - _openInteractionDialog = type => { - window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); - } - - handleBookmarkClick = () => { - this.props.onBookmark(this.props.status); - } - - handleDeleteClick = () => { - this.props.onDelete(this.props.status, this.context.router.history); - } - - handleRedraftClick = () => { - this.props.onDelete(this.props.status, this.context.router.history, true); - } - - handlePinClick = () => { - this.props.onPin(this.props.status); - } - - handleMentionClick = () => { - this.props.onMention(this.props.status.get('account'), this.context.router.history); - } - - handleDirectClick = () => { - this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } - - handleMuteClick = () => { - const { status, relationship, onMute, onUnmute } = this.props; - const account = status.get('account'); - - if (relationship && relationship.get('muting')) { - onUnmute(account); - } else { - onMute(account); - } - } - - handleBlockClick = () => { - const { status, relationship, onBlock, onUnblock } = this.props; - const account = status.get('account'); - - if (relationship && relationship.get('blocking')) { - onUnblock(account); - } else { - onBlock(status); - } - } - - handleBlockDomain = () => { - const { status, onBlockDomain } = this.props; - const account = status.get('account'); - - onBlockDomain(account.get('acct').split('@')[1]); - } - - handleUnblockDomain = () => { - const { status, onUnblockDomain } = this.props; - const account = status.get('account'); - - onUnblockDomain(account.get('acct').split('@')[1]); - } - - handleOpen = () => { - this.context.router.history.push(`/statuses/${this.props.status.get('id')}`); - } - - handleEmbed = () => { - this.props.onEmbed(this.props.status); - } - - handleReport = () => { - this.props.onReport(this.props.status); - } - - handleConversationMuteClick = () => { - this.props.onMuteConversation(this.props.status); - } - - handleCopy = () => { - const url = this.props.status.get('url'); - const textarea = document.createElement('textarea'); - - textarea.textContent = url; - textarea.style.position = 'fixed'; - - document.body.appendChild(textarea); - - try { - textarea.select(); - document.execCommand('copy'); - } catch (e) { - - } finally { - document.body.removeChild(textarea); - } - } - - render () { - const { status, relationship, intl, withDismiss } = this.props; - - const mutingConversation = status.get('muted'); - const anonymousAccess = !me; - const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); - const account = status.get('account'); - - let menu = []; - - menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen }); - - if (publicStatus) { - menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy }); - menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed }); - } - - menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark), action: this.handleBookmarkClick }); - menu.push(null); - - if (status.getIn(['account', 'id']) === me || withDismiss) { - menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick }); - menu.push(null); - } - - if (status.getIn(['account', 'id']) === me) { - if (publicStatus) { - menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); - } - - menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); - menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick }); - } else { - menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.handleMentionClick }); - menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.handleDirectClick }); - menu.push(null); - - if (relationship && relationship.get('muting')) { - menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.handleMuteClick }); - } else { - menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.handleMuteClick }); - } - - if (relationship && relationship.get('blocking')) { - menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.handleBlockClick }); - } else { - menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.handleBlockClick }); - } - - menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.handleReport }); - - if (account.get('acct') !== account.get('username')) { - const domain = account.get('acct').split('@')[1]; - - menu.push(null); - - if (relationship && relationship.get('domain_blocking')) { - menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.handleUnblockDomain }); - } else { - menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.handleBlockDomain }); - } - } - - if (isStaff) { - menu.push(null); - menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` }); - menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` }); - } - } - - let replyIcon; - let replyTitle; - if (status.get('in_reply_to_id', null) === null) { - replyIcon = 'comment'; - replyTitle = intl.formatMessage(messages.comment); - } else { - replyIcon = 'reply'; - replyTitle = intl.formatMessage(messages.reply); - } - - const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private'; - - let reblogTitle = ''; - if (status.get('reblogged')) { - reblogTitle = intl.formatMessage(messages.cancel_reblog_private); - } else if (publicStatus) { - reblogTitle = intl.formatMessage(messages.reblog); - } else if (reblogPrivate) { - reblogTitle = intl.formatMessage(messages.reblog_private); - } else { - reblogTitle = intl.formatMessage(messages.cannot_reblog); - } - - const shareButton = ('share' in navigator) && publicStatus && ( - - ); - - return ( -
-<<<<<<< HEAD -
{obfuscatedCount(status.get('replies_count'))}
-
{publicStatus && {obfuscatedCount(status.get('reblogs_count'))}}
-
{obfuscatedCount(status.get('favourites_count'))}
-======= -
{obfuscatedCount(status.get('replies_count'))}
- - ->>>>>>> master - {shareButton} - -
- -
-
- ); - } - -} diff --git a/app/javascript/mastodon/containers/status_container.js.orig b/app/javascript/mastodon/containers/status_container.js.orig deleted file mode 100644 index 2cf21f660..000000000 --- a/app/javascript/mastodon/containers/status_container.js.orig +++ /dev/null @@ -1,286 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import Immutable from 'immutable'; -import { createSelector } from 'reselect'; -import Status from '../components/status'; -import { makeGetStatus } from '../selectors'; -import { - replyCompose, - mentionCompose, - directCompose, -} from '../actions/compose'; -import { - reblog, - favourite, - bookmark, - unreblog, - unfavourite, - unbookmark, - pin, - unpin, -} from '../actions/interactions'; -import { - muteStatus, - unmuteStatus, - deleteStatus, - hideStatus, - revealStatus, -<<<<<<< HEAD - fetchContext, -======= - toggleStatusCollapse, ->>>>>>> master -} from '../actions/statuses'; -import { - unmuteAccount, - unblockAccount, -} from '../actions/accounts'; -import { - blockDomain, - unblockDomain, -} from '../actions/domain_blocks'; -import { initMuteModal } from '../actions/mutes'; -import { initBlockModal } from '../actions/blocks'; -import { initReport } from '../actions/reports'; -import { openModal } from '../actions/modal'; -<<<<<<< HEAD -import { defineMessages, injectIntl } from 'react-intl'; -import { boostModal, deleteModal, treeRoot } from '../initial_state'; -======= -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { boostModal, deleteModal } from '../initial_state'; ->>>>>>> master -import { showAlertForError } from '../actions/alerts'; - -const messages = defineMessages({ - deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, - deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' }, - redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' }, - redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' }, - replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' }, - replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' }, - blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' }, -}); - -const makeMapStateToProps = () => { - const getStatus = makeGetStatus(); - - const getAncestorsIds = createSelector([ - (_, { id }) => id, - state => state.getIn(['contexts', 'inReplyTos']), - ], (statusId, inReplyTos) => { - let ancestorsIds = Immutable.List(); - ancestorsIds = ancestorsIds.withMutations(mutable => { - let id = statusId; - - while (id) { - mutable.unshift(id); - id = inReplyTos.get(id); - } - }); - - return ancestorsIds; - }); - - const getAncestorsText = createSelector([ - (_, {ids}) => ids, - state => state.get('statuses'), - ], (ids, statuses) => ids.map(i => { - let text = statuses.get(i) ? statuses.get(i).get('search_index') : i; - if(text.length > 16) - text = text.slice(0,13) + "..."; - return text; - }).join(' >> ') - ); - - const getSonsIds = createSelector([ - (_, {id}) => id, - state => state.getIn(['contexts', 'replies']), - ], (statusId, contextReplies) => { - const sons = contextReplies.get(statusId); - return sons ? sons.map(id => ({ - 'id': id, - 'sonsIds' : contextReplies.get(id), - })) - : null; - }); - - const mapStateToProps = (state, props) => { - const status = getStatus(state, props); - let ancestorsIds = Immutable.List(); - let ancestorsText; - let sonsIds; - - if (props.showThread && status) { - sonsIds = getSonsIds(state, { id : status.getIn(['reblog', 'id'], props.id)}); - if(status.get('reblog')) { - ancestorsIds = getAncestorsIds(state, { id: status.getIn(['reblog', 'in_reply_to_id']) }); - if(ancestorsIds && ancestorsIds.first() == treeRoot.split('/').pop()) { - ancestorsText = getAncestorsText(state, { ids: ancestorsIds.shift() }); - } - } - } - return { - status, - ancestorsText, - sonsIds, - }; - }; - - return mapStateToProps; -}; - -const mapDispatchToProps = (dispatch, { intl }) => ({ - - onReply (status, router) { - dispatch((_, getState) => { - let state = getState(); - - if (state.getIn(['compose', 'text']).trim().length !== 0) { - dispatch(openModal('CONFIRM', { - message: intl.formatMessage(messages.replyMessage), - confirm: intl.formatMessage(messages.replyConfirm), - onConfirm: () => dispatch(replyCompose(status, router)), - })); - } else { - dispatch(replyCompose(status, router)); - } - }); - }, - - onModalReblog (status) { - if (status.get('reblogged')) { - dispatch(unreblog(status)); - } else { - dispatch(reblog(status)); - } - }, - - onReblog (status, e) { - if ((e && e.shiftKey) || !boostModal) { - this.onModalReblog(status); - } else { - dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog })); - } - }, - - onFavourite (status) { - if (status.get('favourited')) { - dispatch(unfavourite(status)); - } else { - dispatch(favourite(status)); - } - }, - - onBookmark (status) { - if (status.get('bookmarked')) { - dispatch(unbookmark(status)); - } else { - dispatch(bookmark(status)); - } - }, - - onPin (status) { - if (status.get('pinned')) { - dispatch(unpin(status)); - } else { - dispatch(pin(status)); - } - }, - - onEmbed (status) { - dispatch(openModal('EMBED', { - url: status.get('url'), - onError: error => dispatch(showAlertForError(error)), - })); - }, - - onDelete (status, history, withRedraft = false) { - if (!deleteModal) { - dispatch(deleteStatus(status.get('id'), history, withRedraft)); - } else { - dispatch(openModal('CONFIRM', { - message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage), - confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm), - onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)), - })); - } - }, - - onDirect (account, router) { - dispatch(directCompose(account, router)); - }, - - onMention (account, router) { - dispatch(mentionCompose(account, router)); - }, - - onOpenMedia (media, index) { - dispatch(openModal('MEDIA', { media, index })); - }, - - onOpenVideo (media, options) { - dispatch(openModal('VIDEO', { media, options })); - }, - - onBlock (status) { - const account = status.get('account'); - dispatch(initBlockModal(account)); - }, - - onUnblock (account) { - dispatch(unblockAccount(account.get('id'))); - }, - - onReport (status) { - dispatch(initReport(status.get('account'), status)); - }, - - onMute (account) { - dispatch(initMuteModal(account)); - }, - - onUnmute (account) { - dispatch(unmuteAccount(account.get('id'))); - }, - - onMuteConversation (status) { - if (status.get('muted')) { - dispatch(unmuteStatus(status.get('id'))); - } else { - dispatch(muteStatus(status.get('id'))); - } - }, - - onToggleHidden (status) { - if (status.get('hidden')) { - dispatch(revealStatus(status.get('id'))); - } else { - dispatch(hideStatus(status.get('id'))); - } - }, - -<<<<<<< HEAD - onPreview (id) { - dispatch(fetchContext(id)); -======= - onToggleCollapsed (status, isCollapsed) { - dispatch(toggleStatusCollapse(status.get('id'), isCollapsed)); - }, - - onBlockDomain (domain) { - dispatch(openModal('CONFIRM', { - message: {domain}
}} />, - confirm: intl.formatMessage(messages.blockDomainConfirm), - onConfirm: () => dispatch(blockDomain(domain)), - })); - }, - - onUnblockDomain (domain) { - dispatch(unblockDomain(domain)); ->>>>>>> master - }, - -}); - -export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status)); diff --git a/app/javascript/mastodon/features/getting_started/index.js.orig b/app/javascript/mastodon/features/getting_started/index.js.orig deleted file mode 100644 index 7ff06c0c7..000000000 --- a/app/javascript/mastodon/features/getting_started/index.js.orig +++ /dev/null @@ -1,183 +0,0 @@ -import React from 'react'; -import Column from '../ui/components/column'; -import ColumnLink from '../ui/components/column_link'; -import ColumnSubheading from '../ui/components/column_subheading'; -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me, profile_directory, showTrends } from '../../initial_state'; -import { fetchFollowRequests } from 'mastodon/actions/accounts'; -import { List as ImmutableList } from 'immutable'; -import NavigationBar from '../compose/components/navigation_bar'; -import Icon from 'mastodon/components/icon'; -import LinkFooter from 'mastodon/features/ui/components/link_footer'; -import TrendsContainer from './containers/trends_container'; - -const messages = defineMessages({ - home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, - notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' }, - public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' }, - settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings' }, - community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' }, - direct: { id: 'navigation_bar.direct', defaultMessage: 'Direct messages' }, - bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' }, - preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, - follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, - favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' }, - blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' }, - domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' }, - mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, - pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' }, - lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' }, - discover: { id: 'navigation_bar.discover', defaultMessage: 'Discover' }, - personal: { id: 'navigation_bar.personal', defaultMessage: 'Personal' }, - security: { id: 'navigation_bar.security', defaultMessage: 'Security' }, - menu: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, - profile_directory: { id: 'getting_started.directory', defaultMessage: 'Profile directory' }, -}); - -const mapStateToProps = state => ({ - myAccount: state.getIn(['accounts', me]), - unreadFollowRequests: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size, -}); - -const mapDispatchToProps = dispatch => ({ - fetchFollowRequests: () => dispatch(fetchFollowRequests()), -}); - -const badgeDisplay = (number, limit) => { - if (number === 0) { - return undefined; - } else if (limit && number >= limit) { - return `${limit}+`; - } else { - return number; - } -}; - -const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2); - -export default @connect(mapStateToProps, mapDispatchToProps) -@injectIntl -class GettingStarted extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object.isRequired, - }; - - static propTypes = { - intl: PropTypes.object.isRequired, - myAccount: ImmutablePropTypes.map.isRequired, - columns: ImmutablePropTypes.list, - multiColumn: PropTypes.bool, - fetchFollowRequests: PropTypes.func.isRequired, - unreadFollowRequests: PropTypes.number, - unreadNotifications: PropTypes.number, - }; - - componentDidMount () { - const { fetchFollowRequests, multiColumn } = this.props; - - if (!multiColumn && window.innerWidth >= NAVIGATION_PANEL_BREAKPOINT) { - this.context.router.history.replace('/timelines/home'); - return; - } - - fetchFollowRequests(); - } - - render () { - const { intl, myAccount, multiColumn, unreadFollowRequests } = this.props; - - const navItems = []; - let i = 1; - let height = (multiColumn) ? 0 : 60; - - if (multiColumn) { - navItems.push( - , - , - , - ); - - height += 34 + 48*2; - - if (profile_directory) { - navItems.push( - , - ); - - height += 48; - } - - navItems.push( - , - ); - - height += 34; - } else if (profile_directory) { - navItems.push( - , - ); - - height += 48; - } - - navItems.push( - , -<<<<<<< HEAD - , - -======= - , - , - , ->>>>>>> master - ); - - height += 48*4; - - if (myAccount.get('locked') || unreadFollowRequests > 0) { - navItems.push(); - height += 48; - } - - if (!multiColumn) { - navItems.push( - , - , - ); - - height += 34 + 48; - } - - return ( - - {multiColumn &&
-

- -

-
} - -
-
- {!multiColumn && } - {navItems} -
- - {!multiColumn &&
} - - -
- - {multiColumn && showTrends && } - - ); - } - -} diff --git a/app/javascript/mastodon/features/status/components/action_bar.js.orig b/app/javascript/mastodon/features/status/components/action_bar.js.orig deleted file mode 100644 index 66c01b44e..000000000 --- a/app/javascript/mastodon/features/status/components/action_bar.js.orig +++ /dev/null @@ -1,294 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import IconButton from '../../../components/icon_button'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import DropdownMenuContainer from '../../../containers/dropdown_menu_container'; -import { defineMessages, injectIntl } from 'react-intl'; -import { me, isStaff } from '../../../initial_state'; - -const messages = defineMessages({ - delete: { id: 'status.delete', defaultMessage: 'Delete' }, - redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' }, - direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' }, - mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' }, - reply: { id: 'status.reply', defaultMessage: 'Reply' }, - reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, - reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' }, - cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, - cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, - favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, - bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, - more: { id: 'status.more', defaultMessage: 'More' }, - mute: { id: 'status.mute', defaultMessage: 'Mute @{name}' }, - muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' }, - unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' }, - block: { id: 'status.block', defaultMessage: 'Block @{name}' }, - report: { id: 'status.report', defaultMessage: 'Report @{name}' }, - share: { id: 'status.share', defaultMessage: 'Share' }, - pin: { id: 'status.pin', defaultMessage: 'Pin on profile' }, - unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' }, - embed: { id: 'status.embed', defaultMessage: 'Embed' }, - admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' }, - admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' }, - copy: { id: 'status.copy', defaultMessage: 'Copy link to status' }, - blockDomain: { id: 'account.block_domain', defaultMessage: 'Block domain {domain}' }, - unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' }, - unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, -}); - -const mapStateToProps = (state, { status }) => ({ - relationship: state.getIn(['relationships', status.getIn(['account', 'id'])]), -}); - -export default @connect(mapStateToProps) -@injectIntl -class ActionBar extends React.PureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - - static propTypes = { - status: ImmutablePropTypes.map.isRequired, - relationship: ImmutablePropTypes.map, - onReply: PropTypes.func.isRequired, - onReblog: PropTypes.func.isRequired, - onFavourite: PropTypes.func.isRequired, - onBookmark: PropTypes.func.isRequired, - onDelete: PropTypes.func.isRequired, - onDirect: PropTypes.func.isRequired, - onMention: PropTypes.func.isRequired, - onMute: PropTypes.func, - onUnmute: PropTypes.func, - onBlock: PropTypes.func, - onUnblock: PropTypes.func, - onBlockDomain: PropTypes.func, - onUnblockDomain: PropTypes.func, - onMuteConversation: PropTypes.func, - onReport: PropTypes.func, - onPin: PropTypes.func, - onEmbed: PropTypes.func, - intl: PropTypes.object.isRequired, - }; - - handleReplyClick = () => { - this.props.onReply(this.props.status); - } - - handleReblogClick = (e) => { - this.props.onReblog(this.props.status, e); - } - - handleFavouriteClick = () => { - this.props.onFavourite(this.props.status); - } - - handleBookmarkClick = (e) => { - this.props.onBookmark(this.props.status, e); - } - - handleDeleteClick = () => { - this.props.onDelete(this.props.status, this.context.router.history); - } - - handleRedraftClick = () => { - this.props.onDelete(this.props.status, this.context.router.history, true); - } - - handleDirectClick = () => { - this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } - - handleMentionClick = () => { - this.props.onMention(this.props.status.get('account'), this.context.router.history); - } - - handleMuteClick = () => { - const { status, relationship, onMute, onUnmute } = this.props; - const account = status.get('account'); - - if (relationship && relationship.get('muting')) { - onUnmute(account); - } else { - onMute(account); - } - } - - handleBlockClick = () => { - const { status, relationship, onBlock, onUnblock } = this.props; - const account = status.get('account'); - - if (relationship && relationship.get('blocking')) { - onUnblock(account); - } else { - onBlock(status); - } - } - - handleBlockDomain = () => { - const { status, onBlockDomain } = this.props; - const account = status.get('account'); - - onBlockDomain(account.get('acct').split('@')[1]); - } - - handleUnblockDomain = () => { - const { status, onUnblockDomain } = this.props; - const account = status.get('account'); - - onUnblockDomain(account.get('acct').split('@')[1]); - } - - handleConversationMuteClick = () => { - this.props.onMuteConversation(this.props.status); - } - - handleReport = () => { - this.props.onReport(this.props.status); - } - - handlePinClick = () => { - this.props.onPin(this.props.status); - } - - handleShare = () => { - navigator.share({ - text: this.props.status.get('search_index'), - url: this.props.status.get('url'), - }); - } - - handleEmbed = () => { - this.props.onEmbed(this.props.status); - } - - handleCopy = () => { - const url = this.props.status.get('url'); - const textarea = document.createElement('textarea'); - - textarea.textContent = url; - textarea.style.position = 'fixed'; - - document.body.appendChild(textarea); - - try { - textarea.select(); - document.execCommand('copy'); - } catch (e) { - - } finally { - document.body.removeChild(textarea); - } - } - - render () { - const { status, relationship, intl } = this.props; - - const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); - const mutingConversation = status.get('muted'); - const account = status.get('account'); - - let menu = []; - - if (publicStatus) { - menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy }); - menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed }); - menu.push(null); - } - - if (me === status.getIn(['account', 'id'])) { - if (publicStatus) { - menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); - } - - menu.push(null); - menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick }); - menu.push(null); - menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); - menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick }); - } else { - menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick }); - menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick }); - menu.push(null); - - if (relationship && relationship.get('muting')) { - menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.handleMuteClick }); - } else { - menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.handleMuteClick }); - } - - if (relationship && relationship.get('blocking')) { - menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.handleBlockClick }); - } else { - menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.handleBlockClick }); - } - - menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport }); - - if (account.get('acct') !== account.get('username')) { - const domain = account.get('acct').split('@')[1]; - - menu.push(null); - - if (relationship && relationship.get('domain_blocking')) { - menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.handleUnblockDomain }); - } else { - menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.handleBlockDomain }); - } - } - - if (isStaff) { - menu.push(null); - menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` }); - menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` }); - } - } - - const shareButton = ('share' in navigator) && publicStatus && ( -
- ); - - let replyIcon; - if (status.get('in_reply_to_id', null) === null) { - replyIcon = 'comment'; - } else { - replyIcon = 'reply'; - } - - const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private'; - - let reblogTitle; - if (status.get('reblogged')) { - reblogTitle = intl.formatMessage(messages.cancel_reblog_private); - } else if (publicStatus) { - reblogTitle = intl.formatMessage(messages.reblog); - } else if (reblogPrivate) { - reblogTitle = intl.formatMessage(messages.reblog_private); - } else { - reblogTitle = intl.formatMessage(messages.cannot_reblog); - } - - return ( -
-<<<<<<< HEAD -
-
-
-======= -
-
-
->>>>>>> master - {shareButton} -
- -
- -
-
- ); - } - -} diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js.orig b/app/javascript/mastodon/features/status/components/detailed_status.js.orig deleted file mode 100644 index b7ad9dda8..000000000 --- a/app/javascript/mastodon/features/status/components/detailed_status.js.orig +++ /dev/null @@ -1,271 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import Avatar from '../../../components/avatar'; -import DisplayName from '../../../components/display_name'; -import StatusContent from '../../../components/status_content'; -import MediaGallery from '../../../components/media_gallery'; -import { Link } from 'react-router-dom'; -import { injectIntl, defineMessages, FormattedDate } from 'react-intl'; -import Card from './card'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import Video from '../../video'; -import Audio from '../../audio'; -import scheduleIdleTask from '../../ui/util/schedule_idle_task'; -import classNames from 'classnames'; -import Icon from 'mastodon/components/icon'; -import AnimatedNumber from 'mastodon/components/animated_number'; - -const messages = defineMessages({ - public_short: { id: 'privacy.public.short', defaultMessage: 'Public' }, - unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' }, - private_short: { id: 'privacy.private.short', defaultMessage: 'Followers-only' }, - direct_short: { id: 'privacy.direct.short', defaultMessage: 'Direct' }, -}); - -export default @injectIntl -class DetailedStatus extends ImmutablePureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - - static propTypes = { - status: ImmutablePropTypes.map, - onOpenMedia: PropTypes.func.isRequired, - onOpenVideo: PropTypes.func.isRequired, - onToggleHidden: PropTypes.func.isRequired, - measureHeight: PropTypes.bool, - onHeightChange: PropTypes.func, - domain: PropTypes.string.isRequired, - compact: PropTypes.bool, - showMedia: PropTypes.bool, - onToggleMediaVisibility: PropTypes.func, - }; - - state = { - height: null, - }; - - handleAccountClick = (e) => { - if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) { - e.preventDefault(); - this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); - } - - e.stopPropagation(); - } - - handleOpenVideo = (media, options) => { - this.props.onOpenVideo(media, options); - } - - handleExpandedToggle = () => { - this.props.onToggleHidden(this.props.status); - } - - _measureHeight (heightJustChanged) { - if (this.props.measureHeight && this.node) { - scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 })); - - if (this.props.onHeightChange && heightJustChanged) { - this.props.onHeightChange(); - } - } - } - - setRef = c => { - this.node = c; - this._measureHeight(); - } - - componentDidUpdate (prevProps, prevState) { - this._measureHeight(prevState.height !== this.state.height); - } - - handleModalLink = e => { - e.preventDefault(); - - let href; - - if (e.target.nodeName !== 'A') { - href = e.target.parentNode.href; - } else { - href = e.target.href; - } - - window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); - } - - render () { - const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status; - const outerStyle = { boxSizing: 'border-box' }; -<<<<<<< HEAD - const { compact, deep } = this.props; -======= - const { intl, compact } = this.props; ->>>>>>> master - - if (!status) { - return null; - } - - let media = ''; - let applicationLink = ''; - let reblogLink = ''; - let reblogIcon = 'retweet'; - let favouriteLink = ''; - - if (this.props.measureHeight) { - outerStyle.height = `${this.state.height}px`; - } - - if (status.get('media_attachments').size > 0) { - if (status.getIn(['media_attachments', 0, 'type']) === 'audio') { - const attachment = status.getIn(['media_attachments', 0]); - - media = ( -