GroupsV2: Register GV2 capabilities properly
This commit is contained in:
parent
cad9803d38
commit
9fae795e8f
2 changed files with 7 additions and 7 deletions
|
@ -1895,9 +1895,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
const hasRegisteredGroupV2SupportKey = 'hasRegisteredGroupV2Support';
|
||||
const hasRegisteredGV2Support = 'hasRegisteredGV2Support';
|
||||
if (
|
||||
!storage.get(hasRegisteredGroupV2SupportKey) &&
|
||||
!storage.get(hasRegisteredGV2Support) &&
|
||||
textsecure.storage.user.getUuid()
|
||||
) {
|
||||
const server = WebAPI.connect({
|
||||
|
@ -1906,10 +1906,10 @@
|
|||
});
|
||||
try {
|
||||
await server.registerCapabilities({ gv2: true });
|
||||
storage.put(hasRegisteredGroupV2SupportKey, true);
|
||||
storage.put(hasRegisteredGV2Support, true);
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
'Error: Unable to register support for GroupV2.',
|
||||
'Error: Unable to register support for GV2.',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
}
|
||||
|
|
|
@ -775,7 +775,7 @@ export type WebAPIType = {
|
|||
) => Promise<GroupChangeClass>;
|
||||
modifyStorageRecords: MessageSender['modifyStorageRecords'];
|
||||
putAttachment: (encryptedBin: ArrayBuffer) => Promise<any>;
|
||||
registerCapabilities: (capabilities: any) => Promise<void>;
|
||||
registerCapabilities: (capabilities: Dictionary<boolean>) => Promise<void>;
|
||||
putStickers: (
|
||||
encryptedManifest: ArrayBuffer,
|
||||
encryptedStickers: Array<ArrayBuffer>,
|
||||
|
@ -1128,11 +1128,11 @@ export function initialize({
|
|||
});
|
||||
}
|
||||
|
||||
async function registerCapabilities(capabilities: any) {
|
||||
async function registerCapabilities(capabilities: Dictionary<boolean>) {
|
||||
return _ajax({
|
||||
call: 'registerCapabilities',
|
||||
httpType: 'PUT',
|
||||
jsonData: { capabilities },
|
||||
jsonData: capabilities,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue