Merge main (c60acf9, the session seam) into phase5/ui-vm-2
The engine of main runs on voelin_proto::link::Session; this branch had split
the Slint controllers into <area>/logic.rs (voelin-ui-vm) and <area>/bind.rs
(voelin-ui) before that merge and was never reviewed. One conflict, the one
the Opus gate of the seam merge predicted:
- crates/voelin-ui/src/servers.rs (modify/delete): this branch had split the
file into servers/bind.rs and voelin-ui-vm's servers/logic.rs; main had
changed the file for the seam (docs/session-seam.md 17.3). The file stays
deleted and the changes of main are made where the code now is:
servers/bind.rs sends ts::identity::to_blob(&identity) in ConnectVoice and in
both ObserveGateway sends, builds voelin_core::QueryLogin {address,
allowlisted: false} with voelin_core::QueryTransport for ObserveQuery, names
ts::identity::DEFAULT_NICKNAME, and its tests import ts::identity::{Found,
LaunchImport}; servers/logic.rs imports ts::identity::LaunchImport (and
links ts::identity::import_new), and voice_options keeps the eager
ts::versions::resolve for the message and assigns Some(spec.clone()) to
VoiceOptions::client_version (the engine resolves the spec when it
connects).
Cargo.lock merged without a conflict and differs from main's only by the edge
of voelin-ui-vm to roxmltree, which this branch added (d9de95b).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
371e4d77c8
77 files changed
+15310
-3433
No files matched your search
@@ -376,7 +376,7 @@ pub fn run(options: RunOptions) -> Result<()> {
|
||||
// with the sample data of VOELIN_DEMO_UI); the client's default
|
||||
// identity becomes ours while we have none the user chose.
|
||||
let imported = if prefs.get(&IDENTITY_IMPORT) && !switches.demo_ui {
|
||||
voelin_core::identity::import_new(&store, &voelin_core::identity::discover())
|
||||
voelin_core::ts::identity::import_new(&store, &voelin_core::ts::identity::discover())
|
||||
.unwrap_or_else(|e| {
|
||||
warn!(%e, "could not import TeamSpeak identities");
|
||||
Default::default()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! The identity servers see us as: the store's default (schema 4,
|
||||
//! `Store::default_identity`), chosen under Settings → Profiles, and the
|
||||
//! import of the official clients' identities on start
|
||||
//! (`voelin_core::identity::import_new`, app.rs). The rest of the Profiles
|
||||
//! (`voelin_core::ts::identity::import_new`, app.rs). The rest of the Profiles
|
||||
//! page is in `settings_pages/`.
|
||||
|
||||
use tracing::warn;
|
||||
|
||||
@@ -49,7 +49,7 @@ impl App {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
options.identity = Some(self.identity_for(Some(b.id)));
|
||||
options.identity = Some(voelin_core::ts::identity::to_blob(&self.identity_for(Some(b.id))));
|
||||
options.server_password = self.secrets.get(&b.server_password_key()).ok().flatten();
|
||||
options.stream_peer = self.video.peer_config(options.stream_peer);
|
||||
self.engine
|
||||
@@ -69,7 +69,7 @@ impl App {
|
||||
.flatten()
|
||||
.map(|identity| identity.name)
|
||||
.filter(|name| {
|
||||
![logic::CREATED_IDENTITY, voelin_core::identity::DEFAULT_NICKNAME]
|
||||
![logic::CREATED_IDENTITY, voelin_core::ts::identity::DEFAULT_NICKNAME]
|
||||
.contains(&name.as_str())
|
||||
})
|
||||
.or_else(|| std::env::var("USER").or_else(|_| std::env::var("USERNAME")).ok())
|
||||
@@ -143,7 +143,9 @@ impl App {
|
||||
self.engine.send(Command::ObserveGateway {
|
||||
session,
|
||||
urls,
|
||||
identity: Box::new(self.identity_for(Some(b.id))),
|
||||
identity: Box::new(voelin_core::ts::identity::to_blob(
|
||||
&self.identity_for(Some(b.id)),
|
||||
)),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -152,7 +154,9 @@ impl App {
|
||||
self.engine.send(Command::ObserveGateway {
|
||||
session,
|
||||
urls,
|
||||
identity: Box::new(self.identity_for(Some(b.id))),
|
||||
identity: Box::new(voelin_core::ts::identity::to_blob(
|
||||
&self.identity_for(Some(b.id)),
|
||||
)),
|
||||
});
|
||||
// Still the one the server publishes?
|
||||
self.discover_gateway(b.id);
|
||||
@@ -160,18 +164,18 @@ impl App {
|
||||
ObservePlan::Query(q) => {
|
||||
let secret = self.secrets.get(&b.query_password_key()).ok().flatten();
|
||||
let transport = match q.transport {
|
||||
QueryTransport::Raw => voelin_query::Transport::Raw,
|
||||
QueryTransport::Ssh => voelin_query::Transport::Ssh,
|
||||
QueryTransport::Http => voelin_query::Transport::Http,
|
||||
QueryTransport::Raw => voelin_core::QueryTransport::Raw,
|
||||
QueryTransport::Ssh => voelin_core::QueryTransport::Ssh,
|
||||
QueryTransport::Http => voelin_core::QueryTransport::Http,
|
||||
};
|
||||
let connect = voelin_query::Connect {
|
||||
let connect = voelin_core::QueryLogin {
|
||||
transport,
|
||||
addr: format!("{}:{}", q.host, q.port),
|
||||
address: format!("{}:{}", q.host, q.port),
|
||||
user: q.user.clone(),
|
||||
secret,
|
||||
server_port: q.server_port,
|
||||
server_id: None,
|
||||
line: Default::default(),
|
||||
allowlisted: false,
|
||||
};
|
||||
self.engine.send(Command::ObserveQuery { session, connect: Box::new(connect) });
|
||||
}
|
||||
@@ -420,7 +424,7 @@ impl App {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use voelin_core::identity::{Found, LaunchImport};
|
||||
use voelin_core::ts::identity::{Found, LaunchImport};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ impl App {
|
||||
let dir = dirs::download_dir().or_else(dirs::home_dir).unwrap_or_else(|| ".".into());
|
||||
let file = logic::export_file_stem(&entry.name);
|
||||
let path = dir.join(format!("{file}.ini"));
|
||||
match voelin_core::identity::write_export(&path, &entry.name, &identity) {
|
||||
match voelin_core::ts::identity::write_export(&path, &entry.name, &identity) {
|
||||
Ok(()) => self.set_identity_status(format!(
|
||||
"Exported to {} (it holds the private key: keep it safe).",
|
||||
path.display()
|
||||
@@ -608,7 +608,7 @@ impl App {
|
||||
.name("identity-level".into())
|
||||
.spawn(move || {
|
||||
let better =
|
||||
voelin_core::identity::improve_level(&identity, target, &cancel, |level| {
|
||||
voelin_core::ts::identity::improve_level(&identity, target, &cancel, |level| {
|
||||
later(move |app| {
|
||||
if let Some(i) = app.pages.state.improving.get_mut(&id) {
|
||||
i.reached = i.reached.max(level);
|
||||
@@ -645,8 +645,8 @@ impl App {
|
||||
pub(crate) fn find_identities(&mut self) {
|
||||
let mut found = Vec::new();
|
||||
let mut errors = Vec::new();
|
||||
for path in voelin_core::identity::discover() {
|
||||
match voelin_core::identity::read(&path) {
|
||||
for path in voelin_core::ts::identity::discover() {
|
||||
match voelin_core::ts::identity::read(&path) {
|
||||
Ok(list) => found.extend(list),
|
||||
Err(e) => errors.push(e.to_string()),
|
||||
}
|
||||
@@ -676,11 +676,11 @@ impl App {
|
||||
pub(crate) fn import_identities(&mut self) {
|
||||
let picked: Vec<_> =
|
||||
self.pages.state.found.iter().filter(|(_, p)| *p).map(|(f, _)| f.clone()).collect();
|
||||
match voelin_core::identity::import(&self.store, &picked) {
|
||||
match voelin_core::ts::identity::import(&self.store, &picked) {
|
||||
Ok(results) => {
|
||||
let added = results
|
||||
.iter()
|
||||
.filter(|r| matches!(r, voelin_core::identity::Imported::Added(_)))
|
||||
.filter(|r| matches!(r, voelin_core::ts::identity::Imported::Added(_)))
|
||||
.count();
|
||||
self.set_identity_status(format!("{added} identities imported."));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user