I am thinking of hacking up delete_move_next to work more like Pine... I
think it was Pine that did this... When viewing a message and hitting
"Delete & Next" or "Delete & Prev", I'm want it to go to the next/prev
unread message. If there is not an unread message before or after
(depending on the link), I want it to return to the mailbox.

My first step is to just check the adjacent messages's flag_unseen. So, I
created findNextMessageSeen() and findPreviousMessageSeen(). They look
like this: (findPreviousMessageSeen is similar)

function findNextMessageSeen() {
    global $msgs;
    $next_id = findNextMessage();
    for ($i = 0; $i < count($msgs); $i++) {
        if ($msgs[$i]['ID'] == $next_id) {
            $result = $msgs[$i]['FLAG_SEEN'];
        }
    }
    return ($result);
}

This accomplishes step 1, checking adjacent messages. Now, what would be
the best way to take it to the next level and find the next/previous
unread message? My initial thought was a while ($result) { for {...} }...
but all those whiles and fors would add up. Is there a more efficient way
I could do this?

Thanks,

Dan




-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
--
squirrelmail-users mailing list
List Address: [EMAIL PROTECTED]
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to