mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
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:
@@ -325,6 +325,8 @@ impl Drop for IoPausedGuard {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct SchedBox {
|
struct SchedBox {
|
||||||
|
/// Hostname of used chatmail/email relay
|
||||||
|
host: String,
|
||||||
meaning: FolderMeaning,
|
meaning: FolderMeaning,
|
||||||
conn_state: ImapConnectionState,
|
conn_state: ImapConnectionState,
|
||||||
|
|
||||||
@@ -881,7 +883,14 @@ impl Scheduler {
|
|||||||
let ctx = ctx.clone();
|
let ctx = ctx.clone();
|
||||||
task::spawn(inbox_loop(ctx, inbox_start_send, inbox_handlers))
|
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 {
|
let inbox = SchedBox {
|
||||||
|
host: host.clone(),
|
||||||
meaning: FolderMeaning::Inbox,
|
meaning: FolderMeaning::Inbox,
|
||||||
conn_state,
|
conn_state,
|
||||||
handle,
|
handle,
|
||||||
@@ -897,6 +906,7 @@ impl Scheduler {
|
|||||||
let meaning = FolderMeaning::Mvbox;
|
let meaning = FolderMeaning::Mvbox;
|
||||||
let handle = task::spawn(simple_imap_loop(ctx, start_send, handlers, meaning));
|
let handle = task::spawn(simple_imap_loop(ctx, start_send, handlers, meaning));
|
||||||
oboxes.push(SchedBox {
|
oboxes.push(SchedBox {
|
||||||
|
host,
|
||||||
meaning,
|
meaning,
|
||||||
conn_state,
|
conn_state,
|
||||||
handle,
|
handle,
|
||||||
|
|||||||
@@ -373,7 +373,13 @@ impl Context {
|
|||||||
InnerSchedulerState::Started(ref sched) => (
|
InnerSchedulerState::Started(ref sched) => (
|
||||||
sched
|
sched
|
||||||
.boxes()
|
.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<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
sched.smtp.state.connectivity.clone(),
|
sched.smtp.state.connectivity.clone(),
|
||||||
),
|
),
|
||||||
@@ -396,7 +402,7 @@ impl Context {
|
|||||||
let watched_folders = get_watched_folder_configs(self).await?;
|
let watched_folders = get_watched_folder_configs(self).await?;
|
||||||
let incoming_messages = stock_str::incoming_messages(self).await;
|
let incoming_messages = stock_str::incoming_messages(self).await;
|
||||||
ret += &format!("<h3>{incoming_messages}</h3><ul>");
|
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;
|
let mut folder_added = false;
|
||||||
|
|
||||||
if let Some(config) = folder.to_config().filter(|c| watched_folders.contains(c)) {
|
if let Some(config) = folder.to_config().filter(|c| watched_folders.contains(c)) {
|
||||||
@@ -407,7 +413,11 @@ impl Context {
|
|||||||
ret += "<li>";
|
ret += "<li>";
|
||||||
ret += &*detailed.to_icon();
|
ret += &*detailed.to_icon();
|
||||||
ret += " <b>";
|
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 += ":</b> ";
|
||||||
ret += &*escaper::encode_minimal(&detailed.to_string_imap(self).await);
|
ret += &*escaper::encode_minimal(&detailed.to_string_imap(self).await);
|
||||||
ret += "</li>";
|
ret += "</li>";
|
||||||
|
|||||||
Reference in New Issue
Block a user