rename missing envelope type FR to SESSION_REQUEST

pull/1178/head
Audric Ackermann 5 years ago
parent 38f64cf172
commit f500fed69c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -153,7 +153,7 @@
ivAndCiphertext ivAndCiphertext
).toString('binary'); ).toString('binary');
return { return {
type: textsecure.protobuf.Envelope.Type.FRIEND_REQUEST, type: textsecure.protobuf.Envelope.Type.SESSION_REQUEST,
body: binaryIvAndCiphertext, body: binaryIvAndCiphertext,
registrationId: undefined, registrationId: undefined,
}; };

@ -24,7 +24,7 @@ describe('Crypto', () => {
const { type } = await fallbackCipher.encrypt(buffer); const { type } = await fallbackCipher.encrypt(buffer);
assert.strictEqual( assert.strictEqual(
type, type,
textsecure.protobuf.Envelope.Type.FRIEND_REQUEST textsecure.protobuf.Envelope.Type.SESSION_REQUEST
); );
}); });

@ -744,7 +744,7 @@ MessageReceiver.prototype.extend({
case textsecure.protobuf.Envelope.Type.MEDIUM_GROUP_CIPHERTEXT: case textsecure.protobuf.Envelope.Type.MEDIUM_GROUP_CIPHERTEXT:
promise = this.decryptForMediumGroup(envelope, ciphertext); promise = this.decryptForMediumGroup(envelope, ciphertext);
break; break;
case textsecure.protobuf.Envelope.Type.FRIEND_REQUEST: { case textsecure.protobuf.Envelope.Type.SESSION_REQUEST: {
window.log.info('friend-request message from ', envelope.source); window.log.info('friend-request message from ', envelope.source);
const fallBackSessionCipher = new libloki.crypto.FallBackSessionCipher( const fallBackSessionCipher = new libloki.crypto.FallBackSessionCipher(
@ -784,10 +784,10 @@ MessageReceiver.prototype.extend({
} }
// We might have substituted the type based on decrypted content // We might have substituted the type based on decrypted content
if (type === textsecure.protobuf.Envelope.Type.FRIEND_REQUEST) { if (type === textsecure.protobuf.Envelope.Type.SESSION_REQUEST) {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
envelope.type = envelope.type =
textsecure.protobuf.Envelope.Type.FRIEND_REQUEST; textsecure.protobuf.Envelope.Type.SESSION_REQUEST;
} }
if (this.isBlocked(sender.getName())) { if (this.isBlocked(sender.getName())) {

@ -1178,7 +1178,7 @@ MessageSender.prototype = {
}; };
// Loki - Temp hack for new protocol // Loki - Temp hack for new protocol
// A session reset should be a `FRIEND_REQUEST` // A session reset should be a `SESSION_REQUEST`
const msgOptions = { const msgOptions = {
messageType: 'friend-request', messageType: 'friend-request',
...options, ...options,

Loading…
Cancel
Save