Remove separate mime for video call messages.

This commit is contained in:
aforge
2022-05-29 23:44:31 +03:00
parent 3c87341280
commit 9dc1f6f3a7
9 changed files with 15 additions and 43 deletions
+1 -2
View File
@@ -8,7 +8,6 @@ import Attachment from './attachment.jsx';
import LetterTile from './letter-tile.jsx';
import ReceivedMarker from './received-marker.jsx'
import { CALL_MESSAGE_MIME_TYPE } from '../constants.js'
import { fullFormatter } from '../lib/formatters.js';
import { isVideoCall, sanitizeUrl } from '../lib/utils.js';
@@ -126,7 +125,7 @@ class BaseChatMessage extends React.PureComponent {
let content = this.props.content;
const attachments = [];
if ([Drafty.getContentType(), CALL_MESSAGE_MIME_TYPE].includes(this.props.mimeType) && Drafty.isValid(content)) {
if (this.props.mimeType == Drafty.getContentType() && Drafty.isValid(content)) {
Drafty.attachments(content, (att, i) => {
if (att.mime == 'application/json') {
// Don't show json objects as attachments.
+1 -2
View File
@@ -9,7 +9,6 @@ import Contact from './contact.jsx';
import ContactAction from './contact-action.jsx';
import { makeImageUrl } from '../lib/blob-helpers.js';
import { isVideoCall } from '../lib/utils.js'
import { MESSAGE_PREVIEW_LENGTH } from '../config.js';
@@ -86,7 +85,7 @@ class ContactList extends React.Component {
if (msg) {
forwarded = msg.head ? msg.head.forwarded : null;
deliveryStatus = msg._status || c.msgStatus(msg, true);
previewIsVideoCall = msg.head ? isVideoCall(msg.head.mime) : null;
previewIsVideoCall = msg.head ? (msg.head.webrtc !== undefined) : null;
previewIsResponse = msg.from != this.props.myUserId;
if (msg.content) {
preview = typeof msg.content == 'string' ?