add nip4e settings
This commit is contained in:
@@ -68,9 +68,9 @@ impl Display for AuthMode {
|
|||||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub enum SignerKind {
|
pub enum SignerKind {
|
||||||
Auto,
|
Auto,
|
||||||
|
Encryption,
|
||||||
#[default]
|
#[default]
|
||||||
User,
|
User,
|
||||||
Encryption,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SignerKind {
|
impl SignerKind {
|
||||||
@@ -98,7 +98,7 @@ impl RoomConfig {
|
|||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
backup: true,
|
backup: true,
|
||||||
signer_kind: SignerKind::Auto,
|
signer_kind: SignerKind::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,17 +56,16 @@ impl Preferences {
|
|||||||
|
|
||||||
impl Render for Preferences {
|
impl Render for Preferences {
|
||||||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
const SCREENING: &str =
|
const SCREENING: &str = "Show an screening dialog to verify the unknown sender.";
|
||||||
"When opening a request, a popup will appear to help you identify the sender.";
|
const AVATAR: &str = "Hide all avatar pictures to improve performance.";
|
||||||
const AVATAR: &str =
|
const MODE: &str = "Use the selected light or dark theme, or to follow the OS.";
|
||||||
"Hide all avatar pictures to improve performance and protect your privacy.";
|
const NIP4E: &str = "Use a dedicated key to encrypt and decrypt messages.";
|
||||||
const MODE: &str =
|
|
||||||
"Choose whether to use the selected light or dark theme, or to follow the OS.";
|
|
||||||
const AUTH: &str = "Choose the authentication behavior for relays.";
|
const AUTH: &str = "Choose the authentication behavior for relays.";
|
||||||
const RESET: &str = "Reset the theme to the default one.";
|
const RESET: &str = "Reset the theme to the default one.";
|
||||||
|
|
||||||
let screening = AppSettings::get_screening(cx);
|
let screening = AppSettings::get_screening(cx);
|
||||||
let hide_avatar = AppSettings::get_hide_avatar(cx);
|
let hide_avatar = AppSettings::get_hide_avatar(cx);
|
||||||
|
let nip4e = AppSettings::get_encryption_key(cx);
|
||||||
let auth_mode = AppSettings::get_auth_mode(cx);
|
let auth_mode = AppSettings::get_auth_mode(cx);
|
||||||
let theme_mode = AppSettings::get_theme_mode(cx);
|
let theme_mode = AppSettings::get_theme_mode(cx);
|
||||||
|
|
||||||
@@ -207,6 +206,21 @@ impl Render for Preferences {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.child(
|
||||||
|
GroupBox::new()
|
||||||
|
.id("experiments")
|
||||||
|
.title("Experiments")
|
||||||
|
.fill()
|
||||||
|
.child(
|
||||||
|
Switch::new("nip4e")
|
||||||
|
.label("Decoupling Encryption Key")
|
||||||
|
.description(NIP4E)
|
||||||
|
.checked(nip4e)
|
||||||
|
.on_click(move |_, _window, cx| {
|
||||||
|
AppSettings::update_encryption_key(!nip4e, cx);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
)
|
||||||
.child(
|
.child(
|
||||||
GroupBox::new()
|
GroupBox::new()
|
||||||
.id("media")
|
.id("media")
|
||||||
|
|||||||
Reference in New Issue
Block a user