Changeset 2960 in subversion
- Timestamp:
- Sep 17, 2009 8:36:32 AM (4 years ago)
- Location:
- trunk/roundcubemail/program/steps/mail
- Files:
-
- 5 edited
-
check_recent.inc (modified) (2 diffs)
-
func.inc (modified) (5 diffs)
-
list.inc (modified) (1 diff)
-
mark.inc (modified) (1 diff)
-
move_del.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/check_recent.inc
r2959 r2960 70 70 } 71 71 else { 72 send_unread_count($mbox_name);72 rcmail_send_unread_count($mbox_name, true); 73 73 } 74 74 } 75 75 else if ($check_all) { 76 send_unread_count($mbox_name);76 rcmail_send_unread_count($mbox_name, true); 77 77 } 78 78 } … … 80 80 $OUTPUT->send(); 81 81 82 83 function send_unread_count($mbox_name)84 {85 global $RCMAIL;86 87 $old_unseen = $_SESSION['unseen_count'][$mbox_name];88 $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', true);89 90 if ($unseen != $old_unseen)91 $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));92 93 // @TODO: this data is doubled (session and cache tables) if caching is enabled94 $_SESSION['unseen_count'][$mbox_name] = $unseen;95 }96 97 82 ?> -
trunk/roundcubemail/program/steps/mail/func.inc
r2944 r2960 490 490 491 491 492 /**493 *494 */495 492 function rcmail_messagecount_display($attrib) 496 493 { … … 506 503 507 504 508 /**509 *510 */511 505 function rcmail_quota_display($attrib) 512 506 { … … 525 519 526 520 527 /**528 *529 */530 521 function rcmail_quota_content($quota=NULL, $attrib=NULL) 531 522 { … … 580 571 581 572 582 /**583 *584 */585 573 function rcmail_get_messagecount_text($count=NULL, $page=NULL) 586 574 { … … 611 599 } 612 600 613 /** 614 * 615 */ 601 616 602 function rcmail_mailbox_name_display($attrib) 617 603 { 618 global $RCMAIL;619 620 if (!$attrib['id'])621 $attrib['id'] = 'rcmmailboxname';622 623 $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']);624 625 return html::span($attrib, rcmail_get_mailbox_name_text());604 global $RCMAIL; 605 606 if (!$attrib['id']) 607 $attrib['id'] = 'rcmmailboxname'; 608 609 $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']); 610 611 return html::span($attrib, rcmail_get_mailbox_name_text()); 626 612 } 627 613 628 614 function rcmail_get_mailbox_name_text() 629 615 { 630 global $RCMAIL; 631 return rcmail_localize_foldername($RCMAIL->imap->get_mailbox_name()); 632 } 616 global $RCMAIL; 617 return rcmail_localize_foldername($RCMAIL->imap->get_mailbox_name()); 618 } 619 620 621 function rcmail_send_unread_count($mbox_name, $force=false) 622 { 623 global $RCMAIL; 624 625 $old_unseen = $_SESSION['unseen_count'][$mbox_name]; 626 $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', $force); 627 628 if ($unseen != $old_unseen) 629 $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); 630 631 // @TODO: this data is doubled (session and cache tables) if caching is enabled 632 $_SESSION['unseen_count'][$mbox_name] = $unseen; 633 634 return $unseen; 635 } 636 633 637 634 638 /** -
trunk/roundcubemail/program/steps/mail/list.inc
r2959 r2960 61 61 $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); 62 62 63 // count UNSEEN messages... 64 $old_unseen = $_SESSION['unseen_count'][$mbox_name]; 65 $unseen = $count ? $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])) : 0; 66 $_SESSION['unseen_count'][$mbox_name] = $unseen; 67 68 // ...and update mailboxlist 69 if ($unseen != $old_unseen) 70 $OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); 63 // update mailboxlist 64 rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh'])); 71 65 72 66 // update message count display -
trunk/roundcubemail/program/steps/mail/mark.inc
r2959 r2960 62 62 63 63 if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) { 64 $mbox_name = $IMAP->get_mailbox_name(); 65 $unseen = $IMAP->messagecount($mbox_name, 'UNSEEN'); 66 $old_unseen = $_SESSION['unseen_count'][$mbox_name]; 67 if ($old_unseen != $unseen) { 68 $OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); 69 $_SESSION['unseen_count'][$mbox_name] = $unseen; 70 } 64 rcmail_send_unread_count($IMAP->get_mailbox_name()); 71 65 } 72 66 else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) { -
trunk/roundcubemail/program/steps/mail/move_del.inc
r2959 r2960 111 111 112 112 if ($RCMAIL->action=='moveto' && $target) { 113 $unseen_count = $IMAP->messagecount($target, 'UNSEEN', true); 114 $old_unseen = $_SESSION['unseen_count'][$target]; 115 if ($old_unseen != $unseen_count) { 116 $OUTPUT->command('set_unread_count', $target, $unseen_count); 117 $_SESSION['unseen_count'][$target] = $unseen_count; 118 } 113 rcmail_send_unread_count($target, true); 119 114 } 120 115
Note: See TracChangeset
for help on using the changeset viewer.
