@mentions receive support
This commit is contained in:
parent
c126a71864
commit
9657c38987
18 changed files with 555 additions and 23 deletions
|
@ -30,6 +30,7 @@ import {
|
|||
StorageServiceCredentials,
|
||||
} from '../textsecure.d';
|
||||
import { MessageError, SignedPreKeyRotationError } from './Errors';
|
||||
import { BodyRangesType } from '../types/Util';
|
||||
|
||||
function stringToArrayBuffer(str: string): ArrayBuffer {
|
||||
if (typeof str !== 'string') {
|
||||
|
@ -258,7 +259,7 @@ class Message {
|
|||
}
|
||||
if (this.quote) {
|
||||
const { QuotedAttachment } = window.textsecure.protobuf.DataMessage.Quote;
|
||||
const { Quote } = window.textsecure.protobuf.DataMessage;
|
||||
const { BodyRange, Quote } = window.textsecure.protobuf.DataMessage;
|
||||
|
||||
proto.quote = new Quote();
|
||||
const { quote } = proto;
|
||||
|
@ -279,6 +280,14 @@ class Message {
|
|||
return quotedAttachment;
|
||||
}
|
||||
);
|
||||
const bodyRanges: BodyRangesType = this.quote.bodyRanges || [];
|
||||
quote.bodyRanges = bodyRanges.map(range => {
|
||||
const bodyRange = new BodyRange();
|
||||
bodyRange.start = range.start;
|
||||
bodyRange.length = range.length;
|
||||
bodyRange.mentionUuid = range.mentionUuid;
|
||||
return bodyRange;
|
||||
});
|
||||
}
|
||||
if (this.expireTimer) {
|
||||
proto.expireTimer = this.expireTimer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue