From 8b02da100316d0f929224c1b41903f3a2972cecd Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sun, 1 Dec 2019 11:32:04 +0100 Subject: [PATCH] plugins: push-notification: Reformat push-notification-txn-mbox.c. --- .../push-notification-txn-mbox.c | 118 +++++++++--------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/src/plugins/push-notification/push-notification-txn-mbox.c b/src/plugins/push-notification/push-notification-txn-mbox.c index cb9ff35cc8..4401819539 100644 --- a/src/plugins/push-notification/push-notification-txn-mbox.c +++ b/src/plugins/push-notification/push-notification-txn-mbox.c @@ -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); + } + } + } } -- 2.47.3