From 1e93b12b90920bbc374831ddda0fd7f6102eda7e Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 22 Jun 2017 10:53:02 -0700 Subject: [PATCH] Update protos with support for null messages // FREEBIE --- js/background.js | 6 ++-- js/libtextsecure.js | 2 +- libtextsecure/sendmessage.js | 2 +- protos/IncomingPushMessageSignal.proto | 39 +++++++++++++++----------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/js/background.js b/js/background.js index 2ca0b2df877..3373862b3f9 100644 --- a/js/background.js +++ b/js/background.js @@ -297,13 +297,13 @@ var state; switch(ev.verified.state) { - case textsecure.protobuf.SyncMessage.Verified.State.DEFAULT: + case textsecure.protobuf.Verified.State.DEFAULT: state = 'DEFAULT'; break; - case textsecure.protobuf.SyncMessage.Verified.State.VERIFIED: + case textsecure.protobuf.Verified.State.VERIFIED: state = 'VERIFIED'; break; - case textsecure.protobuf.SyncMessage.Verified.State.UNVERIFIED: + case textsecure.protobuf.Verified.State.UNVERIFIED: state = 'UNVERIFIED'; break; } diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 52db7813848..953602cfc7f 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -39284,7 +39284,7 @@ MessageSender.prototype = { var myNumber = textsecure.storage.user.getNumber(); var myDevice = textsecure.storage.user.getDeviceId(); if (myDevice != 1) { - var verified = new textsecure.protobuf.SyncMessage.Verified(); + var verified = new textsecure.protobuf.Verified(); verified.state = state; verified.destination = destination; verified.identityKey = identityKey; diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index 83bec6219b4..2dd11a80c0e 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -322,7 +322,7 @@ MessageSender.prototype = { var myNumber = textsecure.storage.user.getNumber(); var myDevice = textsecure.storage.user.getDeviceId(); if (myDevice != 1) { - var verified = new textsecure.protobuf.SyncMessage.Verified(); + var verified = new textsecure.protobuf.Verified(); verified.state = state; verified.destination = destination; verified.identityKey = identityKey; diff --git a/protos/IncomingPushMessageSignal.proto b/protos/IncomingPushMessageSignal.proto index a3563f49e19..09abe982e12 100644 --- a/protos/IncomingPushMessageSignal.proto +++ b/protos/IncomingPushMessageSignal.proto @@ -25,6 +25,24 @@ message Content { optional DataMessage dataMessage = 1; optional SyncMessage syncMessage = 2; optional CallMessage callMessage = 3; + optional NullMessage nullMessage = 4; +} + +message NullMessage { + optional bytes padding = 1; +} + +message Verified { + enum State { + DEFAULT = 0; + VERIFIED = 1; + UNVERIFIED = 2; + } + + optional string destination = 1; + optional bytes identityKey = 2; + optional State state = 3; + optional bytes nullMessage = 4; } message CallMessage { @@ -111,18 +129,6 @@ message SyncMessage { optional uint64 timestamp = 2; } - message Verified { - enum State { - DEFAULT = 0; - VERIFIED = 1; - UNVERIFIED = 2; - } - - optional string destination = 1; - optional bytes identityKey = 2; - optional State state = 3; - } - optional Sent sent = 1; optional Contacts contacts = 2; optional Groups groups = 3; @@ -169,10 +175,11 @@ message ContactDetails { optional uint32 length = 2; } - optional string number = 1; - optional string name = 2; - optional Avatar avatar = 3; - optional string color = 4; + optional string number = 1; + optional string name = 2; + optional Avatar avatar = 3; + optional string color = 4; + optional Verified verified = 5; } message GroupDetails {