mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
feat: Enable Webxdc realtime by default (#6125)
This commit is contained in:
@@ -530,8 +530,8 @@ char* dc_get_blobdir (const dc_context_t* context);
|
|||||||
* These keys go to backups and allow easy per-account settings when using @ref dc_accounts_t,
|
* These keys go to backups and allow easy per-account settings when using @ref dc_accounts_t,
|
||||||
* however, are not handled by the core otherwise.
|
* however, are not handled by the core otherwise.
|
||||||
* - `webxdc_realtime_enabled` = Whether the realtime APIs should be enabled.
|
* - `webxdc_realtime_enabled` = Whether the realtime APIs should be enabled.
|
||||||
* 0 = WebXDC realtime API is disabled and behaves as noop (default).
|
* 0 = WebXDC realtime API is disabled and behaves as noop.
|
||||||
* 1 = WebXDC realtime API is enabled.
|
* 1 = WebXDC realtime API is enabled (default).
|
||||||
*
|
*
|
||||||
* If you want to retrieve a value, use dc_get_config().
|
* If you want to retrieve a value, use dc_get_config().
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -433,6 +433,7 @@ pub enum Config {
|
|||||||
WebxdcIntegration,
|
WebxdcIntegration,
|
||||||
|
|
||||||
/// Enable webxdc realtime features.
|
/// Enable webxdc realtime features.
|
||||||
|
#[strum(props(default = "1"))]
|
||||||
WebxdcRealtimeEnabled,
|
WebxdcRealtimeEnabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -590,17 +590,6 @@ mod tests {
|
|||||||
let alice = &mut tcm.alice().await;
|
let alice = &mut tcm.alice().await;
|
||||||
let bob = &mut tcm.bob().await;
|
let bob = &mut tcm.bob().await;
|
||||||
|
|
||||||
bob.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
alice
|
|
||||||
.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// Alice sends webxdc to bob
|
// Alice sends webxdc to bob
|
||||||
let alice_chat = alice.create_chat(bob).await;
|
let alice_chat = alice.create_chat(bob).await;
|
||||||
let mut instance = Message::new(Viewtype::File);
|
let mut instance = Message::new(Viewtype::File);
|
||||||
@@ -739,17 +728,6 @@ mod tests {
|
|||||||
let alice = &mut tcm.alice().await;
|
let alice = &mut tcm.alice().await;
|
||||||
let bob = &mut tcm.bob().await;
|
let bob = &mut tcm.bob().await;
|
||||||
|
|
||||||
bob.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
alice
|
|
||||||
.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
assert!(alice
|
assert!(alice
|
||||||
.get_config_bool(Config::WebxdcRealtimeEnabled)
|
.get_config_bool(Config::WebxdcRealtimeEnabled)
|
||||||
.await
|
.await
|
||||||
@@ -907,17 +885,6 @@ mod tests {
|
|||||||
let alice = &mut tcm.alice().await;
|
let alice = &mut tcm.alice().await;
|
||||||
let bob = &mut tcm.bob().await;
|
let bob = &mut tcm.bob().await;
|
||||||
|
|
||||||
bob.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
alice
|
|
||||||
.ctx
|
|
||||||
.set_config_bool(Config::WebxdcRealtimeEnabled, true)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// Alice sends webxdc to bob
|
// Alice sends webxdc to bob
|
||||||
let alice_chat = alice.create_chat(bob).await;
|
let alice_chat = alice.create_chat(bob).await;
|
||||||
let mut instance = Message::new(Viewtype::File);
|
let mut instance = Message::new(Viewtype::File);
|
||||||
@@ -986,6 +953,11 @@ mod tests {
|
|||||||
let mut tcm = TestContextManager::new();
|
let mut tcm = TestContextManager::new();
|
||||||
let alice = &mut tcm.alice().await;
|
let alice = &mut tcm.alice().await;
|
||||||
|
|
||||||
|
alice
|
||||||
|
.set_config_bool(Config::WebxdcRealtimeEnabled, false)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
// creates iroh endpoint as side effect
|
// creates iroh endpoint as side effect
|
||||||
send_webxdc_realtime_advertisement(alice, MsgId::new(1))
|
send_webxdc_realtime_advertisement(alice, MsgId::new(1))
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user