Update to the latest SignalService.proto
This commit is contained in:
parent
cf5dc4b940
commit
d26d915a44
26 changed files with 464 additions and 536 deletions
|
@ -447,8 +447,8 @@ export default class MessageReceiver
|
|||
serverTimestamp,
|
||||
urgent: isBoolean(decoded.urgent) ? decoded.urgent : true,
|
||||
story: decoded.story ?? false,
|
||||
reportingToken: Bytes.isNotEmpty(decoded.reportingToken)
|
||||
? decoded.reportingToken
|
||||
reportingToken: Bytes.isNotEmpty(decoded.reportSpamToken)
|
||||
? decoded.reportSpamToken
|
||||
: undefined,
|
||||
groupId: undefined,
|
||||
};
|
||||
|
@ -1447,7 +1447,7 @@ export default class MessageReceiver
|
|||
throw new Error('Unsealed envelope dropped due to stopping processing');
|
||||
}
|
||||
|
||||
if (envelope.type === Proto.Envelope.Type.RECEIPT) {
|
||||
if (envelope.type === Proto.Envelope.Type.SERVER_DELIVERY_RECEIPT) {
|
||||
strictAssert(
|
||||
envelope.sourceServiceId,
|
||||
'Unsealed delivery receipt must have sourceServiceId'
|
||||
|
@ -2145,7 +2145,7 @@ export default class MessageReceiver
|
|||
logUnexpectedUrgentValue(envelope, 'sentSync');
|
||||
|
||||
const {
|
||||
destination,
|
||||
destinationE164,
|
||||
destinationServiceId,
|
||||
timestamp,
|
||||
message: msg,
|
||||
|
@ -2178,7 +2178,7 @@ export default class MessageReceiver
|
|||
const ev = new SentEvent(
|
||||
{
|
||||
envelopeId: envelope.id,
|
||||
destination: dropNull(destination),
|
||||
destinationE164: dropNull(destinationE164),
|
||||
destinationServiceId,
|
||||
timestamp: timestamp?.toNumber(),
|
||||
serverTimestamp: envelope.serverTimestamp,
|
||||
|
@ -2673,8 +2673,8 @@ export default class MessageReceiver
|
|||
this.#handleNullMessage(envelope);
|
||||
return;
|
||||
}
|
||||
if (content.callingMessage) {
|
||||
await this.#handleCallingMessage(envelope, content.callingMessage);
|
||||
if (content.callMessage) {
|
||||
await this.#handleCallingMessage(envelope, content.callMessage);
|
||||
return;
|
||||
}
|
||||
if (content.receiptMessage) {
|
||||
|
@ -2832,7 +2832,7 @@ export default class MessageReceiver
|
|||
|
||||
async #handleCallingMessage(
|
||||
envelope: UnsealedEnvelope,
|
||||
callingMessage: Proto.ICallingMessage
|
||||
callingMessage: Proto.ICallMessage
|
||||
): Promise<void> {
|
||||
logUnexpectedUrgentValue(envelope, 'callingMessage');
|
||||
|
||||
|
@ -3215,7 +3215,7 @@ export default class MessageReceiver
|
|||
}
|
||||
|
||||
const {
|
||||
destination,
|
||||
destinationE164,
|
||||
destinationServiceId,
|
||||
expirationStartTimestamp,
|
||||
unidentifiedStatus,
|
||||
|
@ -3227,7 +3227,7 @@ export default class MessageReceiver
|
|||
const ev = new SentEvent(
|
||||
{
|
||||
envelopeId: envelope.id,
|
||||
destination: dropNull(destination),
|
||||
destinationE164: dropNull(destinationE164),
|
||||
destinationServiceId,
|
||||
timestamp: envelope.timestamp,
|
||||
serverTimestamp: envelope.serverTimestamp,
|
||||
|
@ -3274,7 +3274,6 @@ export default class MessageReceiver
|
|||
|
||||
const ev = new ViewOnceOpenSyncEvent(
|
||||
{
|
||||
source: dropNull(sync.sender),
|
||||
sourceAci: sync.senderAci
|
||||
? normalizeAci(sync.senderAci, 'handleViewOnceOpen.senderUuid')
|
||||
: undefined,
|
||||
|
@ -3311,7 +3310,6 @@ export default class MessageReceiver
|
|||
const ev = new MessageRequestResponseEvent(
|
||||
{
|
||||
envelopeId: envelope.id,
|
||||
threadE164: dropNull(sync.threadE164),
|
||||
threadAci: sync.threadAci
|
||||
? normalizeAci(
|
||||
sync.threadAci,
|
||||
|
@ -3454,11 +3452,10 @@ export default class MessageReceiver
|
|||
logUnexpectedUrgentValue(envelope, 'readSync');
|
||||
|
||||
const reads = read.map(
|
||||
({ timestamp, sender, senderAci }): ReadSyncEventData => ({
|
||||
({ timestamp, senderAci }): ReadSyncEventData => ({
|
||||
envelopeId: envelope.id,
|
||||
envelopeTimestamp: envelope.timestamp,
|
||||
timestamp: timestamp?.toNumber(),
|
||||
sender: dropNull(sender),
|
||||
senderAci: senderAci
|
||||
? normalizeAci(senderAci, 'handleRead.senderAci')
|
||||
: undefined,
|
||||
|
@ -3486,9 +3483,8 @@ export default class MessageReceiver
|
|||
logUnexpectedUrgentValue(envelope, 'viewSync');
|
||||
|
||||
const views = viewed.map(
|
||||
({ timestamp, senderE164, senderAci }): ViewSyncEventData => ({
|
||||
({ timestamp, senderAci }): ViewSyncEventData => ({
|
||||
timestamp: timestamp?.toNumber(),
|
||||
senderE164: dropNull(senderE164),
|
||||
senderAci: senderAci
|
||||
? normalizeAci(senderAci, 'handleViewed.senderAci')
|
||||
: undefined,
|
||||
|
@ -4027,18 +4023,13 @@ function envelopeTypeToCiphertextType(type: number | undefined): number {
|
|||
if (type === Type.CIPHERTEXT) {
|
||||
return CiphertextMessageType.Whisper;
|
||||
}
|
||||
if (type === Type.KEY_EXCHANGE) {
|
||||
throw new Error(
|
||||
'envelopeTypeToCiphertextType: Cannot process KEY_EXCHANGE messages'
|
||||
);
|
||||
}
|
||||
if (type === Type.PLAINTEXT_CONTENT) {
|
||||
return CiphertextMessageType.Plaintext;
|
||||
}
|
||||
if (type === Type.PREKEY_BUNDLE) {
|
||||
return CiphertextMessageType.PreKey;
|
||||
}
|
||||
if (type === Type.RECEIPT) {
|
||||
if (type === Type.SERVER_DELIVERY_RECEIPT) {
|
||||
return CiphertextMessageType.Plaintext;
|
||||
}
|
||||
if (type === Type.UNIDENTIFIED_SENDER) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue