Browse Source

listing: fix mailbox tree rendering

Indentation value was being interpreted mirrored (raw binary value in
parenthesis):

   0  testing_account (0)
   1   ┣━Archives     (0)
   2   ┃ ┣━2014       (1)
   3   ┃ ┃ ┗━10       (11)
   4   ┃ ┗━2015       (1)
   5     ┃ ┗━05       (10) <- invalid/mirrored
   6   ┣━Drafts       (0)

Should be:

   0  testing_account (0)
   1   ┣━Archives     (0)
   2   ┃ ┣━2014       (1)
   3   ┃ ┃ ┗━10       (11)
   4   ┃ ┗━2015       (1)
   5   ┃   ┗━05       (10)
   6   ┣━Drafts       (0)
jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
aa73bd71c3
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 6
      src/components/mail/listing.rs
  2. 2
      src/conf/accounts.rs

6
src/components/mail/listing.rs

@ -1652,15 +1652,15 @@ impl Listing {
{
branches.clear();
branches.push_str(no_sibling_str);
let mut o = 1;
let leading_zeros = indentation.leading_zeros();
for _ in 0..(30_u32.saturating_sub(leading_zeros)) {
let mut o = 1_u32.wrapping_shl(31_u32.saturating_sub(leading_zeros));
for _ in 0..(32_u32.saturating_sub(leading_zeros)) {
if indentation & o > 0 {
branches.push_str(has_sibling_str);
} else {
branches.push_str(no_sibling_str);
}
o <<= 1;
o >>= 1;
}
if depth > 0 {
if has_sibling {

2
src/conf/accounts.rs

@ -2310,6 +2310,6 @@ fn build_mailboxes_order(
}
};
rec(node, &mailbox_entries, 0, 1, false);
rec(node, &mailbox_entries, 0, 0, false);
}
}
Loading…
Cancel
Save