mirror of
https://github.com/creating2morrow/neveko.git
synced 2025-01-22 10:44:39 +00:00
disallow composing on offline contact
This commit is contained in:
parent
c70d53357e
commit
7070bbb77b
3 changed files with 17 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
use rand_core::RngCore;
|
use rand_core::RngCore;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use rocket::serde::json::Json;
|
use rocket::serde::json::Json;
|
||||||
use crate::{args, db, i2p, message, models, monero, gpg, utils, reqres};
|
use crate::{args, db, i2p, models, monero, gpg, utils, reqres};
|
||||||
use log::{info, debug, error, warn};
|
use log::{info, debug, error, warn};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ pub async fn start_up() {
|
||||||
gen_app_gpg().await;
|
gen_app_gpg().await;
|
||||||
let env: String = get_release_env().value();
|
let env: String = get_release_env().value();
|
||||||
start_gui();
|
start_gui();
|
||||||
{ tokio::spawn(async { message::retry_fts().await; }); }
|
// { tokio::spawn(async { message::retry_fts().await; }); }
|
||||||
info!("{} - nevmes is online", env);
|
info!("{} - nevmes is online", env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
`cd ../ && cargo build && cd nevmes-gui && RUST_LOG=debug cargo run`
|
Note: gui depends on the binary if starting core from gui
|
||||||
|
otherwise run nevmes core on your own
|
||||||
|
|
||||||
|
`cd ../ && cargo build && cp target/debug/nevmes nevmes-gui/ && cd nevmes-gui && RUST_LOG=debug cargo run`
|
|
@ -159,6 +159,14 @@ impl eframe::App for AddressBookApp {
|
||||||
self.approve_contact = true;
|
self.approve_contact = true;
|
||||||
}
|
}
|
||||||
if self.showing_status {
|
if self.showing_status {
|
||||||
|
let i2p_address = self.s_contact.i2p_address.clone();
|
||||||
|
if self.s_contact.xmr_address == utils::empty_string() {
|
||||||
|
clear_gui_db(String::from("gui-online"), String::from(&i2p_address));
|
||||||
|
write_gui_db(String::from("gui-online"), String::from(&i2p_address), String::from("0"));
|
||||||
|
} else {
|
||||||
|
clear_gui_db(String::from("gui-online"), String::from(&i2p_address));
|
||||||
|
write_gui_db(String::from("gui-online"), String::from(&i2p_address), String::from("1"));
|
||||||
|
}
|
||||||
self.is_pinging = false;
|
self.is_pinging = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -490,9 +498,11 @@ impl eframe::App for AddressBookApp {
|
||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
Err(_e) => 0,
|
Err(_e) => 0,
|
||||||
};
|
};
|
||||||
|
let is_online_now = search_gui_db(String::from("gui-online"), String::from(&c.i2p_address));
|
||||||
if now < expire && self.status.signed_key
|
if now < expire && self.status.signed_key
|
||||||
&& self.status.jwp != utils::empty_string()
|
&& self.status.jwp != utils::empty_string()
|
||||||
&& c.i2p_address == self.status.i2p {
|
&& c.i2p_address == self.status.i2p
|
||||||
|
&& is_online_now == String::from("1") {
|
||||||
if ui.button("Compose").clicked() {
|
if ui.button("Compose").clicked() {
|
||||||
self.is_composing = true;
|
self.is_composing = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue