Fix for storage service profileSharing setting
This commit is contained in:
parent
d82ce07942
commit
230604b451
2 changed files with 10 additions and 5 deletions
|
@ -846,7 +846,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
const after = this.get('profileSharing');
|
const after = this.get('profileSharing');
|
||||||
|
|
||||||
if (!viaStorageServiceSync && Boolean(before) !== Boolean(after)) {
|
if (!viaStorageServiceSync && Boolean(before) !== Boolean(after)) {
|
||||||
this.captureChange('profileSharing');
|
this.captureChange('enableProfileSharing');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +858,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
const after = this.get('profileSharing');
|
const after = this.get('profileSharing');
|
||||||
|
|
||||||
if (!viaStorageServiceSync && Boolean(before) !== Boolean(after)) {
|
if (!viaStorageServiceSync && Boolean(before) !== Boolean(after)) {
|
||||||
this.captureChange('profileSharing');
|
this.captureChange('disableProfileSharing');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4853,7 +4853,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
// [X] whitelisted
|
// [X] whitelisted
|
||||||
// [X] archived
|
// [X] archived
|
||||||
// [X] markedUnread
|
// [X] markedUnread
|
||||||
captureChange(property: string): void {
|
captureChange(logMessage: string): void {
|
||||||
if (!window.Signal.RemoteConfig.isEnabled('desktop.storageWrite2')) {
|
if (!window.Signal.RemoteConfig.isEnabled('desktop.storageWrite2')) {
|
||||||
window.log.info(
|
window.log.info(
|
||||||
'conversation.captureChange: Returning early; desktop.storageWrite2 is falsey'
|
'conversation.captureChange: Returning early; desktop.storageWrite2 is falsey'
|
||||||
|
@ -4864,7 +4864,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
|
|
||||||
window.log.info(
|
window.log.info(
|
||||||
'storageService[captureChange]',
|
'storageService[captureChange]',
|
||||||
property,
|
logMessage,
|
||||||
this.idForLogging()
|
this.idForLogging()
|
||||||
);
|
);
|
||||||
this.set({ needsStorageServiceSync: true });
|
this.set({ needsStorageServiceSync: true });
|
||||||
|
|
|
@ -282,7 +282,7 @@ function applyMessageRequestState(
|
||||||
conversation.unblock({ viaStorageServiceSync: true });
|
conversation.unblock({ viaStorageServiceSync: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!record.whitelisted) {
|
if (record.whitelisted === false) {
|
||||||
conversation.disableProfileSharing({ viaStorageServiceSync: true });
|
conversation.disableProfileSharing({ viaStorageServiceSync: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -392,6 +392,7 @@ export async function mergeGroupV1Record(
|
||||||
if (!conversation) {
|
if (!conversation) {
|
||||||
throw new Error(`No conversation for group(${groupId})`);
|
throw new Error(`No conversation for group(${groupId})`);
|
||||||
}
|
}
|
||||||
|
window.log.info('storageService.mergeGroupV1Record:', conversation.debugID());
|
||||||
|
|
||||||
if (!conversation.isGroupV1()) {
|
if (!conversation.isGroupV1()) {
|
||||||
throw new Error(`Record has group type mismatch ${conversation.debugID()}`);
|
throw new Error(`Record has group type mismatch ${conversation.debugID()}`);
|
||||||
|
@ -476,6 +477,8 @@ export async function mergeGroupV2Record(
|
||||||
const masterKeyBuffer = groupV2Record.masterKey.toArrayBuffer();
|
const masterKeyBuffer = groupV2Record.masterKey.toArrayBuffer();
|
||||||
const conversation = await getGroupV2Conversation(masterKeyBuffer);
|
const conversation = await getGroupV2Conversation(masterKeyBuffer);
|
||||||
|
|
||||||
|
window.log.info('storageService.mergeGroupV2Record:', conversation.debugID());
|
||||||
|
|
||||||
conversation.set({
|
conversation.set({
|
||||||
isArchived: Boolean(groupV2Record.archived),
|
isArchived: Boolean(groupV2Record.archived),
|
||||||
markedUnread: Boolean(groupV2Record.markedUnread),
|
markedUnread: Boolean(groupV2Record.markedUnread),
|
||||||
|
@ -551,6 +554,8 @@ export async function mergeContactRecord(
|
||||||
'private'
|
'private'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
window.log.info('storageService.mergeContactRecord:', conversation.debugID());
|
||||||
|
|
||||||
if (contactRecord.profileKey) {
|
if (contactRecord.profileKey) {
|
||||||
await conversation.setProfileKey(
|
await conversation.setProfileKey(
|
||||||
arrayBufferToBase64(contactRecord.profileKey.toArrayBuffer()),
|
arrayBufferToBase64(contactRecord.profileKey.toArrayBuffer()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue