From 9704e9eefbd2f3d8dbf8f9815b9ffe3f6ddacc7c Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 9 Oct 2023 00:58:12 +0000 Subject: [PATCH 1/3] feat: add developer option to disable IMAP IDLE --- CHANGELOG.md | 1 + _locales/_untranslated_en.json | 6 ++++++ .../components/dialogs/Settings-ImapFolderHandling.tsx | 5 +++++ src/renderer/stores/settings.ts | 2 ++ 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd32261e6..72e88d9d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - mark webxdc app context as secure #3413 - Experimental: Related Chats +- Developer option to disable IMAP IDLE #4803 ### Changed - update deltachat-node and deltachat/jsonrpc-client to `v1.123.0` diff --git a/_locales/_untranslated_en.json b/_locales/_untranslated_en.json index 1c0056d686..081afba7d4 100644 --- a/_locales/_untranslated_en.json +++ b/_locales/_untranslated_en.json @@ -32,6 +32,12 @@ "pref_donate": { "message": "Donate" }, + "pref_disable_idle_title": { + "message": "Disable IMAP IDLE" + }, + "pref_disable_idle_explain": { + "message": "Do not use IMAP IDLE extension even if the server supports it. Enabling this option will delay message retrieval, enable it only for testing." + }, "clear_chat": { "message": "Clear Chat" }, diff --git a/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx b/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx index e7b3c00ebc..6fc4f95153 100644 --- a/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx +++ b/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx @@ -41,6 +41,11 @@ export default function SettingsImapFolderHandling({ key: 'only_fetch_mvbox', description: tx('pref_only_fetch_mvbox_explain'), })} + {renderDeltaSwitch2({ + label: tx('pref_disable_idle_title'), + key: 'disable_idle', + description: tx('pref_disable_idle_explain'), + })} ) } diff --git a/src/renderer/stores/settings.ts b/src/renderer/stores/settings.ts index a00397bf47..65600b6511 100644 --- a/src/renderer/stores/settings.ts +++ b/src/renderer/stores/settings.ts @@ -23,6 +23,7 @@ export interface SettingsStoreState { webrtc_instance: string download_limit: string only_fetch_mvbox: string + disable_idle: string 'ui.lastchatid': string } desktopSettings: DesktopSettingsType @@ -44,6 +45,7 @@ const settingsKeys: Array = [ 'webrtc_instance', 'download_limit', 'only_fetch_mvbox', + 'disable_idle', 'ui.lastchatid', ] From 91eee34e057ae07187912a08a6079b2917104912 Mon Sep 17 00:00:00 2001 From: SimonLaux Date: Sat, 14 Oct 2023 06:20:44 +0200 Subject: [PATCH 2/3] move setting to experimental --- src/renderer/components/dialogs/Settings-Advanced.tsx | 1 + .../dialogs/Settings-ExperimentalFeatures.tsx | 11 +++++++++-- .../dialogs/Settings-ImapFolderHandling.tsx | 5 ----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/dialogs/Settings-Advanced.tsx b/src/renderer/components/dialogs/Settings-Advanced.tsx index f56f2c4aa5..8376a40df3 100644 --- a/src/renderer/components/dialogs/Settings-Advanced.tsx +++ b/src/renderer/components/dialogs/Settings-Advanced.tsx @@ -41,6 +41,7 @@ export function SettingsAdvanced({ ) diff --git a/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx b/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx index 9529463430..6447d26af3 100644 --- a/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx +++ b/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx @@ -1,6 +1,6 @@ import React, { useState, useContext } from 'react' import { Card, Elevation } from '@blueprintjs/core' -import { RenderDTSettingSwitchType, SettingsSelector } from './Settings' +import { RenderDeltaSwitch2Type, RenderDTSettingSwitchType, SettingsSelector } from './Settings' import { ScreenContext, useTranslationFunction } from '../../contexts' import { DeltaInput } from '../Login-Styles' import { @@ -22,9 +22,11 @@ const VIDEO_CHAT_INSTANCE_AUTISTICI = 'https://vc.autistici.org/$ROOM' export function SettingsExperimentalFeatures({ settingsStore, renderDTSettingSwitch, + renderDeltaSwitch2 }: { renderDTSettingSwitch: RenderDTSettingSwitchType settingsStore: SettingsStoreState + renderDeltaSwitch2: RenderDeltaSwitch2Type }) { const tx = window.static_translate const { openDialog } = useContext(ScreenContext) @@ -94,6 +96,11 @@ export function SettingsExperimentalFeatures({ description: 'Careful: opening developer tools on a malicious webxdc app could lead to the app getting access to the Internet', })} + {renderDeltaSwitch2({ + label: tx('pref_disable_idle_title'), + key: 'disable_idle', + description: tx('pref_disable_idle_explain'), + })} ) -} +} \ No newline at end of file diff --git a/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx b/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx index 6fc4f95153..e7b3c00ebc 100644 --- a/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx +++ b/src/renderer/components/dialogs/Settings-ImapFolderHandling.tsx @@ -41,11 +41,6 @@ export default function SettingsImapFolderHandling({ key: 'only_fetch_mvbox', description: tx('pref_only_fetch_mvbox_explain'), })} - {renderDeltaSwitch2({ - label: tx('pref_disable_idle_title'), - key: 'disable_idle', - description: tx('pref_disable_idle_explain'), - })} ) } From 76281a02a4345fd3c9b3f744ad80516e559084b5 Mon Sep 17 00:00:00 2001 From: SimonLaux Date: Sat, 14 Oct 2023 06:21:12 +0200 Subject: [PATCH 3/3] fix formatting --- .../dialogs/Settings-ExperimentalFeatures.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx b/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx index 6447d26af3..e45236de9d 100644 --- a/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx +++ b/src/renderer/components/dialogs/Settings-ExperimentalFeatures.tsx @@ -1,6 +1,10 @@ import React, { useState, useContext } from 'react' import { Card, Elevation } from '@blueprintjs/core' -import { RenderDeltaSwitch2Type, RenderDTSettingSwitchType, SettingsSelector } from './Settings' +import { + RenderDeltaSwitch2Type, + RenderDTSettingSwitchType, + SettingsSelector, +} from './Settings' import { ScreenContext, useTranslationFunction } from '../../contexts' import { DeltaInput } from '../Login-Styles' import { @@ -22,7 +26,7 @@ const VIDEO_CHAT_INSTANCE_AUTISTICI = 'https://vc.autistici.org/$ROOM' export function SettingsExperimentalFeatures({ settingsStore, renderDTSettingSwitch, - renderDeltaSwitch2 + renderDeltaSwitch2, }: { renderDTSettingSwitch: RenderDTSettingSwitchType settingsStore: SettingsStoreState @@ -242,4 +246,4 @@ export function EditVideochatInstanceDialog({ ) -} \ No newline at end of file +}