[Glitch] Include preview cards in status entity in REST API

Port 795f0107d2 to glitch-soc
This commit is contained in:
Thibaut Girka
2018-10-29 14:44:04 +01:00
committed by ThibG
parent 7f24242ef6
commit ac9780b844
6 changed files with 54 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import StatusIcons from './status_icons';
import StatusContent from './status_content';
import StatusActionBar from './status_action_bar';
import AttachmentList from './attachment_list';
import Card from '../features/status/components/card';
import { injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { MediaGallery, Video } from 'flavours/glitch/util/async-components';
@@ -477,6 +478,15 @@ export default class Status extends ImmutablePureComponent {
if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {
background = attachments.getIn([0, 'preview_url']);
}
} else if (status.get('card')) {
media = (
<Card
onOpenMedia={this.props.onOpenMedia}
card={status.get('card')}
compact
/>
);
//TODO: set mediaIcon?
}
// Here we prepare extra data-* attributes for CSS selectors.