Fix references to GroupContext Type ENUM values
This commit is contained in:
parent
01f9fc1f17
commit
5b0573293f
2 changed files with 11 additions and 11 deletions
|
@ -648,7 +648,7 @@ window.textsecure.subscribeToPush = function(message_callback) {
|
|||
if (decrypted.group !== null) {
|
||||
var existingGroup = textsecure.storage.groups.getNumbers(decrypted.group.id);
|
||||
if (existingGroup === undefined) {
|
||||
if (decrypted.group.type != textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE)
|
||||
if (decrypted.group.type != textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE)
|
||||
throw new Error("Got message for unknown group");
|
||||
textsecure.storage.groups.createNewGroup(decrypted.group.members, decrypted.group.id);
|
||||
} else {
|
||||
|
@ -658,7 +658,7 @@ window.textsecure.subscribeToPush = function(message_callback) {
|
|||
throw new Error("Sender was not a member of the group they were sending from");
|
||||
|
||||
switch(decrypted.group.type) {
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE:
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE:
|
||||
if (decrypted.group.avatar !== null)
|
||||
promises.push(handleAttachment(decrypted.group.avatar));
|
||||
|
||||
|
@ -681,12 +681,12 @@ window.textsecure.subscribeToPush = function(message_callback) {
|
|||
decrypted.attachments = [];
|
||||
|
||||
break;
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.QUIT:
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.QUIT:
|
||||
textsecure.storage.groups.removeNumber(decrypted.group.id, proto.source);
|
||||
|
||||
decrypted.body = null;
|
||||
decrypted.attachments = [];
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.DELIVER:
|
||||
case textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.DELIVER:
|
||||
decrypted.group.name = null;
|
||||
decrypted.group.members = [];
|
||||
decrypted.group.avatar = null;
|
||||
|
|
|
@ -83,7 +83,7 @@ window.textsecure.messaging = function() {
|
|||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
|
||||
proto.group.id = group.id;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE;
|
||||
proto.group.members = group.numbers;
|
||||
proto.group.name = group.name === undefined ? null : group.name;
|
||||
|
||||
|
@ -264,7 +264,7 @@ window.textsecure.messaging = function() {
|
|||
proto.body = messageText;
|
||||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
proto.group.id = groupId;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.DELIVER;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.DELIVER;
|
||||
|
||||
var numbers = textsecure.storage.groups.getNumbers(groupId);
|
||||
if (numbers === undefined)
|
||||
|
@ -287,7 +287,7 @@ window.textsecure.messaging = function() {
|
|||
proto.group.id = group.id;
|
||||
var numbers = group.numbers;
|
||||
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE;
|
||||
proto.group.members = numbers;
|
||||
proto.group.name = name;
|
||||
|
||||
|
@ -309,7 +309,7 @@ window.textsecure.messaging = function() {
|
|||
var proto = new textsecure.protos.PushMessageContentProtobuf();
|
||||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
proto.group.id = groupId;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE;
|
||||
|
||||
var numbers = textsecure.storage.groups.addNumbers(groupId, [number]);
|
||||
if (numbers === undefined)
|
||||
|
@ -323,7 +323,7 @@ window.textsecure.messaging = function() {
|
|||
var proto = new textsecure.protos.PushMessageContentProtobuf();
|
||||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
proto.group.id = groupId;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE;
|
||||
proto.group.name = name;
|
||||
|
||||
var numbers = textsecure.storage.groups.getNumbers(groupId);
|
||||
|
@ -338,7 +338,7 @@ window.textsecure.messaging = function() {
|
|||
var proto = new textsecure.protos.PushMessageContentProtobuf();
|
||||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
proto.group.id = groupId;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.UPDATE;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.UPDATE;
|
||||
|
||||
var numbers = textsecure.storage.groups.getNumbers(groupId);
|
||||
if (numbers === undefined)
|
||||
|
@ -355,7 +355,7 @@ window.textsecure.messaging = function() {
|
|||
var proto = new textsecure.protos.PushMessageContentProtobuf();
|
||||
proto.group = new textsecure.protos.PushMessageContentProtobuf.GroupContext();
|
||||
proto.group.id = groupId;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.QUIT;
|
||||
proto.group.type = textsecure.protos.PushMessageContentProtobuf.GroupContext.Type.QUIT;
|
||||
|
||||
var numbers = textsecure.storage.groups.getNumbers(groupId);
|
||||
if (numbers === undefined)
|
||||
|
|
Loading…
Reference in a new issue