Commit 149b0587a0
Unsigned
Layout: unified · split
src/config.rs +17 −12
| @@ -70,18 +70,23 @@ impl Config { | ||
| 70 | 70 | let server_name = option_args[0]; |
| 71 | 71 | let option_name = option_args[1]; |
| 72 | 72 | |
| 73 | let servers = servers.upgrade(); | |
| 74 | ||
| 75 | let mut servers_borrow = servers.borrow_mut(); | |
| 76 | ||
| 77 | // We are reading the config, if the server doesn't yet exists | |
| 78 | // we need to create it before setting the option and running | |
| 79 | // the option change callback. | |
| 80 | if !servers_borrow.contains_key(server_name) { | |
| 81 | let config = Config(config.upgrade().unwrap()); | |
| 82 | let server = | |
| 83 | MatrixServer::new(server_name, &config, section); | |
| 84 | servers_borrow.insert(server_name.to_owned(), server); | |
| 73 | { | |
| 74 | let servers = servers.upgrade(); | |
| 75 | let mut servers_borrow = servers.borrow_mut(); | |
| 76 | ||
| 77 | // We are reading the config, if the server doesn't yet exists | |
| 78 | // we need to create it before setting the option and running | |
| 79 | // the option change callback. | |
| 80 | if !servers_borrow.contains_key(server_name) { | |
| 81 | let config = config.upgrade(); | |
| 82 | let server = MatrixServer::new( | |
| 83 | server_name, | |
| 84 | &config, | |
| 85 | section, | |
| 86 | ); | |
| 87 | servers_borrow | |
| 88 | .insert(server_name.to_owned(), server); | |
| 89 | } | |
| 85 | 90 | } |
| 86 | 91 | |
| 87 | 92 | let option = section.search_option(option_name); |