fix: multi-transport: all transports were shown as "inbox" in connectivity view, now they are shown by their hostname (#7582)

closes #7580
This commit is contained in:
Simon Laux
2025-12-09 14:42:24 +01:00
committed by GitHub
parent 95ed31391d
commit 06b2a890da
2 changed files with 23 additions and 3 deletions

View File

@@ -325,6 +325,8 @@ impl Drop for IoPausedGuard {
#[derive(Debug)]
struct SchedBox {
/// Hostname of used chatmail/email relay
host: String,
meaning: FolderMeaning,
conn_state: ImapConnectionState,
@@ -881,7 +883,14 @@ impl Scheduler {
let ctx = ctx.clone();
task::spawn(inbox_loop(ctx, inbox_start_send, inbox_handlers))
};
let host = configured_login_param
.addr
.split("@")
.last()
.context("address has no host")?
.to_owned();
let inbox = SchedBox {
host: host.clone(),
meaning: FolderMeaning::Inbox,
conn_state,
handle,
@@ -897,6 +906,7 @@ impl Scheduler {
let meaning = FolderMeaning::Mvbox;
let handle = task::spawn(simple_imap_loop(ctx, start_send, handlers, meaning));
oboxes.push(SchedBox {
host,
meaning,
conn_state,
handle,

View File

@@ -373,7 +373,13 @@ impl Context {
InnerSchedulerState::Started(ref sched) => (
sched
.boxes()
.map(|b| (b.meaning, b.conn_state.state.connectivity.clone()))
.map(|b| {
(
b.host.clone(),
b.meaning,
b.conn_state.state.connectivity.clone(),
)
})
.collect::<Vec<_>>(),
sched.smtp.state.connectivity.clone(),
),
@@ -396,7 +402,7 @@ impl Context {
let watched_folders = get_watched_folder_configs(self).await?;
let incoming_messages = stock_str::incoming_messages(self).await;
ret += &format!("<h3>{incoming_messages}</h3><ul>");
for (folder, state) in &folders_states {
for (host, folder, state) in &folders_states {
let mut folder_added = false;
if let Some(config) = folder.to_config().filter(|c| watched_folders.contains(c)) {
@@ -407,7 +413,11 @@ impl Context {
ret += "<li>";
ret += &*detailed.to_icon();
ret += " <b>";
ret += &*escaper::encode_minimal(&foldername);
if folder == &FolderMeaning::Inbox {
ret += &*escaper::encode_minimal(host);
} else {
ret += &*escaper::encode_minimal(&foldername);
}
ret += ":</b> ";
ret += &*escaper::encode_minimal(&detailed.to_string_imap(self).await);
ret += "</li>";