Re: imap_append() patch

From: Date: Wed, 26 Mar 2003 16:10:00 +0000
Subject: Re: imap_append() patch
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-317@lists.php.net to get a copy of this message
On Wednesday, March 26, 2003, 4:44:14 PM, Rudi Benkovic wrote: > This little patch adds a fifth optional parameter for imap_append() > which allows to set the internal IMAP date of the appended messages. > It seems to work fine here... If anyone would care to commit it, that > would be great. Oh, hell it works fine... It didn't use the fourth argument if the fifth was present. Here's a new patch. Sorry. ;) -- Rudi Benkovic rudi@jawmail.org

--- php_imap.c.orig Wed Mar 26 16:35:04 2003 +++ php_imap.c Wed Mar 26 16:37:10 2003 @@ -761,16 +761,16 @@ } /* }}} */ -/* {{{ proto bool imap_append(resource stream_id, string folder, string message [, string options]) +/* {{{ proto bool imap_append(resource stream_id, string folder, string message [, string options, string date]) Append a new message to a specified mailbox */ PHP_FUNCTION(imap_append) { - zval **streamind, **folder, **message, **flags; + zval **streamind, **folder, **message, **flags, **date; pils *imap_le_struct; STRING st; int myargc=ZEND_NUM_ARGS(); - if (myargc < 3 || myargc > 4 || zend_get_parameters_ex(myargc, &streamind, &folder, &message, &flags) == FAILURE) { + if (myargc < 3 || myargc > 5 || zend_get_parameters_ex(myargc, &streamind, &folder, &message, &flags, &date) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } @@ -779,13 +779,22 @@ convert_to_string_ex(folder); convert_to_string_ex(message); - if (myargc == 4) { + if (myargc >= 4) { convert_to_string_ex(flags); } + if (myargc == 5) { + convert_to_string_ex(date); + } INIT (&st, mail_string, (void *) Z_STRVAL_PP(message), Z_STRLEN_PP(message)); - if (mail_append_full(imap_le_struct->imap_stream, Z_STRVAL_PP(folder), myargc==4 ? Z_STRVAL_PP(flags) : NIL, NIL, &st)) { + if (mail_append_full(imap_le_struct->imap_stream, + Z_STRVAL_PP(folder), + myargc>=4 ? Z_STRVAL_PP(flags) : NIL, + myargc==5 ? Z_STRVAL_PP(date) : NIL, + &st + ) + ) { RETURN_TRUE; } else { RETURN_FALSE;
« previous php.internals (#317) next »