[dev] New IMP Summary Option

Rick Emery rick at emery.homelinux.net
Wed Dec 3 12:36:58 PST 2003


I've been experimenting with the new option in the IMP summary (to only display
folders with unseen messages), and have noticed an anomoly. I can't accurately
reproduce the problem; it *appears* to be random (though I know better :-)

When viewing my portal with no unseen messages, I correctly get the message "No
folders with unseen messages". My portal page refreshes every 5 minutes, and
when I get new messages, the IMP summary block refreshes with the folder name
and new message count. Sometimes, if it refreshes again and has the same number
of unseen messages in the same folder, I get the correct display (folder name
with the number of unseen messages) but, below that, I get "No folders with
unseen messages".

I briefly looked at the code (which I admit I didn't completely understand) and
was wondering if this could be because, on lines 90 and 91, it references the
"recent" flag instead of the "unseen" flag. When I changed it on my server, the
anomoly *appeared* to go away (but since I can't reliably reproduce it, I can't
be sure).

If this makes sense, I've attached a patch.

Thanks

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
                                              -- Leonardo Da Vinci
-------------- next part --------------
Index: summary.php
===================================================================
RCS file: /repository/imp/lib/Block/summary.php,v
retrieving revision 1.21
diff -u -r1.21 summary.php
--- summary.php	26 Nov 2003 15:32:57 -0000	1.21
+++ summary.php	3 Dec 2003 20:35:11 -0000
@@ -87,8 +87,8 @@
                     $sts = imap_status($_SESSION['imp']['stream'], $serverstring . $folder, SA_UNSEEN | SA_RECENT);
                     if ($sts) {
                        if ( empty($this->_params['show_unread']) || !empty($sts->unseen) ) {
-                           if (!empty($sts->recent)) {
-                               $newmsgs[$folder] = $sts->recent;
+                           if (!empty($sts->unseen)) {
+                                $newmsgs[$folder] = $sts->unseen;
                            }
                            $url = Util::addParameter(Horde::applicationUrl('mailbox.php', true), 'no_newmail_popup', 1);
                            $url = Util::addParameter($url, 'mailbox', $folder);


More information about the dev mailing list