Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable Webxdc realtime by default #6125

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deltachat-ffi/deltachat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
* however, are not handled by the core otherwise.
* - `webxdc_realtime_enabled` = Whether the realtime APIs should be enabled.
* 0 = WebXDC realtime API is disabled and behaves as noop (default).
* 1 = WebXDC realtime API is enabled.
* 0 = WebXDC realtime API is disabled and behaves as noop.
* 1 = WebXDC realtime API is enabled (default).
*
* If you want to retrieve a value, use dc_get_config().
*
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ pub enum Config {
WebxdcIntegration,

/// Enable webxdc realtime features.
#[strum(props(default = "1"))]
WebxdcRealtimeEnabled,
}

Expand Down
38 changes: 5 additions & 33 deletions src/peer_channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,17 +590,6 @@ mod tests {
let alice = &mut tcm.alice().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
let alice_chat = alice.create_chat(bob).await;
let mut instance = Message::new(Viewtype::File);
Expand Down Expand Up @@ -739,17 +728,6 @@ mod tests {
let alice = &mut tcm.alice().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
.get_config_bool(Config::WebxdcRealtimeEnabled)
.await
Expand Down Expand Up @@ -907,17 +885,6 @@ mod tests {
let alice = &mut tcm.alice().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
let alice_chat = alice.create_chat(bob).await;
let mut instance = Message::new(Viewtype::File);
Expand Down Expand Up @@ -986,6 +953,11 @@ mod tests {
let mut tcm = TestContextManager::new();
let alice = &mut tcm.alice().await;

alice
.set_config_bool(Config::WebxdcRealtimeEnabled, false)
.await
.unwrap();

// creates iroh endpoint as side effect
send_webxdc_realtime_advertisement(alice, MsgId::new(1))
.await
Expand Down
Loading