~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/imap/cmd-thread.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "imap-common.h"
4
4
#include "str.h"
95
95
                mail_thread_deinit(&ctx);
96
96
        }
97
97
 
98
 
        if (ret == 0) {
99
 
                (void)o_stream_send(cmd->client->output,
100
 
                                    str_data(str), str_len(str));
101
 
        }
 
98
        if (ret == 0)
 
99
                o_stream_nsend(cmd->client->output, str_data(str), str_len(str));
102
100
        str_free(&str);
103
101
        return ret;
104
102
}
176
174
        string_t *prev_subject, *reply;
177
175
        const char *subject, *base_subject;
178
176
        pool_t pool;
179
 
        ARRAY_DEFINE(threads, struct orderedsubject_thread);
 
177
        ARRAY(struct orderedsubject_thread) threads;
180
178
        const struct orderedsubject_thread *thread;
181
179
        struct orderedsubject_thread *cur_thread = NULL;
182
180
        uint32_t num;
183
 
        int ret;
 
181
        bool reply_or_fw;
 
182
        int ret, tz;
184
183
 
185
184
        prev_subject = str_new(default_pool, 128);
186
185
 
195
194
                        subject = "";
196
195
                T_BEGIN {
197
196
                        base_subject = imap_get_base_subject_cased(
198
 
                                        pool_datastack_create(), subject, NULL);
 
197
                                        pool_datastack_create(), subject,
 
198
                                        &reply_or_fw);
199
199
                        if (strcmp(str_c(prev_subject), base_subject) != 0) {
200
200
                                /* thread changed */
201
201
                                cur_thread = NULL;
208
208
                        /* starting a new thread. get the first message's
209
209
                           date */
210
210
                        cur_thread = array_append_space(&threads);
211
 
                        if (mail_get_date(mail, &cur_thread->timestamp, NULL) == 0 &&
 
211
                        if (mail_get_date(mail, &cur_thread->timestamp,
 
212
                                          &tz) == 0 &&
212
213
                            cur_thread->timestamp == 0) {
213
214
                                (void)mail_get_received_date(mail,
214
215
                                        &cur_thread->timestamp);