|
|
|
@ -670,15 +670,13 @@ impl ConversationsListing {
|
|
|
|
|
for (idx, root_idx) in threads_iter.enumerate() {
|
|
|
|
|
self.length += 1;
|
|
|
|
|
let thread_node = &threads.thread_nodes()[&root_idx];
|
|
|
|
|
let i = if let Some(i) = thread_node.message() {
|
|
|
|
|
i
|
|
|
|
|
} else {
|
|
|
|
|
let i = thread_node.message().unwrap_or_else(|| {
|
|
|
|
|
let mut iter_ptr = thread_node.children()[0];
|
|
|
|
|
while threads.thread_nodes()[&iter_ptr].message().is_none() {
|
|
|
|
|
iter_ptr = threads.thread_nodes()[&iter_ptr].children()[0];
|
|
|
|
|
}
|
|
|
|
|
threads.thread_nodes()[&iter_ptr].message().unwrap()
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
if !context.accounts[self.cursor_pos.0].contains_key(i) {
|
|
|
|
|
debug!("key = {}", i);
|
|
|
|
|
debug!(
|
|
|
|
@ -771,15 +769,13 @@ impl ConversationsListing {
|
|
|
|
|
|
|
|
|
|
for ((idx, root_idx), strings) in threads_iter.enumerate().zip(rows) {
|
|
|
|
|
let thread_node = &threads.thread_nodes()[&root_idx];
|
|
|
|
|
let i = if let Some(i) = thread_node.message() {
|
|
|
|
|
i
|
|
|
|
|
} else {
|
|
|
|
|
let i = thread_node.message().unwrap_or_else(|| {
|
|
|
|
|
let mut iter_ptr = thread_node.children()[0];
|
|
|
|
|
while threads.thread_nodes()[&iter_ptr].message().is_none() {
|
|
|
|
|
iter_ptr = threads.thread_nodes()[&iter_ptr].children()[0];
|
|
|
|
|
}
|
|
|
|
|
threads.thread_nodes()[&iter_ptr].message().unwrap()
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
if !context.accounts[self.cursor_pos.0].contains_key(i) {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
|
|
|
@ -1345,19 +1341,21 @@ impl Component for ConversationsListing {
|
|
|
|
|
}
|
|
|
|
|
match *event {
|
|
|
|
|
UIEvent::MailboxUpdate((ref idxa, ref idxf))
|
|
|
|
|
if (*idxa, *idxf)
|
|
|
|
|
== (
|
|
|
|
|
self.new_cursor_pos.0,
|
|
|
|
|
context.accounts[self.new_cursor_pos.0].folders_order
|
|
|
|
|
[self.new_cursor_pos.1],
|
|
|
|
|
) =>
|
|
|
|
|
if context.accounts[self.new_cursor_pos.0]
|
|
|
|
|
.folders_order
|
|
|
|
|
.get(self.new_cursor_pos.1)
|
|
|
|
|
.map(|&folder_hash| (*idxa, *idxf) == (self.new_cursor_pos.0, folder_hash))
|
|
|
|
|
.unwrap_or(false) =>
|
|
|
|
|
{
|
|
|
|
|
self.refresh_mailbox(context);
|
|
|
|
|
self.set_dirty(true);
|
|
|
|
|
}
|
|
|
|
|
UIEvent::StartupCheck(ref f)
|
|
|
|
|
if *f
|
|
|
|
|
== context.accounts[self.cursor_pos.0].folders_order[self.new_cursor_pos.1] =>
|
|
|
|
|
if context.accounts[self.new_cursor_pos.0]
|
|
|
|
|
.folders_order
|
|
|
|
|
.get(self.new_cursor_pos.1)
|
|
|
|
|
.map(|&folder_hash| *f == folder_hash)
|
|
|
|
|
.unwrap_or(false) =>
|
|
|
|
|
{
|
|
|
|
|
self.refresh_mailbox(context);
|
|
|
|
|
self.set_dirty(true);
|
|
|
|
|