Include remote registrationId in encryption result

The signal service requires this field to accompany outgoing ciphertexts.
With this change we can likely remove the correspinding getter from
SessionCipher.
This commit is contained in:
lilia 2016-08-11 15:52:25 -07:00
parent fbc6554d6f
commit dd4e8375cd
2 changed files with 22 additions and 4 deletions

View File

@ -36124,9 +36124,18 @@ SessionCipher.prototype = {
preKeyMsg.message = message;
var result = String.fromCharCode((3 << 4) | 3) + util.toString(preKeyMsg.encode());
return {type: 3, body: result};
return {
type : 3,
body : result,
registrationId : record.registrationId
};
} else {
return {type: 1, body: util.toString(message)};
return {
type : 1,
body : util.toString(message),
registrationId : record.registrationId
};
}
});
}.bind(this));

View File

@ -94,9 +94,18 @@ SessionCipher.prototype = {
preKeyMsg.message = message;
var result = String.fromCharCode((3 << 4) | 3) + util.toString(preKeyMsg.encode());
return {type: 3, body: result};
return {
type : 3,
body : result,
registrationId : record.registrationId
};
} else {
return {type: 1, body: util.toString(message)};
return {
type : 1,
body : util.toString(message),
registrationId : record.registrationId
};
}
});
}.bind(this));