Fix a missing function and dont blow up on delivery receipts

This commit is contained in:
Matt Corallo 2014-07-26 01:53:24 -04:00
parent d9f53d4c01
commit f6f35c5b61
4 changed files with 13 additions and 1 deletions

View file

@ -656,6 +656,11 @@ window.textsecure.subscribeToPush = function(message_callback) {
console.log("Successfully decoded message with id: " + message.id);
socket.send(JSON.stringify({type: 1, id: message.id}));
return textsecure.crypto.handleIncomingPushMessageProto(proto).then(function(decrypted) {
// Delivery receipt
if (decrypted === null)
//TODO: Pass to UI
return;
// Now that its decrypted, validate the message and clean it up for consumer processing
// Note that messages may (generally) only perform one action and we ignore remaining fields
// after the first action.