Request and handle PniIdentity sync message

This commit is contained in:
Fedor Indutny 2022-03-25 10:36:08 -07:00 committed by GitHub
parent 5a107e1bc3
commit a0ae7c1aa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 245 additions and 74 deletions

View file

@ -1266,6 +1266,29 @@ export default class MessageSender {
};
}
getRequestPniIdentitySyncMessage(): SingleProtoJobData {
const myUuid = window.textsecure.storage.user.getCheckedUuid();
const request = new Proto.SyncMessage.Request();
request.type = Proto.SyncMessage.Request.Type.PNI_IDENTITY;
const syncMessage = this.createSyncMessage();
syncMessage.request = request;
const contentMessage = new Proto.Content();
contentMessage.syncMessage = syncMessage;
const { ContentHint } = Proto.UnidentifiedSenderMessage.Message;
return {
contentHint: ContentHint.RESENDABLE,
identifier: myUuid.toString(),
isSyncMessage: true,
protoBase64: Bytes.toBase64(
Proto.Content.encode(contentMessage).finish()
),
type: 'pniIdentitySyncRequest',
};
}
getFetchManifestSyncMessage(): SingleProtoJobData {
const myUuid = window.textsecure.storage.user.getCheckedUuid();