php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #1492 Would like the "Draft" flag added to the IMAP flags available for reading
Submitted: 1999-06-04 12:13 UTC Modified: 2000-07-18 06:47 UTC
From: chuck at horde dot org Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.9 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chuck at horde dot org
New email:
PHP Version: OS:

 

 [1999-06-04 12:13 UTC] chuck at horde dot org
Here is a patch against the 3.0.8 distribution:

--- php-3.0.8.orig/functions/imap.c     Tue Mar 30 06:25:04 1999
+++ php-3.0.8/functions/imap.c  Fri Jun  4 12:00:14 1999
@@ -716,6 +716,7 @@
                tmp[2] = cache->flagged ? 'F' : ' ';
                tmp[3] = cache->answered ? 'A' : ' ';
                tmp[4] = cache->deleted ? 'D' : ' ';
+               tmp[5] = cache->draft ? 'X' : ' ';
                sprintf (tmp+5,"%4ld) ",cache->msgno);
                mail_date (tmp+11,cache);
                tmp[17] = ' ';
@@ -1486,6 +1487,7 @@
        add_property_string(return_value,"Flagged",cache->flagged ? "F" : " ",1);
        add_property_string(return_value,"Answered",cache->answered ? "A" : " ",1);
        add_property_string(return_value,"Deleted",cache->deleted ? "D" : " ",1);
+       add_property_string(return_value,"Draft",cache->draft ? "X" : " ",1);
        sprintf (dummy,"%4ld",cache->msgno);
        add_property_string(return_value,"Msgno",dummy,1);
        mail_date (dummy,cache);
@@ -2349,6 +2351,7 @@
              add_property_long(&myoverview,"answered",elt->answered);
              add_property_long(&myoverview,"deleted",elt->deleted);
              add_property_long(&myoverview,"seen",elt->seen);
+             add_property_long(&myoverview,"draft",elt->draft);
              add_next_index_object(return_value,myoverview);
            }
        }

Apologies for any line wrapping; the changes should be pretty obvious.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-18 15:45 UTC] chuck at horde dot org
This still applies cleanly to PHP 3.0.9. Is there anything keeping this out of
the distribution?

On a seperate note, I need to rework how the php3_imap_listmailbox function
handles folders - specifically, I need it to return an array of objects in order
to have access to the mailbox attributes as well as names, the delimeter, etc.

This will obviously break compatibility with the existing imap_listmailbox function.
Would that keep it out of the distribution? I'd make another function, but
the real changes need to be made in mm_list, which is called from c-client,
so I'd need to do something ugly like setting a global and having an if/else in mm_list
that checked the global for which version to use... Thoughts? Suggestions?

Please send replies to me at chagenbu@wso.williams.edu as well, since I'm not
on the developer list. Though I'll subscribe if the discussion warrants it. Thanks,
and let me know.
-Chuck
 [1999-06-18 18:24 UTC] jim at cvs dot php dot net
It usually takes someone who knows the code for an extension
to commit changes to it. I'm not sure who is currently
maintaining the IMAP code.

I would recommend adding a new function with the functionality
you describe rather than breaking the existing function. If you
use the same function underneath those PHP functions, our
standard practice is to simply pass another parameter to that
internal function to deal with the differing behaviors.
 [2000-07-18 06:47 UTC] hholzgra at cvs dot php dot net
seems like this patch already made it into
php 3 and 4 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC