]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add mailbox_was_vname_changed_by_nfc() and mailbox_suppress_notifying_nf...
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 16 Feb 2026 14:25:40 +0000 (14:25 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Feb 2026 08:53:02 +0000 (08:53 +0000)
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index 2e67c1b8cabe81705a4f9c08bd4cfef82d718893..e8266b617e22f6a725c3cae5e653bb90b81880e4 100644 (file)
@@ -1520,6 +1520,21 @@ mailbox_vname_normalize_ns_prefix_nfc(struct mailbox_list *list,
        *vname = str_c(str);
 }
 
+bool mailbox_was_vname_changed_by_nfc(struct mailbox *box,
+                                     const char **orig_vname_r)
+{
+       if (!box->mailbox_name_changed_by_nfc)
+               return FALSE;
+       if (orig_vname_r != NULL)
+               *orig_vname_r = box->vname_raw;
+       return TRUE;
+}
+
+void mailbox_suppress_nfc_name_change_notification(struct mailbox *box)
+{
+       box->notifying_nfc_name_change = TRUE;
+}
+
 int mailbox_rename_nfc_forced(struct mailbox_list *list, const char *vname_raw,
                              const char *vname_nfc, const char **vname_new_r,
                              const char **error_r)
index 732a46cbf4972aa796f14bd4d0c2be99eef79150..6075f2a07b56f7a5dd20728efabfc5c67e7267c8 100644 (file)
@@ -662,6 +662,11 @@ mailbox_get_settings(struct mailbox *box) ATTR_PURE;
 const char *mailbox_get_vname(const struct mailbox *box) ATTR_PURE;
 /* Returns the backend name of given mailbox. */
 const char *mailbox_get_name(const struct mailbox *box) ATTR_PURE;
+/* Returns the original vname if it has been NFC normalized */
+bool mailbox_was_vname_changed_by_nfc(struct mailbox *box,
+                                     const char **orig_vname_r);
+/* Suppress lib-storage notification */
+void mailbox_suppress_nfc_name_change_notification(struct mailbox *box);
 
 /* Returns TRUE if mailbox is read-only. */
 bool mailbox_is_readonly(struct mailbox *box);