fix & improve voice message preview in home screen

pull/541/head
Ryan Zhao 3 years ago
parent 821bd4cadb
commit 6b231316ee

@ -185,7 +185,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4;
if (self.isVoiceMessage || !self.sourceFilename || self.sourceFilename.length == 0) { if (self.isVoiceMessage || !self.sourceFilename || self.sourceFilename.length == 0) {
attachmentString = NSLocalizedString(@"ATTACHMENT_TYPE_VOICE_MESSAGE", attachmentString = NSLocalizedString(@"ATTACHMENT_TYPE_VOICE_MESSAGE",
@"Short text label for a voice message attachment, used for thread preview and on the lock screen"); @"Short text label for a voice message attachment, used for thread preview and on the lock screen");
return [NSString stringWithFormat:@"🎤 %@", attachmentString]; return [NSString stringWithFormat:@"🎙️ %@", attachmentString];
} }
} }

@ -59,6 +59,7 @@ public final class MessageSender : NSObject {
signalAttachments.forEach { signalAttachments.forEach {
let attachment = TSAttachmentStream(contentType: $0.mimeType, byteCount: UInt32($0.dataLength), sourceFilename: $0.sourceFilename, let attachment = TSAttachmentStream(contentType: $0.mimeType, byteCount: UInt32($0.dataLength), sourceFilename: $0.sourceFilename,
caption: $0.captionText, albumMessageId: tsMessage.uniqueId!) caption: $0.captionText, albumMessageId: tsMessage.uniqueId!)
attachment.attachmentType = $0.isVoiceMessage ? .voiceMessage : .default
attachments.append(attachment) attachments.append(attachment)
attachment.write($0.dataSource) attachment.write($0.dataSource)
attachment.save(with: transaction) attachment.save(with: transaction)

Loading…
Cancel
Save