Adds message forwarding

This commit is contained in:
Josh Perez 2021-04-27 15:35:35 -07:00 committed by GitHub
parent cd489a35fd
commit d203f125c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 1638 additions and 139 deletions

View file

@ -46,6 +46,7 @@ import {
import { PropsType as ProfileChangeNotificationPropsType } from '../components/conversation/ProfileChangeNotification';
import { AttachmentType, isImage, isVideo } from '../types/Attachment';
import { MIMEType } from '../types/MIME';
import { LinkPreviewType } from '../types/message/LinkPreviews';
/* eslint-disable camelcase */
/* eslint-disable more/no-then */
@ -1139,7 +1140,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
};
}
getPropsForPreview(): WhatIsThis {
getPropsForPreview(): Array<LinkPreviewType> {
const previews = this.get('preview') || [];
return previews.map(preview => ({
@ -1592,6 +1593,17 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
return { text: '' };
}
getRawText(): string {
const body = (this.get('body') || '').trim();
const bodyRanges = this.processBodyRanges();
if (bodyRanges) {
return getTextWithMentions(bodyRanges, body);
}
return body;
}
getNotificationText(): string {
const { text, emoji } = this.getNotificationData();