Support for sending formatting messages
This commit is contained in:
parent
42e13aedcd
commit
9bfbee464b
65 changed files with 1762 additions and 371 deletions
|
@ -16,18 +16,22 @@ import { isNotNil } from './isNotNil';
|
|||
import { resetLinkPreview } from '../services/LinkPreview';
|
||||
import { getRecipientsByConversation } from './getRecipientsByConversation';
|
||||
import type { ContactWithHydratedAvatar } from '../textsecure/SendMessage';
|
||||
import type { DraftBodyRangeMention } from '../types/BodyRange';
|
||||
import type {
|
||||
DraftBodyRanges,
|
||||
HydratedBodyRangesType,
|
||||
} from '../types/BodyRange';
|
||||
import type { StickerWithHydratedData } from '../types/Stickers';
|
||||
import { drop } from './drop';
|
||||
import { toLogFormat } from '../types/errors';
|
||||
|
||||
export type MessageForwardDraft = Readonly<{
|
||||
originalMessageId: string;
|
||||
attachments?: ReadonlyArray<AttachmentType>;
|
||||
previews: ReadonlyArray<LinkPreviewType>;
|
||||
isSticker: boolean;
|
||||
bodyRanges?: HydratedBodyRangesType;
|
||||
hasContact: boolean;
|
||||
isSticker: boolean;
|
||||
messageBody?: string;
|
||||
originalMessageId: string;
|
||||
previews: ReadonlyArray<LinkPreviewType>;
|
||||
}>;
|
||||
|
||||
export type ForwardMessageData = Readonly<{
|
||||
|
@ -148,9 +152,9 @@ export async function maybeForwardMessages(
|
|||
// send along with the message and do the send to each conversation.
|
||||
const preparedMessages = await Promise.all(
|
||||
messages.map(async message => {
|
||||
const { originalMessage, draft } = message;
|
||||
const { draft, originalMessage } = message;
|
||||
const { sticker, contact } = originalMessage;
|
||||
const { messageBody, previews, attachments } = draft;
|
||||
const { attachments, bodyRanges, messageBody, previews } = draft;
|
||||
|
||||
const idForLogging = getMessageIdForLogging(originalMessage);
|
||||
log.info(`maybeForwardMessage: Forwarding ${idForLogging}`);
|
||||
|
@ -167,8 +171,8 @@ export async function maybeForwardMessages(
|
|||
let enqueuedMessage: {
|
||||
attachments: Array<AttachmentType>;
|
||||
body: string | undefined;
|
||||
bodyRanges?: DraftBodyRanges;
|
||||
contact?: Array<ContactWithHydratedAvatar>;
|
||||
mentions?: Array<DraftBodyRangeMention>;
|
||||
preview?: Array<LinkPreviewType>;
|
||||
quote?: QuotedMessageType;
|
||||
sticker?: StickerWithHydratedData;
|
||||
|
@ -215,6 +219,7 @@ export async function maybeForwardMessages(
|
|||
|
||||
enqueuedMessage = {
|
||||
body: messageBody || undefined,
|
||||
bodyRanges,
|
||||
attachments: attachmentsToSend,
|
||||
preview,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue