@ -140,11 +140,24 @@
if ( ( finalMessage . flags & textsecure . protobuf . PushMessageContent . Flags . END _SESSION )
== textsecure . protobuf . PushMessageContent . Flags . END _SESSION &&
finalMessage . sync !== null )
finalMessage . sync !== null )
res [ 1 ] ( ) ;
return finalMessage ;
}
} ;
var handlePreKeyWhisperMessage = function ( from , message ) {
try {
return axolotl . protocol . handlePreKeyWhisperMessage ( from , message ) ;
} catch ( e ) {
if ( e . message === 'Unknown identity key' ) {
// create an error that the UI will pick up and ask the
// user if they want to re-negotiate
throw new textsecure . IncomingIdentityKeyError ( from , message ) ;
}
throw e ;
}
} ;
window . textsecure = window . textsecure || { } ;
window . textsecure . protocol _wrapper = {
@ -159,7 +172,7 @@
if ( proto . message . readUint8 ( ) != ( ( 3 << 4 ) | 3 ) )
throw new Error ( "Bad version byte" ) ;
var from = proto . source + "." + ( proto . sourceDevice == null ? 0 : proto . sourceDevice ) ;
return axolotl. protocol . handlePreKeyWhisperMessage( from , getString ( proto . message ) ) . then ( decodeMessageContents ) ;
return handlePreKeyWhisperMessage( from , getString ( proto . message ) ) . then ( decodeMessageContents ) ;
case textsecure . protobuf . IncomingPushMessageSignal . Type . RECEIPT :
return Promise . resolve ( null ) ;
default :
@ -37187,8 +37200,7 @@ window.axolotl.protocol = function() {
if ( open _session !== undefined )
closeSession ( open _session ) ; // To be returned and saved later
} else {
// ...otherwise create an error that the UI will pick up and ask the user if they want to re-negotiate
throw new textsecure . IncomingIdentityKeyError ( encodedNumber , getString ( message . encode ( ) ) ) ;
throw new Error ( 'Unknown identity key' ) ;
}
}
return initSession ( false , preKeyPair , signedPreKeyPair , encodedNumber , toArrayBuffer ( message . identityKey ) , toArrayBuffer ( message . baseKey ) , undefined )