Send long text as an attachment instead of inline
Remove Android length warning Handle incoming long message attachments Show long download pending status in message bubble Fix the width of the smallest spinner Remove Android length warning from HTML templates
This commit is contained in:
@@ -11,6 +11,7 @@ const {
|
||||
saveMessage,
|
||||
setAttachmentDownloadJobPending,
|
||||
} = require('./data');
|
||||
const { stringFromBytes } = require('./crypto');
|
||||
|
||||
module.exports = {
|
||||
start,
|
||||
@@ -312,6 +313,19 @@ async function _addAttachmentToMessage(message, attachment, { type, index }) {
|
||||
|
||||
const logPrefix = `${message.idForLogging()} (type: ${type}, index: ${index})`;
|
||||
|
||||
if (type === 'long-message') {
|
||||
try {
|
||||
const { data } = await Signal.Migrations.loadAttachmentData(attachment);
|
||||
message.set({
|
||||
body: attachment.isError ? message.get('body') : stringFromBytes(data),
|
||||
bodyPending: false,
|
||||
});
|
||||
} finally {
|
||||
Signal.Migrations.deleteAttachmentData(attachment.path);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type === 'attachment') {
|
||||
const attachments = message.get('attachments');
|
||||
if (!attachments || attachments.length <= index) {
|
||||
|
Reference in New Issue
Block a user