mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
add prefetch config value
This commit is contained in:
committed by
holger krekel
parent
19697e255e
commit
aa26c52813
@@ -350,6 +350,7 @@ char* dc_get_blobdir (const dc_context_t* context);
|
|||||||
* The type `jitsi:` may be handled by external apps.
|
* The type `jitsi:` may be handled by external apps.
|
||||||
* If no type is prefixed, the videochat is handled completely in a browser.
|
* If no type is prefixed, the videochat is handled completely in a browser.
|
||||||
* - `bot` = Set to "1" if this is a bot. E.g. prevents adding the "Device messages" and "Saved messages" chats.
|
* - `bot` = Set to "1" if this is a bot. E.g. prevents adding the "Device messages" and "Saved messages" chats.
|
||||||
|
* - `prefetch` = 1=fetch most recent existing messages on configure (default), 0=do not fetch on configure
|
||||||
*
|
*
|
||||||
* If you want to retrieve a value, use dc_get_config().
|
* If you want to retrieve a value, use dc_get_config().
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ pub enum Config {
|
|||||||
#[strum(props(default = "0"))] // also change MediaQuality.default() on changes
|
#[strum(props(default = "0"))] // also change MediaQuality.default() on changes
|
||||||
MediaQuality,
|
MediaQuality,
|
||||||
|
|
||||||
|
#[strum(props(default = "1"))]
|
||||||
|
Prefetch,
|
||||||
|
|
||||||
#[strum(props(default = "0"))]
|
#[strum(props(default = "0"))]
|
||||||
KeyGenType,
|
KeyGenType,
|
||||||
|
|
||||||
|
|||||||
@@ -353,11 +353,13 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
|
|||||||
e2ee::ensure_secret_key_exists(ctx).await?;
|
e2ee::ensure_secret_key_exists(ctx).await?;
|
||||||
info!(ctx, "key generation completed");
|
info!(ctx, "key generation completed");
|
||||||
|
|
||||||
job::add(
|
if ctx.get_config_bool(Config::Prefetch).await {
|
||||||
ctx,
|
job::add(
|
||||||
job::Job::new(Action::FetchExistingMsgs, 0, Params::new(), 0),
|
ctx,
|
||||||
)
|
job::Job::new(Action::FetchExistingMsgs, 0, Params::new(), 0),
|
||||||
.await;
|
)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
|
||||||
progress!(ctx, 940);
|
progress!(ctx, 940);
|
||||||
update_device_chats_handle.await?;
|
update_device_chats_handle.await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user