|
|
@ -6,6 +6,7 @@ import StatusHeader from './status_header'; |
|
|
|
import StatusIcons from './status_icons'; |
|
|
|
import StatusIcons from './status_icons'; |
|
|
|
import StatusContent from './status_content'; |
|
|
|
import StatusContent from './status_content'; |
|
|
|
import StatusActionBar from './status_action_bar'; |
|
|
|
import StatusActionBar from './status_action_bar'; |
|
|
|
|
|
|
|
import AttachmentList from './attachment_list'; |
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'; |
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'; |
|
|
|
import { MediaGallery, Video } from 'flavours/glitch/util/async-components'; |
|
|
|
import { MediaGallery, Video } from 'flavours/glitch/util/async-components'; |
|
|
|
import { HotKeys } from 'react-hotkeys'; |
|
|
|
import { HotKeys } from 'react-hotkeys'; |
|
|
@ -301,17 +302,22 @@ export default class Status extends ImmutablePureComponent { |
|
|
|
background = status.getIn(['account', 'header']); |
|
|
|
background = status.getIn(['account', 'header']); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This handles our media attachments. Note that we don't show media on
|
|
|
|
// This handles our media attachments.
|
|
|
|
// muted (notification) statuses. If the media type is unknown, then we
|
|
|
|
// If a media file is of unknwon type or if the status is muted
|
|
|
|
// simply ignore it.
|
|
|
|
// (notification), we show a list of links instead of embedded media.
|
|
|
|
|
|
|
|
|
|
|
|
// After we have generated our appropriate media element and stored it in
|
|
|
|
// After we have generated our appropriate media element and stored it in
|
|
|
|
// `media`, we snatch the thumbnail to use as our `background` if media
|
|
|
|
// `media`, we snatch the thumbnail to use as our `background` if media
|
|
|
|
// backgrounds for collapsed statuses are enabled.
|
|
|
|
// backgrounds for collapsed statuses are enabled.
|
|
|
|
attachments = status.get('media_attachments'); |
|
|
|
attachments = status.get('media_attachments'); |
|
|
|
if (attachments.size > 0 && !muted) { |
|
|
|
if (attachments.size > 0) { |
|
|
|
if (attachments.some(item => item.get('type') === 'unknown')) { // Media type is 'unknown'
|
|
|
|
if (muted || attachments.some(item => item.get('type') === 'unknown')) { |
|
|
|
/* Do nothing */ |
|
|
|
media = ( |
|
|
|
|
|
|
|
<AttachmentList |
|
|
|
|
|
|
|
compact |
|
|
|
|
|
|
|
media={status.get('media_attachments')} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
); |
|
|
|
} else if (attachments.getIn([0, 'type']) === 'video') { // Media type is 'video'
|
|
|
|
} else if (attachments.getIn([0, 'type']) === 'video') { // Media type is 'video'
|
|
|
|
const video = status.getIn(['media_attachments', 0]); |
|
|
|
const video = status.getIn(['media_attachments', 0]); |
|
|
|
|
|
|
|
|
|
|
|