Commit e869ad308d
Unsigned
Layout: unified · split
src/server.rs +8 −2
| @@ -385,15 +385,21 @@ impl MatrixServer { | ||
| 385 | 385 | let homeserver = |
| 386 | 386 | StringOptionSettings::new(format!("{}.homeserver", server_name)) |
| 387 | 387 | .set_check_callback(|_, _, value| { |
| 388 | MatrixServer::is_url_valid(&value) | |
| 388 | let url = Weechat::eval_string_expression(&value) | |
| 389 | .expect("Can't evaluate homeserver"); | |
| 390 | ||
| 391 | MatrixServer::is_url_valid(&url) | |
| 389 | 392 | }) |
| 390 | 393 | .set_change_callback(move |_, option| { |
| 391 | 394 | let server_ref = server.upgrade().expect( |
| 392 | 395 | "Server got deleted while server config is alive", |
| 393 | 396 | ); |
| 394 | 397 | |
| 398 | let url = Weechat::eval_string_expression(&option.value()) | |
| 399 | .expect("Can't evaluate homeserver"); | |
| 400 | ||
| 395 | 401 | server_ref.settings.borrow_mut().homeserver = |
| 396 | MatrixServer::parse_url_unchecked(&option.value()); | |
| 402 | MatrixServer::parse_url_unchecked(&url); | |
| 397 | 403 | }); |
| 398 | 404 | |
| 399 | 405 | server_section |