mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
display sigchat device linking qr-code
This commit is contained in:
parent
fd5a55ccbd
commit
36e7798d61
2 changed files with 28 additions and 5 deletions
|
|
@ -20,8 +20,8 @@
|
||||||
"en-tts": "Please provide a name for this device"
|
"en-tts": "Please provide a name for this device"
|
||||||
},
|
},
|
||||||
"sigchat.account.link.scan": {
|
"sigchat.account.link.scan": {
|
||||||
"en": "Please scan with primary Signal device",
|
"en": "Please scan with primary Signal device, and then",
|
||||||
"en-tts": "Please scan with primary Signal device"
|
"en-tts": "Please scan with primary Signal device, and then"
|
||||||
},
|
},
|
||||||
"sigchat.account.offline": {
|
"sigchat.account.offline": {
|
||||||
"en": "Read Signal offline",
|
"en": "Read Signal offline",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ mod trust_mode;
|
||||||
use crate::{Account, DEFAULT_DEVICE_NAME, DEFAULT_HOST_NAME};
|
use crate::{Account, DEFAULT_DEVICE_NAME, DEFAULT_HOST_NAME};
|
||||||
use group_permission::GroupPermission;
|
use group_permission::GroupPermission;
|
||||||
use link_state::LinkState;
|
use link_state::LinkState;
|
||||||
use std::io::Error;
|
use locales::t;
|
||||||
|
use modals::Modals;
|
||||||
use signal_ws::SignalWS;
|
use signal_ws::SignalWS;
|
||||||
use std::io::{Error, ErrorKind};
|
use std::io::{Error, ErrorKind};
|
||||||
pub use trust_mode::TrustMode;
|
pub use trust_mode::TrustMode;
|
||||||
|
|
@ -144,8 +145,30 @@ impl Manager {
|
||||||
match ws.read() {
|
match ws.read() {
|
||||||
Ok(Message::Binary(uuid)) => {
|
Ok(Message::Binary(uuid)) => {
|
||||||
log::info!("raw uuid ProtoBuffer: {:?}", uuid);
|
log::info!("raw uuid ProtoBuffer: {:?}", uuid);
|
||||||
ws.close();
|
let uuid = "TODO decode uuid ProtoBuffer";
|
||||||
Ok(false)
|
let pub_key = "TODO generateIdentityKeyPair()";
|
||||||
|
match url::Url::parse_with_params(
|
||||||
|
"sgnl://linkdevice",
|
||||||
|
&[("uuid", &uuid), ("pub_key", &pub_key)],
|
||||||
|
) {
|
||||||
|
Ok(device_link_uri) => {
|
||||||
|
log::info!("device_link_uri: {device_link_uri}");
|
||||||
|
let xns = xous_names::XousNames::new().unwrap();
|
||||||
|
let modals =
|
||||||
|
Modals::new(&xns).expect("can't connect to Modals server");
|
||||||
|
modals
|
||||||
|
.show_notification(
|
||||||
|
t!("sigchat.account.link.scan", locales::LANG),
|
||||||
|
Some(device_link_uri.as_str()),
|
||||||
|
)
|
||||||
|
.expect("qrcode failed");
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
log::info!("{}", format!("{e}"));
|
||||||
|
Err(link_err)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
log::warn!("unexpected Provisioning msg.");
|
log::warn!("unexpected Provisioning msg.");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue