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
parent
aa7ebf2918
commit
aa73bd71c3
|
@ -1652,15 +1652,15 @@ impl Listing {
|
||||||
{
|
{
|
||||||
branches.clear();
|
branches.clear();
|
||||||
branches.push_str(no_sibling_str);
|
branches.push_str(no_sibling_str);
|
||||||
let mut o = 1;
|
|
||||||
let leading_zeros = indentation.leading_zeros();
|
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 {
|
if indentation & o > 0 {
|
||||||
branches.push_str(has_sibling_str);
|
branches.push_str(has_sibling_str);
|
||||||
} else {
|
} else {
|
||||||
branches.push_str(no_sibling_str);
|
branches.push_str(no_sibling_str);
|
||||||
}
|
}
|
||||||
o <<= 1;
|
o >>= 1;
|
||||||
}
|
}
|
||||||
if depth > 0 {
|
if depth > 0 {
|
||||||
if has_sibling {
|
if has_sibling {
|
||||||
|
|
|
@ -2310,6 +2310,6 @@ fn build_mailboxes_order(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
rec(node, &mailbox_entries, 0, 1, false);
|
rec(node, &mailbox_entries, 0, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue