diff --git a/js/models/messages.js b/js/models/messages.js index 5851cef6b..032428d21 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -33,9 +33,6 @@ this.on('change:expireTimer', this.setToExpire); this.on('unload', this.unload); this.setToExpire(); - - this.VOICE_FLAG = - textsecure.protobuf.AttachmentPointer.Flags.VOICE_MESSAGE; }, idForLogging() { return `${this.get('source')}.${this.get('sourceDevice')} ${this.get( @@ -248,8 +245,7 @@ }); return Object.assign({}, attachment, { - // eslint-disable-next-line no-bitwise - isVoiceMessage: Boolean(attachment.flags & this.VOICE_FLAG), + isVoiceMessage: Signal.Types.Attachment.isVoiceMessage(attachment), thumbnail: thumbnailWithObjectUrl, }); }, diff --git a/ts/components/conversation/Message.md b/ts/components/conversation/Message.md index afefcd507..1b01c3cba 100644 --- a/ts/components/conversation/Message.md +++ b/ts/components/conversation/Message.md @@ -597,7 +597,7 @@ const outgoing = new Whisper.Message({ sent_at: Date.now() - 15000, attachments: [ { - flags: textsecure.protobuf.AttachmentPointer.Flags.VOICE_MESSAGE, + flags: SignalService.AttachmentPointer.Flags.VOICE_MESSAGE, data: util.mp3, fileName: 'agnus_dei.mp3', contentType: 'audio/mp3', diff --git a/ts/components/conversation/Quote.md b/ts/components/conversation/Quote.md index 7cdf0b514..5ab2f5896 100644 --- a/ts/components/conversation/Quote.md +++ b/ts/components/conversation/Quote.md @@ -572,7 +572,7 @@ const outgoing = new Whisper.Message({ attachments: [ { // proposed as of afternoon of 4/6 in Quoted Replies group - flags: textsecure.protobuf.AttachmentPointer.Flags.VOICE_MESSAGE, + flags: SignalService.AttachmentPointer.Flags.VOICE_MESSAGE, contentType: 'audio/mp3', fileName: 'agnus_dei.mp4', },