imap_thread support
| From: | Rob Siemborski | Date: | Thu, 15 Mar 2001 21:33:27 +0000 |
| Subject: | imap_thread support | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49014@lists.php.net to get a copy of this message | ||
So I recently came across a need to implement a call to imap_thread from
PHP-space, and being as PHP did not support a call to imap_thread, so I
implemented one that explicitly did a REFERENCES threading, and returned
the thread tree in the form of a hash with three types of entries...
"#.num" which is the IMAP message ID of the message for threadnode ID #
"#.branch" and "#.next" which correspond to the same things in the C
THREADNODE structure and point to the next #.
The tree is rooted at # == 0.
I'm almost certain there has to be a better way to represent the tree in
PHP, but at first glance references didn't seem to be able to do what I
wanted. Also, the function I wrote (though it could trivially be
expanded) only called the REFERENCES method, not the ORDEREDSUBJECT
method.
Attached is a patch against the 4.0.4pl1 source tree, but I don't think
that there should be severe difficulties in applying it to any recent
version. I'm not sure it conforms to all of the PHP coding standards,
but I guess you can consider it a first draft/attempt at a submission.
-Rob
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * rjs3@andrew.cmu.edu * WRCT 88.3fm - Chief Engineer
Andrew Systems Group * Cyert Hall 235 * 412-CMU-TREK
-----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCS/IT/CM/CC/PA d- s+: a-- C++++$ UBLS++++$ P+++$ L++(+++) E W- N- o?
K- w O- M-- V-- PS+ PE++ Y+ PGP t+@ 5+++ R@ tv-- b+ DI+++ G e h r- y?
------END GEEK CODE BLOCK-----