bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#include "lib.h"
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#include "push-notification-events.h"
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz#include "push-notification-events-rfc5423.h"
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz/* These are the RFC 5423 Mail Store Events currently handled within the core
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * push-notification code.
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz *
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * @todo: These events are not currently handled:
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * - Login
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * - Logout
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * - QuotaExceed
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz * - Quota Within
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_flagsclear;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_flagsset;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_mailboxcreate;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_mailboxdelete;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_mailboxrename;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_mailboxsubscribe;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_mailboxunsubscribe;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_messageappend;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_messageexpunge;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_messagenew;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_messageread;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzextern struct push_notification_event push_notification_event_messagetrash;
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainenstatic struct push_notification_event *rfc5423_events[] = {
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_flagsclear,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_flagsset,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_mailboxcreate,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_mailboxdelete,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_mailboxrename,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_mailboxsubscribe,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_mailboxunsubscribe,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_messageappend,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_messageexpunge,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_messagenew,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_messageread,
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen &push_notification_event_messagetrash
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen};
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarzvoid push_notification_event_register_rfc5423_events(void)
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz{
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen unsigned int i;
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen for (i = 0; i < N_ELEMENTS(rfc5423_events); i++)
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen push_notification_event_register(rfc5423_events[i]);
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen}
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainenvoid push_notification_event_unregister_rfc5423_events(void)
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen{
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen unsigned int i;
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen for (i = 0; i < N_ELEMENTS(rfc5423_events); i++)
da2423165d31474f5384833fdaa6dc4c0cee28f4Timo Sirainen push_notification_event_unregister(rfc5423_events[i]);
9366a287ae1bafa03f815e6f17d0c3891368e263Timo Sirainen}