]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Simplified mailbox_keyword*() APIs.
authorTimo Sirainen <tss@iki.fi>
Mon, 6 Dec 2010 02:16:22 +0000 (02:16 +0000)
committerTimo Sirainen <tss@iki.fi>
Mon, 6 Dec 2010 02:16:22 +0000 (02:16 +0000)
They are no longer struct mailbox methods, because they're always implemented
as being wrappers to lib-index APIs anyway.

Also mailbox_keywords_ref/unref() no longer take mailbox parameter.

23 files changed:
src/dsync/dsync-worker-local.c
src/imap/cmd-append.c
src/imap/cmd-store.c
src/lib-lda/mail-deliver.c
src/lib-storage/Makefile.am
src/lib-storage/index/cydir/cydir-storage.c
src/lib-storage/index/dbox-multi/mdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-storage.c
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-storage.h
src/lib-storage/index/maildir/maildir-storage.c
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/index/raw/raw-storage.c
src/lib-storage/mail-copy.c
src/lib-storage/mail-search.c
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h
src/lib-storage/test-mailbox.c
src/plugins/acl/acl-mailbox.c
src/plugins/virtual/virtual-save.c
src/plugins/virtual/virtual-storage.c
src/plugins/virtual/virtual-sync.c

index 801f0696bc7d355356c548d8bb742f9d7d52b649..b6bd0290b27fd2ad105fc196e68cd77ea4c145a6 100644 (file)
@@ -1523,7 +1523,7 @@ local_worker_msg_update_metadata(struct dsync_worker *_worker,
                keywords = mailbox_keywords_create_valid(worker->mail->box,
                                                         msg->keywords);
                mail_update_keywords(worker->mail, MODIFY_REPLACE, keywords);
-               mailbox_keywords_unref(worker->mail->box, &keywords);
+               mailbox_keywords_unref(&keywords);
                mail_update_modseq(worker->mail, msg->modseq);
        }
 }
