From: Stephan Bosch Date: Sun, 1 Dec 2019 10:29:23 +0000 (+0100) Subject: plugins: push-notification: Reformat push-notification-event-messageread.c. X-Git-Tag: 2.3.10~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dec6480c28e690915926dfb9c1e4f3d39a0928bc;p=thirdparty%2Fdovecot%2Fcore.git plugins: push-notification: Reformat push-notification-event-messageread.c. --- diff --git a/src/plugins/push-notification/push-notification-event-messageread.c b/src/plugins/push-notification/push-notification-event-messageread.c index 9a43adfeed..8f0d709923 100644 --- a/src/plugins/push-notification/push-notification-event-messageread.c +++ b/src/plugins/push-notification/push-notification-event-messageread.c @@ -9,50 +9,50 @@ #include "push-notification-event-messageread.h" #include "push-notification-txn-msg.h" - #define EVENT_NAME "MessageRead" - -static void push_notification_event_messageread_debug_msg -(struct push_notification_txn_event *event ATTR_UNUSED) +static void +push_notification_event_messageread_debug_msg( + struct push_notification_txn_event *event ATTR_UNUSED) { - i_debug("%s: Message was flagged as seen", EVENT_NAME); + i_debug("%s: Message was flagged as seen", EVENT_NAME); } -static void push_notification_event_messageread_event( - struct push_notification_txn *ptxn, - struct push_notification_event_config *ec, - struct push_notification_txn_msg *msg, - struct mail *mail, - enum mail_flags old_flags) +static void +push_notification_event_messageread_event( + struct push_notification_txn *ptxn, + struct push_notification_event_config *ec, + struct push_notification_txn_msg *msg, struct mail *mail, + enum mail_flags old_flags) { - struct push_notification_event_messageread_data *data; - enum mail_flags flags; - - /* If data struct exists, that means the read flag was changed. */ - data = push_notification_txn_msg_get_eventdata(msg, EVENT_NAME); - if ((data == NULL) && (old_flags & MAIL_SEEN) == 0) { - flags = mail_get_flags(mail); - if ((flags & MAIL_SEEN) != 0) { - data = p_new(ptxn->pool, - struct push_notification_event_messageread_data, 1); - data->read = TRUE; - push_notification_txn_msg_set_eventdata(ptxn, msg, ec, data); - } - } + struct push_notification_event_messageread_data *data; + enum mail_flags flags; + + /* If data struct exists, that means the read flag was changed. */ + data = push_notification_txn_msg_get_eventdata(msg, EVENT_NAME); + if ((data == NULL) && (old_flags & MAIL_SEEN) == 0) { + flags = mail_get_flags(mail); + if ((flags & MAIL_SEEN) != 0) { + data = p_new( + ptxn->pool, + struct push_notification_event_messageread_data, 1); + data->read = TRUE; + push_notification_txn_msg_set_eventdata( + ptxn, msg, ec, data); + } + } } - /* Event definition */ extern struct push_notification_event push_notification_event_messageread; struct push_notification_event push_notification_event_messageread = { - .name = EVENT_NAME, - .msg = { - .debug_msg = push_notification_event_messageread_debug_msg - }, - .msg_triggers = { - .flagchange = push_notification_event_messageread_event - } + .name = EVENT_NAME, + .msg = { + .debug_msg = push_notification_event_messageread_debug_msg, + }, + .msg_triggers = { + .flagchange = push_notification_event_messageread_event, + }, };