Story view receipts setting

This commit is contained in:
Fedor Indutny 2022-10-25 15:18:42 -07:00 committed by GitHub
parent ad42d98774
commit 3702a67975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 161 additions and 35 deletions

View file

@ -68,6 +68,7 @@ export type IPCEventsValuesType = {
themeSetting: ThemeType;
universalExpireTimer: number;
zoomFactor: ZoomFactorType;
storyViewReceiptsEnabled: boolean;
// Optional
mediaPermissions: boolean;
@ -193,6 +194,16 @@ export function createIPCEvents(
account.captureChange('hasStoriesDisabled');
window.textsecure.server?.onHasStoriesDisabledChange(value);
},
getStoryViewReceiptsEnabled: () => {
return (
window.storage.get('storyViewReceiptsEnabled') ??
window.storage.get('read-receipt-setting') ??
false
);
},
setStoryViewReceiptsEnabled: async (value: boolean) => {
await window.storage.put('storyViewReceiptsEnabled', value);
},
getPreferredAudioInputDevice: () =>
window.storage.get('preferred-audio-input-device'),