Support configuring which program :open runs (#95)

This commit is contained in:
Benjamin Große 2023-05-01 12:07:54 +01:00 committed by Ulyssa
parent 0ddefcd7b3
commit 430c601ff2
No known key found for this signature in database
GPG key ID: 1B3965A3D18B9B64
3 changed files with 44 additions and 8 deletions

View file

@ -237,6 +237,7 @@ pub struct TunableValues {
pub typing_notice_display: bool,
pub users: UserOverrides,
pub default_room: Option<String>,
pub open_command: Option<Vec<String>>,
}
#[derive(Clone, Default, Deserialize)]
@ -251,6 +252,7 @@ pub struct Tunables {
pub typing_notice_display: Option<bool>,
pub users: Option<UserOverrides>,
pub default_room: Option<String>,
pub open_command: Option<Vec<String>>,
}
impl Tunables {
@ -268,6 +270,7 @@ impl Tunables {
typing_notice_display: self.typing_notice_display.or(other.typing_notice_display),
users: merge_users(self.users, other.users),
default_room: self.default_room.or(other.default_room),
open_command: self.open_command.or(other.open_command),
}
}
@ -283,6 +286,7 @@ impl Tunables {
typing_notice_display: self.typing_notice_display.unwrap_or(true),
users: self.users.unwrap_or_default(),
default_room: self.default_room,
open_command: self.open_command,
}
}
}