@@ -1574,7 +1574,7 @@ local_worker_msg_save_set_metadata(struct local_dsync_worker *worker,
                mailbox_keywords_create_valid(box, msg->keywords);
        mailbox_save_set_flags(save_ctx, msg->flags, keywords);
        if (keywords != NULL)
-               mailbox_keywords_unref(box, &keywords);
+               mailbox_keywords_unref(&keywords);
        mailbox_save_set_uid(save_ctx, msg->uid);
        mailbox_save_set_save_date(save_ctx, msg->save_date);
        mailbox_save_set_min_modseq(save_ctx, msg->modseq);
index 93e464fb136de29e8470a7f563667a5bc3c44bb1..33d4a29c44c88b84ce8d1d5a388126b060cc88ff 100644 (file)
@@ -351,7 +351,7 @@ static bool cmd_append_continue_parsing(struct client_command_context *cmd)
        ret = mailbox_save_begin(&ctx->save_ctx, ctx->input);
 
        if (keywords != NULL)
-               mailbox_keywords_unref(ctx->box, &keywords);
+               mailbox_keywords_unref(&keywords);
 
        if (ret < 0) {
                /* save initialization failed */
index 921d9872f44c70ec3945647b5ef606ba7e27a777..ff53ac400ac5733733a61b1e010943f4a96f9c22 100644 (file)
@@ -201,7 +201,7 @@ bool cmd_store(struct client_command_context *cmd)
        mail_free(&mail);
 
        if (ctx.keywords != NULL)
-               mailbox_keywords_unref(client->mailbox, &ctx.keywords);
+               mailbox_keywords_unref(&ctx.keywords);
 
        ret = mailbox_search_deinit(&search_ctx);
        if (ret < 0)
index 51183254ff686e7b97c2c536c4b96d9be71c376e..5b71477f3f75890ac2a88c66b6d98c1172b91c38 100644 (file)
@@ -253,7 +253,7 @@ int mail_deliver_save(struct mail_deliver_context *ctx, const char *mailbox,
        else
                mail_deliver_log_cache_var_expand_table(ctx);
        if (kw != NULL)
-               mailbox_keywords_unref(box, &kw);
+               mailbox_keywords_unref(&kw);
        mail_free(&ctx->dest_mail);
 
        if (ret < 0)
index 14a844b8379980ff835d546d1f5059c938e38494..545f838e1095fbfcdb0d878060161325bca04ac9 100644 (file)
@@ -33,6 +33,7 @@ libstorage_la_SOURCES = \
        mail-storage-settings.c \
        mail-thread.c \
        mail-user.c \
+       mailbox-keywords.c \
        mailbox-list.c \
        mailbox-search-result.c \
        mailbox-tree.c \
index d1bf328d439fa652797e58405522efb3c91c847a..5570550c4803c792d3cdca2ab92e351f9be7e919 100644 (file)
@@ -156,11 +156,6 @@ struct mailbox cydir_mailbox = {
                index_transaction_commit,
                index_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index be4fdb84d9b45134e5e248bc7ed0ab46b4c66b1e..f848fe5e5daa7dc8788777badcb56de631307b83 100644 (file)
@@ -415,11 +415,6 @@ struct mailbox mdbox_mailbox = {
                index_transaction_commit,
                index_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index 9b0b76027e1734b0ab7eaf9f9652f92f9b5d3ab4..e0c7cbf44348ac92402406c0834f684657a38fbf 100644 (file)
@@ -382,11 +382,6 @@ struct mailbox sdbox_mailbox = {
                index_transaction_commit,
                index_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index 3f907bda1a900a770a1078b40a0e2d2577f47455..36d5157f3888e2dee319993a62887dacee63d5b5 100644 (file)
@@ -5,7 +5,6 @@
 #include "istream.h"
 #include "ioloop.h"
 #include "str.h"
-#include "imap-parser.h"
 #include "mkdir-parents.h"
 #include "mail-index-alloc-cache.h"
 #include "mail-index-private.h"
@@ -490,105 +489,6 @@ bool index_storage_is_inconsistent(struct mailbox *box)
        return mail_index_view_is_inconsistent(box->view);
 }
 
-bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
-                           const char **error_r)
-{
-       unsigned int i, idx;
-
-       i_assert(box->opened);
-
-       /* if it already exists, skip validity checks */
-       if (mail_index_keyword_lookup(box->index, keyword, &idx))
-               return TRUE;
-
-       if (*keyword == '\0') {
-               *error_r = "Empty keywords not allowed";
-               return FALSE;
-       }
-
-       /* these are IMAP-specific restrictions, but for now IMAP is all we
-          care about */
-       for (i = 0; keyword[i] != '\0'; i++) {
-               if (IS_ATOM_SPECIAL((unsigned char)keyword[i])) {
-                       *error_r = "Invalid characters in keyword";
-                       return FALSE;
-               }
-               if ((unsigned char)keyword[i] >= 0x80) {
-                       *error_r = "8bit characters in keyword";
-                       return FALSE;
-               }
-       }
-       if (i > box->storage->set->mail_max_keyword_length) {
-               *error_r = "Keyword length too long";
-               return FALSE;
-       }
-       return TRUE;
-}
-
-static struct mail_keywords *
-index_keywords_create_skip(struct mailbox *box,
-                          const char *const keywords[])
-{
-       ARRAY_DEFINE(valid_keywords, const char *);
-       const char *error;
-
-       t_array_init(&valid_keywords, 32);
-       for (; *keywords != NULL; keywords++) {
-               if (mailbox_keyword_is_valid(box, *keywords, &error))
-                       array_append(&valid_keywords, keywords, 1);
-       }
-       (void)array_append_space(&valid_keywords); /* NULL-terminate */
-       return mail_index_keywords_create(box->index, keywords);
-}
-
-int index_keywords_create(struct mailbox *box, const char *const keywords[],
-                         struct mail_keywords **keywords_r, bool skip_invalid)
-{
-       const char *error;
-       unsigned int i;
-
-       i_assert(box->opened);
-
-       for (i = 0; keywords[i] != NULL; i++) {
-               if (mailbox_keyword_is_valid(box, keywords[i], &error))
-                       continue;
-
-               if (!skip_invalid) {
-                       mail_storage_set_error(box->storage,
-                                              MAIL_ERROR_PARAMS, error);
-                       return -1;
-               }
-
-               /* found invalid keywords, do this the slow way */
-               T_BEGIN {
-                       *keywords_r = index_keywords_create_skip(box, keywords);
-               } T_END;
-               return 0;
-       }
-
-       *keywords_r = mail_index_keywords_create(box->index, keywords);
-       return 0;
-}
-
-struct mail_keywords *
-index_keywords_create_from_indexes(struct mailbox *box,
-                                  const ARRAY_TYPE(keyword_indexes) *idx)
-{
-       i_assert(box->opened);
-
-       return mail_index_keywords_create_from_indexes(box->index, idx);
-}
-
-void index_keywords_ref(struct mail_keywords *keywords)
-{
-       mail_index_keywords_ref(keywords);
-}
-
-void index_keywords_unref(struct mail_keywords *keywords)
-{
-       mail_index_keywords_unref(&keywords);
-}
-
 void index_save_context_free(struct mail_save_context *ctx)
 {
        i_free_and_null(ctx->from_envelope);
index db61e4e5adb1eb70c614ec1b723f16270ec773d2..be9a74033baeb570abe3094d1d64cc36c7291e40 100644 (file)
@@ -81,16 +81,6 @@ bool index_storage_is_readonly(struct mailbox *box);
 bool index_storage_allow_new_keywords(struct mailbox *box);
 bool index_storage_is_inconsistent(struct mailbox *box);
 
-int index_keywords_create(struct mailbox *box, const char *const keywords[],
-                         struct mail_keywords **keywords_r, bool skip_invalid);
-struct mail_keywords *
-index_keywords_create_from_indexes(struct mailbox *box,
-                                  const ARRAY_TYPE(keyword_indexes) *idx);
-void index_keywords_ref(struct mail_keywords *keywords);
-void index_keywords_unref(struct mail_keywords *keywords);
-bool index_keyword_is_valid(struct mailbox *box, const char *keyword,
-                           const char **error_r);
-
 void index_mailbox_set_recent_uid(struct mailbox *box, uint32_t uid);
 void index_mailbox_set_recent_seq(struct mailbox *box,
                                  struct mail_index_view *view,
index 68d45806dbcf186166b799f071d2f5424e61fea5..a822f48ab6d58bff68710799b260ed5399dd8e98 100644 (file)
@@ -656,11 +656,6 @@ struct mailbox maildir_mailbox = {
                index_transaction_commit,
                index_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index 003b59d71abe3adac1bcd141e016ea06eae47fa2..909ba53eb36bad1f39a7f83d93614e0cb7f8d3c1 100644 (file)
@@ -760,11 +760,6 @@ struct mailbox mbox_mailbox = {
                mbox_transaction_commit,
                mbox_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index 367bc4f044c057b0c4de5daa3d4b84114dc0b89a..b6d4498dd0cdb12f98e74f0a7adcc3d6e1d8daa6 100644 (file)
@@ -156,11 +156,6 @@ struct mailbox raw_mailbox = {
                index_transaction_commit,
                index_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index f6f8450ef7300496290c1f9339b46602bb57d79b..6687c858b96c3901da779660ce2dbb7a00b12fb3 100644 (file)
@@ -64,7 +64,7 @@ int mail_storage_copy(struct mail_save_context *ctx, struct mail *mail)
                /* keywords gets unreferenced twice: first in
                   mailbox_save_cancel()/_finish() and second time in
                   mailbox_copy(). */
-               mailbox_keywords_ref(ctx->transaction->box, ctx->keywords);
+               mailbox_keywords_ref(ctx->keywords);
        }
 
        if (mail_storage_try_copy(&ctx, mail) < 0) {
index 893233d0d423286163e19016cd3c403ee0b9832c..307bcf93fd21096e5f431479722e3dca0bc07ad9 100644 (file)
@@ -158,7 +158,7 @@ static void mail_search_args_deinit_sub(struct mail_search_args *args,
                case SEARCH_KEYWORDS:
                        if (arg->value.keywords == NULL)
                                break;
-                       mailbox_keywords_unref(args->box, &arg->value.keywords);
+                       mailbox_keywords_unref(&arg->value.keywords);
                        break;
                case SEARCH_MAILBOX_GLOB:
                        if (arg->value.mailbox_glob == NULL)
@@ -619,8 +619,8 @@ mail_search_keywords_merge(struct mailbox *box,
                new_kw = mailbox_keywords_create_from_indexes(box,
                                                              &new_indexes);
        } T_END;
-       mailbox_keywords_unref(box, _kw1);
-       mailbox_keywords_unref(box, _kw2);
+       mailbox_keywords_unref(_kw1);
+       mailbox_keywords_unref(_kw2);
        return new_kw;
 }
 
index 5098ce37d8cc11d6c12228a57b878ef812f96ebf..6f53b7f500ee6f435ed274e4e03bcb3ee4bc9b4d 100644 (file)
@@ -154,18 +154,6 @@ struct mailbox_vfuncs {
                                           uint64_t max_modseq,
                                           ARRAY_TYPE(seq_range) *seqs);
 
-       int (*keywords_create)(struct mailbox *box,
-                              const char *const keywords[],
-                              struct mail_keywords **keywords_r,
-                              bool skip_invalid);
-       struct mail_keywords *
-               (*keywords_create_from_indexes)(struct mailbox *box,
-                                               const ARRAY_TYPE(keyword_indexes) *idx);
-       void (*keywords_ref)(struct mail_keywords *keywords);
-       void (*keywords_unref)(struct mail_keywords *keywords);
-       bool (*keyword_is_valid)(struct mailbox *box, const char *keyword,
-                                const char **error_r);
-
        void (*get_seq_range)(struct mailbox *box, uint32_t uid1, uint32_t uid2,
                              uint32_t *seq1_r, uint32_t *seq2_r);
        void (*get_uid_range)(struct mailbox *box,
index 598f6eeb09ad74f75a7dd803eeeda000175be4de..5ea692721f0a98e05694952274d09081bf53c3c3 100644 (file)
@@ -1013,57 +1013,6 @@ void mailbox_notify_changes_stop(struct mailbox *box)
        mailbox_notify_changes(box, 0, NULL, NULL);
 }
 
-int mailbox_keywords_create(struct mailbox *box, const char *const keywords[],
-                           struct mail_keywords **keywords_r)
-{
-       const char *empty_keyword_list = NULL;
-
-       if (keywords == NULL)
-               keywords = &empty_keyword_list;
-       return box->v.keywords_create(box, keywords, keywords_r, FALSE);
-}
-
-struct mail_keywords *
-mailbox_keywords_create_valid(struct mailbox *box,
-                             const char *const keywords[])
-{
-       const char *empty_keyword_list = NULL;
-       struct mail_keywords *kw;
-
-       if (keywords == NULL)
-               keywords = &empty_keyword_list;
-       if (box->v.keywords_create(box, keywords, &kw, TRUE) < 0)
-               i_unreached();
-       return kw;
-}
-
-struct mail_keywords *
-mailbox_keywords_create_from_indexes(struct mailbox *box,
-                                    const ARRAY_TYPE(keyword_indexes) *idx)
-{
-       return box->v.keywords_create_from_indexes(box, idx);
-}
-
-void mailbox_keywords_ref(struct mailbox *box, struct mail_keywords *keywords)
-{
-       box->v.keywords_ref(keywords);
-}
-
-void mailbox_keywords_unref(struct mailbox *box,
-                           struct mail_keywords **_keywords)
-{
-       struct mail_keywords *keywords = *_keywords;
-
-       *_keywords = NULL;
-       box->v.keywords_unref(keywords);
-}
-
-bool mailbox_keyword_is_valid(struct mailbox *box, const char *keyword,
-                             const char **error_r)
-{
-       return box->v.keyword_is_valid(box, keyword, error_r);
-}
-
 void mailbox_get_seq_range(struct mailbox *box, uint32_t uid1, uint32_t uid2,
                           uint32_t *seq1_r, uint32_t *seq2_r)
 {
@@ -1308,7 +1257,7 @@ void mailbox_save_set_flags(struct mail_save_context *ctx,
        ctx->flags = flags;
        ctx->keywords = keywords;
        if (keywords != NULL)
-               mailbox_keywords_ref(ctx->transaction->box, keywords);
+               mailbox_keywords_ref(keywords);
 }
 
 void mailbox_save_copy_flags(struct mail_save_context *ctx, struct mail *mail)
@@ -1416,20 +1365,19 @@ int mailbox_save_finish(struct mail_save_context **_ctx)
        *_ctx = NULL;
        ret = box->v.save_finish(ctx);
        if (keywords != NULL)
-               mailbox_keywords_unref(box, &keywords);
+               mailbox_keywords_unref(&keywords);
        return ret;
 }
 
 void mailbox_save_cancel(struct mail_save_context **_ctx)
 {
        struct mail_save_context *ctx = *_ctx;
-       struct mailbox *box = ctx->transaction->box;
        struct mail_keywords *keywords = ctx->keywords;
 
        *_ctx = NULL;
        ctx->transaction->box->v.save_cancel(ctx);
        if (keywords != NULL)
-               mailbox_keywords_unref(box, &keywords);
+               mailbox_keywords_unref(&keywords);
 }
 
 int mailbox_copy(struct mail_save_context **_ctx, struct mail *mail)
@@ -1449,7 +1397,7 @@ int mailbox_copy(struct mail_save_context **_ctx, struct mail *mail)
 
        ret = ctx->transaction->box->v.copy(ctx, mail);
        if (keywords != NULL)
-               mailbox_keywords_unref(box, &keywords);
+               mailbox_keywords_unref(&keywords);
        return ret;
 }
 
index 5336c8d8cf1038c60a49827557a03abd40401942..08c616db26835a94b5dcd8cc0d9a1b199c65e278 100644 (file)
@@ -535,9 +535,8 @@ mailbox_keywords_create_valid(struct mailbox *box,
 struct mail_keywords *
 mailbox_keywords_create_from_indexes(struct mailbox *box,
                                     const ARRAY_TYPE(keyword_indexes) *idx);
-void mailbox_keywords_ref(struct mailbox *box, struct mail_keywords *keywords);
-void mailbox_keywords_unref(struct mailbox *box,
-                           struct mail_keywords **keywords);
+void mailbox_keywords_ref(struct mail_keywords *keywords);
+void mailbox_keywords_unref(struct mail_keywords **keywords);
 /* Returns TRUE if keyword is valid, FALSE and error if not. */
 bool mailbox_keyword_is_valid(struct mailbox *box, const char *keyword,
                              const char **error_r);
index 126cd1806fcc1aa32def046f7796a666a125e6ba..9c8a0e1e0af9b68ba787cafb6c0081c8a32931af 100644 (file)
@@ -145,47 +145,6 @@ test_mailbox_transaction_set_max_modseq(struct mailbox_transaction_context *t AT
 {
 }
 
-static int
-test_mailbox_keywords_create(struct mailbox *box ATTR_UNUSED,
-                            const char *const keywords[] ATTR_UNUSED,
-                            struct mail_keywords **keywords_r,
-                            bool skip_invalid ATTR_UNUSED)
-{
-       *keywords_r = i_new(struct mail_keywords, 1);
-       (*keywords_r)->refcount = 1;
-       return 0;
-}
-
-static struct mail_keywords *
-test_mailbox_keywords_create_from_indexes(struct mailbox *box ATTR_UNUSED,
-                                         const ARRAY_TYPE(keyword_indexes) *idx ATTR_UNUSED)
-{
-       struct mail_keywords *keywords;
-
-       keywords = i_new(struct mail_keywords, 1);
-       keywords->refcount++;
-       return keywords;
-}
-
-static void test_mailbox_keywords_ref(struct mail_keywords *keywords)
-{
-       keywords->refcount++;
-}
-
-static void test_mailbox_keywords_unref(struct mail_keywords *keywords)
-{
-       if (--keywords->refcount == 0)
-               i_free(keywords);
-}
-
-static bool
-test_mailbox_keyword_is_valid(struct mailbox *box ATTR_UNUSED,
-                             const char *keyword ATTR_UNUSED,
-                             const char **error_r ATTR_UNUSED)
-{
-       return TRUE;
-}
-
 static void
 test_mailbox_get_seq_range(struct mailbox *box ATTR_UNUSED,
                           uint32_t uid1, uint32_t uid2,
@@ -340,11 +299,6 @@ struct mailbox test_mailbox = {
                test_mailbox_transaction_commit,
                test_mailbox_transaction_rollback,
                test_mailbox_transaction_set_max_modseq,
-               test_mailbox_keywords_create,
-               test_mailbox_keywords_create_from_indexes,
-               test_mailbox_keywords_ref,
-               test_mailbox_keywords_unref,
-               test_mailbox_keyword_is_valid,
                test_mailbox_get_seq_range,
                test_mailbox_get_uid_range,
                test_mailbox_get_expunged_uids,
index dec085d0d20869c38510af5b138eb29fcd9e5897..3ecc40d41a6511b125a626221add176132587d94 100644 (file)
@@ -428,35 +428,6 @@ acl_transaction_commit(struct mailbox_transaction_context *ctx,
        return abox->module_ctx.super.transaction_commit(ctx, changes_r);
 }
 
-static int
-acl_keywords_create(struct mailbox *box, const char *const keywords[],
-                   struct mail_keywords **keywords_r, bool skip_invalid)
-{
-       struct acl_mailbox *abox = ACL_CONTEXT(box);
-       int ret;
-
-       ret = acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_WRITE);
-       if (ret < 0) {
-               if (!skip_invalid)
-                       return -1;
-               /* we can't return failure. assume we don't have permissions. */
-               ret = 0;
-       }
-
-       if (ret == 0) {
-               /* no permission to update any flags. just return empty
-                  keywords list. */
-               const char *null = NULL;
-
-               return abox->module_ctx.super.keywords_create(box, &null,
-                                                             keywords_r,
-                                                             skip_invalid);
-       }
-
-       return abox->module_ctx.super.keywords_create(box, keywords,
-                                                     keywords_r, skip_invalid);
-}
-
 static int acl_mailbox_open_check_acl(struct mailbox *box)
 {
        struct acl_mailbox *abox = ACL_CONTEXT(box);
@@ -529,7 +500,6 @@ void acl_mailbox_allocated(struct mailbox *box)
                v->delete = acl_mailbox_delete;
                v->rename = acl_mailbox_rename;
                v->save_begin = acl_save_begin;
-               v->keywords_create = acl_keywords_create;
                v->copy = acl_copy;
                v->transaction_commit = acl_transaction_commit;
        }
index 06b7e49ef2d84fe24a937b18be2f29f492ac524b..e6321142d191da68253166282ed2abbf7ddf20e8 100644 (file)
@@ -125,7 +125,7 @@ void virtual_save_free(struct mail_save_context *_ctx)
        struct virtual_save_context *ctx = (struct virtual_save_context *)_ctx;
 
        if (ctx->backend_keywords != NULL)
-               mailbox_keywords_unref(ctx->backend_box, &ctx->backend_keywords);
+               mailbox_keywords_unref(&ctx->backend_keywords);
        if (ctx->backend_save_ctx != NULL)
                mailbox_save_cancel(&ctx->backend_save_ctx);
        i_free(ctx);
index f15f4e5f9ca17d60e85a90096852417ecc62b253..a49582ee4726a1ac903582cc7bd6d151fccae7b2 100644 (file)
@@ -527,11 +527,6 @@ struct mailbox virtual_mailbox = {
                virtual_transaction_commit,
                virtual_transaction_rollback,
                index_transaction_set_max_modseq,
-               index_keywords_create,
-               index_keywords_create_from_indexes,
-               index_keywords_ref,
-               index_keywords_unref,
-               index_keyword_is_valid,
                index_storage_get_seq_range,
                index_storage_get_uid_range,
                index_storage_get_expunges,
index 884f647e4c8a9921f32f4c3d3a8206be5543c2b1..ccd0d340a6674f5a10b624cba7a816cb3459fa6e 100644 (file)
@@ -406,7 +406,7 @@ static void virtual_sync_index_rec(struct virtual_sync_context *ctx,
                                MODIFY_ADD : MODIFY_REMOVE;
                        mail_update_keywords(bbox->sync_mail,
                                             modify_type, keywords);
-                       mailbox_keywords_unref(bbox->box, &keywords);
+                       mailbox_keywords_unref(&keywords);
                        break;
                case MAIL_INDEX_SYNC_TYPE_KEYWORD_RESET:
                        kw_names[0] = NULL;
@@ -414,7 +414,7 @@ static void virtual_sync_index_rec(struct virtual_sync_context *ctx,
                                                                 kw_names);
                        mail_update_keywords(bbox->sync_mail, MODIFY_REPLACE,
                                             keywords);
-                       mailbox_keywords_unref(bbox->box, &keywords);
+                       mailbox_keywords_unref(&keywords);
                        break;
                case MAIL_INDEX_SYNC_TYPE_APPEND:
                        i_unreached();