]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins: push-notification: Reformat push-notification-txn-mbox.c.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sun, 1 Dec 2019 10:32:04 +0000 (11:32 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Feb 2020 12:18:41 +0000 (12:18 +0000)
src/plugins/push-notification/push-notification-txn-mbox.c

index cb9ff35cc85a3cbf53fef261f6f0745bd2683e83..4401819539a6234134a5462c916ef725e68c86e3 100644 (file)
@@ -8,83 +8,83 @@
 #include "push-notification-events.h"
 #include "push-notification-txn-mbox.h"
 
-
 struct push_notification_txn_mbox *
 push_notification_txn_mbox_create(struct push_notification_txn *txn,
-                                  struct mailbox *box)
+                                 struct mailbox *box)
 {
-    if (txn->mbox_txn == NULL) {
-        txn->mbox_txn = p_new(txn->pool, struct push_notification_txn_mbox, 1);
-        txn->mbox_txn->mailbox = mailbox_get_vname(box);
-    }
+       if (txn->mbox_txn == NULL) {
+               txn->mbox_txn = p_new(txn->pool,
+                                     struct push_notification_txn_mbox, 1);
+               txn->mbox_txn->mailbox = mailbox_get_vname(box);
+       }
 
-    return txn->mbox_txn;
+       return txn->mbox_txn;
 }
 
-void
-push_notification_txn_mbox_end(struct push_notification_txn *ptxn)
+void push_notification_txn_mbox_end(struct push_notification_txn *ptxn)
 {
-    struct push_notification_driver_txn **dtxn;
-
-    if (ptxn->mbox_txn != NULL) {
-        array_foreach_modifiable(&ptxn->drivers, dtxn) {
-            if ((*dtxn)->duser->driver->v.process_mbox != NULL) {
-                (*dtxn)->duser->driver->v.process_mbox(*dtxn, ptxn->mbox_txn);
-            }
-        }
-
-        push_notification_txn_mbox_deinit_eventdata(ptxn->mbox_txn);
-    }
+       struct push_notification_driver_txn **dtxn;
+
+       if (ptxn->mbox_txn != NULL) {
+               array_foreach_modifiable(&ptxn->drivers, dtxn) {
+                       if ((*dtxn)->duser->driver->v.process_mbox != NULL) {
+                               (*dtxn)->duser->driver->v.process_mbox(
+                                       *dtxn, ptxn->mbox_txn);
+                       }
+               }
+
+               push_notification_txn_mbox_deinit_eventdata(ptxn->mbox_txn);
+       }
 }
 
 void *
-push_notification_txn_mbox_get_eventdata(struct push_notification_txn_mbox *mbox,
-                                         const char *event_name)
+push_notification_txn_mbox_get_eventdata(
+       struct push_notification_txn_mbox *mbox, const char *event_name)
 {
-    struct push_notification_txn_event **mevent;
-
-    if (array_is_created(&mbox->eventdata)) {
-        array_foreach_modifiable(&mbox->eventdata, mevent) {
-            if (strcmp((*mevent)->event->event->name, event_name) == 0) {
-                return (*mevent)->data;
-            }
-        }
-    }
-
-    return NULL;
+       struct push_notification_txn_event **mevent;
+
+       if (array_is_created(&mbox->eventdata)) {
+               array_foreach_modifiable(&mbox->eventdata, mevent) {
+                       if (strcmp((*mevent)->event->event->name,
+                                  event_name) == 0) {
+                               return (*mevent)->data;
+                       }
+               }
+       }
+
+       return NULL;
 }
 
-void
-push_notification_txn_mbox_set_eventdata(struct push_notification_txn *txn,
-                                         struct push_notification_txn_mbox *mbox,
-                                         struct push_notification_event_config *event,
-                                         void *data)
+void push_notification_txn_mbox_set_eventdata(
+       struct push_notification_txn *txn,
+       struct push_notification_txn_mbox *mbox,
+       struct push_notification_event_config *event, void *data)
 {
-    struct push_notification_txn_event *mevent;
+       struct push_notification_txn_event *mevent;
 
-    if (!array_is_created(&mbox->eventdata)) {
-        p_array_init(&mbox->eventdata, txn->pool, 4);
-    }
+       if (!array_is_created(&mbox->eventdata)) {
+               p_array_init(&mbox->eventdata, txn->pool, 4);
+       }
 
-    mevent = p_new(txn->pool, struct push_notification_txn_event, 1);
-    mevent->data = data;
-    mevent->event = event;
+       mevent = p_new(txn->pool, struct push_notification_txn_event, 1);
+       mevent->data = data;
+       mevent->event = event;
 
-    array_push_back(&mbox->eventdata, &mevent);
+       array_push_back(&mbox->eventdata, &mevent);
 }
 
-void
-push_notification_txn_mbox_deinit_eventdata
-(struct push_notification_txn_mbox *mbox)
+void push_notification_txn_mbox_deinit_eventdata(
+       struct push_notification_txn_mbox *mbox)
 {
-    struct push_notification_txn_event **mevent;
-
-    if (array_is_created(&mbox->eventdata)) {
-        array_foreach_modifiable(&mbox->eventdata, mevent) {
-            if (((*mevent)->data != NULL) &&
-                ((*mevent)->event->event->mbox.free_mbox != NULL)) {
-                (*mevent)->event->event->mbox.free_mbox(*mevent);
-            }
-        }
-    }
+       struct push_notification_txn_event **mevent;
+
+       if (array_is_created(&mbox->eventdata)) {
+               array_foreach_modifiable(&mbox->eventdata, mevent) {
+                       if (((*mevent)->data != NULL) &&
+                           ((*mevent)->event->event->mbox.free_mbox != NULL)) {
+                               (*mevent)->event->event->mbox.free_mbox(
+                                       *mevent);
+                       }
+               }
+       }
 }