Ensure we don't supply undefined to SyncMessage.Read protobuf

This commit is contained in:
Scott Nonnenberg 2021-03-19 09:34:30 -07:00 committed by Josh Perez
parent df45e6a95f
commit 58cb9fba6b
2 changed files with 4 additions and 4 deletions

4
ts/textsecure.d.ts vendored
View file

@ -1196,8 +1196,8 @@ export declare namespace SyncMessageClass {
groupIds?: Array<ProtoBinaryType>;
}
class Read {
sender?: string;
senderUuid?: string;
sender: string | null;
senderUuid: string | null;
timestamp?: ProtoBigNumberType;
}
class Request {

View file

@ -1232,8 +1232,8 @@ export default class MessageSender {
for (let i = 0; i < reads.length; i += 1) {
const read = new window.textsecure.protobuf.SyncMessage.Read();
read.timestamp = reads[i].timestamp;
read.sender = reads[i].senderE164;
read.senderUuid = reads[i].senderUuid;
read.sender = reads[i].senderE164 || null;
read.senderUuid = reads[i].senderUuid || null;
syncMessage.read.push(read);
}