Skip to content

Commit

Permalink
Merge pull request #2939 from dilyanpalauzov/master-remove-mailbox_ci…
Browse files Browse the repository at this point in the history
…d_rename

(merged manually because github web ui made a mess of it)
  • Loading branch information
elliefm committed Aug 26, 2024
2 parents 395ab9b + 22f840b commit e5b73a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
38 changes: 0 additions & 38 deletions imap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -8368,44 +8368,6 @@ EXPORTED int mailbox_annotation_lookupmask(struct mailbox *mailbox, uint32_t uid
return annotatemore_msg_lookupmask(mailbox, uid, entry, userid, value);
}


int mailbox_cid_rename(struct mailbox *mailbox,
conversation_id_t from_cid,
conversation_id_t to_cid)
{
const message_t *msg;
int r = 0;

if (!config_getswitch(IMAPOPT_CONVERSATIONS))
return 0;

struct mailbox_iter *iter = mailbox_iter_init(mailbox, 0, ITER_SKIP_UNLINKED);
while ((msg = mailbox_iter_step(iter))) {
const struct index_record *record = msg_record(msg);
if (record->cid != from_cid)
continue;

/*
* Just rename the CID in place - injecting a copy at the end
* messes with clients that just use UID ordering, like Apple's
* IOS email client */

struct index_record copyrecord = *record;
copyrecord.cid = to_cid;
r = mailbox_rewrite_index_record(mailbox, &copyrecord);

if (r) {
syslog(LOG_ERR, "mailbox_cid_rename: error "
"rewriting record %u, mailbox %s: %s from %llu to %llu",
record->recno, mailbox_name(mailbox), error_message(r), from_cid, to_cid);
break;
}
}
mailbox_iter_done(&iter);

return r;
}

EXPORTED void mailbox_set_wait_cb(void (*cb)(void *), void *rock)
{
mailbox_wait_cb = cb;
Expand Down
4 changes: 0 additions & 4 deletions imap/mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,6 @@ extern int mailbox_delete_dav(struct mailbox *mailbox);
extern int mailbox_add_sieve(struct mailbox *mailbox);
extern int mailbox_add_email_alarms(struct mailbox *mailbox);

/* Rename a CID. Note - this is just one mailbox! */
extern int mailbox_cid_rename(struct mailbox *mailbox,
conversation_id_t from_cid,
conversation_id_t to_cid);
extern int mailbox_add_conversations(struct mailbox *mailbox, int silent);
extern int mailbox_get_xconvmodseq(struct mailbox *mailbox, modseq_t *);
extern int mailbox_update_xconvmodseq(struct mailbox *mailbox, modseq_t, int force);
Expand Down

0 comments on commit e5b73a5

Please sign in to comment.