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
|
||||
- Config file
|
||||
- `ephemeral` config option
|
||||
- `data_dir` config option
|
||||
- `ephemeral` config option
|
||||
- `offline` config option
|
||||
- `euph.rooms.<name>.autojoin` config option
|
||||
- `euph.rooms.<name>.username` config option
|
||||
- `euph.rooms.<name>.force_username` config option
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ pub struct Config {
|
|||
pub data_dir: Option<PathBuf>,
|
||||
#[serde(default)]
|
||||
pub ephemeral: bool,
|
||||
#[serde(default)]
|
||||
pub offline: bool,
|
||||
pub euph: Euph,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,9 +67,11 @@ impl Rooms {
|
|||
euph_rooms: HashMap::new(),
|
||||
};
|
||||
|
||||
for (name, config) in &config.euph.rooms {
|
||||
if config.autojoin {
|
||||
result.get_or_insert_room(name.clone()).connect();
|
||||
if !config.offline {
|
||||
for (name, config) in &config.euph.rooms {
|
||||
if config.autojoin {
|
||||
result.get_or_insert_room(name.clone()).connect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue