bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#ifndef PUSH_NOTIFICATION_TXN_MSG_H
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#define PUSH_NOTIFICATION_TXN_MSG_H
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct mail_transaction_commit_changes;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_event_config;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn_event;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn_msg {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz const char *mailbox;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz uint32_t uid;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz uint32_t uid_validity;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz ARRAY(struct push_notification_txn_event *) eventdata;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Private */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz unsigned int seq;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz};
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn_msg *
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_txn_msg_create(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_txn_msg_end(struct push_notification_txn *ptxn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail_transaction_commit_changes *changes);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid *
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_txn_msg_get_eventdata(struct push_notification_txn_msg *msg,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz const char *event_name);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_txn_msg_set_eventdata(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_event_config *event,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz void *data);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_txn_msg_deinit_eventdata(struct push_notification_txn_msg *msg);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#endif /* PUSH_NOTIFICATION_TXN_MSG_H */