summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2009-03-15 20:00:02 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2009-03-15 20:00:02 +0000
commit8018757b75262d009bc6611be76bf4696d549caa (patch)
treea4d36e5c2f5de3137144362c8e27af2c8c2742e2 /roundcubemail/program/steps
parent945604dcb6805965ed498e690b003770fa619210 (diff)
Change-set to let the IMAP server do the sensible sorting of threads i.e. sort threads by newest in-thread messages rather than simply by the root thread message.
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/func.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index bac49463e..f9c1d951d 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -297,7 +297,7 @@ function rcmail_message_list($attrib)
$header->deleted ? ' deleted' : '',
$header->flagged ? ' flagged' : '',
$zebra_class,
- ($header->depth > 1) ? ' style="display: none"' : '');
+ ($header->depth > 1 && $header->unread_children == 0 && $header->seen) ? 'style="display: none"' : '');
$tree = '';
$depth = $header->depth;
@@ -305,7 +305,11 @@ function rcmail_message_list($attrib)
{
for ($i=1;$i<$depth;$i++)
$tree .= '<div class="branch">&nbsp</div>';
- $tree .= $header->has_children?'<div id="rcmexpando' . $header->uid . '" class="collapsed">&nbsp;</div>':'<div class="leaf">&nbsp;</div>';
+ $toggle_expanded = $header->unread_children ? 'expanded' : 'collapsed';
+ // mark the row as expanded for the JS code
+ if ($toggle_expanded == 'expanded')
+ $js_row_arr['expanded'] = true;
+ $tree .= $header->has_children?'<div id="rcmexpando' . $header->uid . '" class="' . $toggle_expanded . '">&nbsp;</div>':'<div class="leaf">&nbsp;</div>';
}
$tree .= $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : '';