bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#ifndef PUSH_NOTIFICATION_TRIGGERS_H
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#define PUSH_NOTIFICATION_TRIGGERS_H
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#include "mail-types.h"
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct mail;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct mailbox;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn_mbox;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzstruct push_notification_txn_msg;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzenum push_notification_event_trigger {
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_NONE,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Mailbox actions */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MBOX_CREATE = 0x001,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MBOX_DELETE = 0x002,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MBOX_RENAME = 0x004,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MBOX_SUBSCRIBE = 0x008,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz /* Message actions */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MSG_SAVE_NEW = 0x010,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MSG_SAVE_APPEND = 0x020,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MSG_EXPUNGE = 0x040,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MSG_FLAGCHANGE = 0x080,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz PUSH_NOTIFICATION_EVENT_TRIGGER_MSG_KEYWORDCHANGE = 0x100,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz};
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz/* Mailbox actions. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_mbox_create(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mailbox *box,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_mbox *mbox);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_mbox_delete(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mailbox *box,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_mbox *mbox);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_mbox_rename(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mailbox *src,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mailbox *dest,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_mbox *mbox);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_mbox_subscribe(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mailbox *box,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz bool subscribed,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_mbox *mbox);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz/* Message actions. */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_msg_save_new(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_msg_save_append(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_msg_save_expunge(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_msg_flag_change(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz enum mail_flags old_flags);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzpush_notification_trigger_msg_keyword_change(struct push_notification_txn *txn,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct mail *mail,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz struct push_notification_txn_msg *msg,
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz const char *const *old_keywords);
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#endif /* PUSH_NOTIFICATION_TRIGGERS_H */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz