Add 'offline' config option to turn off autojoin
This commit is contained in:
parent
04581f9158
commit
73a0971c34
3 changed files with 9 additions and 4 deletions
|
|
@ -16,8 +16,9 @@ Procedure when bumping the version number:
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Config file
|
- Config file
|
||||||
- `ephemeral` config option
|
|
||||||
- `data_dir` config option
|
- `data_dir` config option
|
||||||
|
- `ephemeral` config option
|
||||||
|
- `offline` config option
|
||||||
- `euph.rooms.<name>.autojoin` config option
|
- `euph.rooms.<name>.autojoin` config option
|
||||||
- `euph.rooms.<name>.username` config option
|
- `euph.rooms.<name>.username` config option
|
||||||
- `euph.rooms.<name>.force_username` config option
|
- `euph.rooms.<name>.force_username` config option
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ pub struct Config {
|
||||||
pub data_dir: Option<PathBuf>,
|
pub data_dir: Option<PathBuf>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub ephemeral: bool,
|
pub ephemeral: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub offline: bool,
|
||||||
pub euph: Euph,
|
pub euph: Euph,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,11 +67,13 @@ impl Rooms {
|
||||||
euph_rooms: HashMap::new(),
|
euph_rooms: HashMap::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if !config.offline {
|
||||||
for (name, config) in &config.euph.rooms {
|
for (name, config) in &config.euph.rooms {
|
||||||
if config.autojoin {
|
if config.autojoin {
|
||||||
result.get_or_insert_room(name.clone()).connect();
|
result.get_or_insert_room(name.clone()).connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue