]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual: Added support for IDLE notifications.
authorTimo Sirainen <tss@iki.fi>
Wed, 4 Aug 2010 15:54:17 +0000 (16:54 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 4 Aug 2010 15:54:17 +0000 (16:54 +0100)
src/plugins/virtual/virtual-storage.c

index ce4d931e3eaade3c3102fa30f9e1cb0e7b128cd1..c241995f47eb98993d6e3bf0417f91e69275e83c 100644 (file)
@@ -356,9 +356,29 @@ virtual_mailbox_get_guid(struct mailbox *box,
        return -1;
 }
 
-static void virtual_notify_changes(struct mailbox *box ATTR_UNUSED)
+static void
+virtual_notify_callback(struct mailbox *bbox ATTR_UNUSED, struct mailbox *box)
+{
+       box->notify_callback(box, box->notify_context);
+}
+
+static void virtual_notify_changes(struct mailbox *box)
 {
-       /* FIXME: maybe some day */
+       struct virtual_mailbox *mbox = (struct virtual_mailbox *)box;
+       struct virtual_backend_box *const *bboxes;
+       unsigned int i, count;
+
+       bboxes = array_get(&mbox->backend_boxes, &count);
+       for (i = 0; i < count; i++) {
+               struct mailbox *bbox = bboxes[i]->box;
+
+               if (box->notify_callback == NULL)
+                       mailbox_notify_changes_stop(bbox);
+               else {
+                       mailbox_notify_changes(bbox, box->notify_min_interval,
+                                              virtual_notify_callback, box);
+               }
+       }
 }
 
 static int