]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage/index: Add a helper to cache pop3 order and uidl
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 19 Sep 2018 12:49:56 +0000 (15:49 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 14 Nov 2018 12:48:40 +0000 (14:48 +0200)
src/lib-storage/index/index-mail.c
src/lib-storage/index/index-mail.h

index 30e714b3d3a946d3341a0f09cddfd213498426a6..070cb35120040c3a9280fbc6c543ea6b3dcef354 100644 (file)
@@ -623,6 +623,20 @@ void index_mail_cache_add_idx(struct index_mail *mail, unsigned int field_idx,
        }
 }
 
+void index_mail_cache_pop3_data(struct mail *_mail,
+                               const char *uidl, uint32_t order)
+{
+       struct index_mail *mail = INDEX_MAIL(_mail);
+
+       if (uidl != NULL)
+               index_mail_cache_add(mail, MAIL_CACHE_POP3_UIDL,
+                                    uidl, strlen(uidl));
+
+       if (order != 0)
+               index_mail_cache_add(mail, MAIL_CACHE_POP3_ORDER,
+                                    &order, sizeof(order));
+}
+
 static void parse_bodystructure_part_header(struct message_part *part,
                                            struct message_header_line *hdr,
                                            pool_t pool)
index 6ba64057b51dacd67139c425904dddc2bce3ed8a..62d7ceeaca0b2270dbc429a579c96ba72ab777f9 100644 (file)
@@ -266,6 +266,9 @@ void index_mail_cache_add(struct index_mail *mail, enum index_cache_field field,
 void index_mail_cache_add_idx(struct index_mail *mail, unsigned int field_idx,
                              const void *data, size_t data_size);
 
+void index_mail_cache_pop3_data(struct mail *_mail,
+                               const char *uidl, uint32_t order);
+
 struct istream *index_mail_cache_parse_init(struct mail *mail,
                                            struct istream *input);
 void index_mail_cache_parse_continue(struct mail *mail);