feat: update proto

The new proto extract has a bunch of breaking changes, so if you were using the raw proto in your code somewhere -- then you may have to update your code to make it work with the new proto

!BREAKING_CHANGE
This commit is contained in:
Adhiraj Singh
2022-08-01 10:43:01 +05:30
parent 9c83cd96d2
commit 2549d10be9
22 changed files with 58772 additions and 55399 deletions

View File

@@ -79,7 +79,7 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
}
if(key.fromMe) {
fullMessage.status = proto.WebMessageInfo.WebMessageInfoStatus.SERVER_ACK
fullMessage.status = proto.WebMessageInfo.Status.SERVER_ACK
}
return {
@@ -92,7 +92,7 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
for(const { tag, attrs, content } of stanza.content) {
if(tag === 'verified_name' && content instanceof Uint8Array) {
const cert = proto.VerifiedNameCertificate.decode(content)
const details = proto.VerifiedNameDetails.decode(cert.details)
const details = proto.VerifiedNameCertificate.Details.decode(cert.details)
fullMessage.verifiedBizName = details.verifiedName
}
@@ -135,7 +135,7 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
fullMessage.message = msg
}
} catch(error) {
fullMessage.messageStubType = proto.WebMessageInfo.WebMessageInfoStubType.CIPHERTEXT
fullMessage.messageStubType = proto.WebMessageInfo.StubType.CIPHERTEXT
fullMessage.messageStubParameters = [error.message]
}
}
@@ -143,7 +143,7 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
// if nothing was found to decrypt
if(!decryptables) {
fullMessage.messageStubType = proto.WebMessageInfo.WebMessageInfoStubType.CIPHERTEXT
fullMessage.messageStubType = proto.WebMessageInfo.StubType.CIPHERTEXT
fullMessage.messageStubParameters = [NO_MESSAGE_FOUND_ERROR_TEXT]
}
})()