static void test10() { struct imap_refmsgtable *mt=rfc822_threadalloc(); rfc822_threadmsg(mt, "<message1>", NULL, "subject 1", "Thu, 20 Jun 2000 14:41:58 -0700", 1); rfc822_threadmsg(mt, "<message4>", "<message1>", "subject 2", "Thu, 21 Jun 2000 14:41:58 -0700", 6); rfc822_threadmsg(mt, "<message1>", NULL, "subject 2", "Thu, 21 Jun 2000 14:41:58 -0700", 5); rfc822_threadmsg(mt, "<message4>", "<message1>", "subject 2", "Thu, 21 Jun 2000 14:41:58 -0700", 6); rfc822_threadprune(mt); rfc822_threadsortsubj(rfc822_threadgetroot(mt)); rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt)); rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt)); rfc822_threadsortbydate(mt); prpc(mt); rfc822_threadfree(mt); }
struct imap_refmsg *rfc822_thread(struct imap_refmsgtable *mt) { if (!mt->rootptr) { rfc822_threadprune(mt); if ((mt->rootptr=rfc822_threadgetroot(mt)) == 0) return (0); if (rfc822_threadsortsubj(mt, mt->rootptr) || rfc822_threadmergesubj(mt, mt->rootptr) || rfc822_threadsortbydate(mt)) { mt->rootptr=0; return (0); } } return (mt->rootptr); }
static void test9() { struct imap_refmsgtable *mt=rfc822_threadalloc(); rfc822_threadmsg(mt, "<message1>", NULL, "subject 1", "Thu, 20 Jun 2000 14:41:55 -0700", 1); rfc822_threadmsg(mt, "<message2>", NULL, "subject 1", "Thu, 19 Jun 2000 14:41:51 -0700", 2); rfc822_threadmsg(mt, "<message3>", NULL, "subject 1", "Thu, 21 Jun 2000 14:41:56 -0700", 3); rfc822_threadmsg(mt, "<message4>", "<message2>", "subject 2", "Thu, 21 Jun 2000 14:41:54 -0700", 6); rfc822_threadmsg(mt, "<message5>", "<message2>", "subject 2", "Thu, 21 Jun 2000 14:41:53 -0700", 5); rfc822_threadmsg(mt, "<message6>", "<message2>", "subject 2", "Thu, 20 Jun 2000 14:41:52 -0700", 4); rfc822_threadprune(mt); rfc822_threadsortsubj(rfc822_threadgetroot(mt)); rfc822_threadgathersubj(mt, rfc822_threadgetroot(mt)); rfc822_threadmergesubj(mt, rfc822_threadgetroot(mt)); rfc822_threadsortbydate(mt); prpc(mt); rfc822_threadfree(mt); }