rename LOKI_FRIEND_REQUEST to FALLBACK_MESSAGE

pull/1337/head
Audric Ackermann 5 years ago
parent a5474ac5e2
commit ec64ad80b4
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -11,5 +11,5 @@ module.exports = {
ENCRYPTED_MESSAGE_OVERHEAD: 53,
LOKI_FRIEND_REQUEST: 101,
FALLBACK_MESSAGE: 101,
};

@ -199,8 +199,8 @@ function _createUnidentifiedSenderMessageContentFromBuffer(serialized) {
case TypeEnum.PREKEY_MESSAGE:
type = CiphertextMessage.PREKEY_TYPE;
break;
case TypeEnum.LOKI_FRIEND_REQUEST:
type = CiphertextMessage.LOKI_FRIEND_REQUEST;
case TypeEnum.FALLBACK_MESSAGE:
type = CiphertextMessage.FALLBACK_MESSAGE;
break;
default:
throw new Error(`Unknown type: ${message.type}`);
@ -226,8 +226,8 @@ function _getProtoMessageType(type) {
return TypeEnum.MESSAGE;
case CiphertextMessage.PREKEY_TYPE:
return TypeEnum.PREKEY_MESSAGE;
case CiphertextMessage.LOKI_FRIEND_REQUEST:
return TypeEnum.LOKI_FRIEND_REQUEST;
case CiphertextMessage.FALLBACK_MESSAGE:
return TypeEnum.FALLBACK_MESSAGE;
default:
throw new Error(`_getProtoMessageType: type '${type}' does not exist`);
}
@ -481,7 +481,7 @@ SecretSessionCipher.prototype = {
signalProtocolStore,
sender
).decryptPreKeyWhisperMessage(message.content);
case CiphertextMessage.LOKI_FRIEND_REQUEST:
case CiphertextMessage.FALLBACK_MESSAGE:
return new libloki.crypto.FallBackSessionCipher(sender).decrypt(
message.content
);

@ -25,7 +25,7 @@ message UnidentifiedSenderMessage {
enum Type {
PREKEY_MESSAGE = 1;
MESSAGE = 2;
LOKI_FRIEND_REQUEST = 3;
FALLBACK_MESSAGE = 3;
}
optional Type type = 1;

Loading…
Cancel
Save