ctx->event = log_event;
*context = ctx;
- i_debug("Called init push_notification plugin hook.");
-
+ e_debug(log_event, "Called init push_notification plugin hook.");
if (config->raw_config != NULL) {
- i_debug("Config string for dlog push_notification driver: %s",
+ e_debug(log_event,
+ "Config string for dlog push_notification driver: %s",
config->raw_config);
}
tctx->event = log_event;
dtxn->context = tctx;
- const struct push_notification_event *event;
-
- i_debug("Called begin_txn push_notification plugin hook.");
+ e_debug(log_event, "Called begin_txn push_notification plugin hook.");
+ const struct push_notification_event *event;
array_foreach_elem(&push_notification_events, event)
push_notification_event_init(dtxn, event->name, NULL, log_event);
return TRUE;
static void
push_notification_driver_dlog_process_mbox(
- struct push_notification_driver_txn *dtxn ATTR_UNUSED,
+ struct push_notification_driver_txn *dtxn,
struct push_notification_txn_mbox *mbox)
{
- struct push_notification_txn_event *event;
-
- i_debug("Called process_mbox push_notification plugin hook.");
-
- i_debug("Mailbox data: Mailbox [%s]", mbox->mailbox);
+ struct dlog_push_notification_txn_context *tctx = dtxn->context;
+ e_debug(tctx->event, "Called process_mbox push_notification plugin hook.");
+ e_debug(tctx->event, "Mailbox data: Mailbox [%s]", mbox->mailbox);
+ struct push_notification_txn_event *event;
if (array_is_created(&mbox->eventdata)) {
array_foreach_elem(&mbox->eventdata, event) {
if (event->event->event->mbox.debug_mbox != NULL)
struct push_notification_driver_txn *dtxn ATTR_UNUSED,
struct push_notification_txn_msg *msg)
{
- struct push_notification_txn_event *event;
-
- i_debug("Called process_msg push_notification plugin hook.");
-
- i_debug("Message data: Mailbox [%s], UID [%u], UIDVALIDITY [%u]",
+ struct dlog_push_notification_txn_context *tctx = dtxn->context;
+ e_debug(tctx->event, "Called process_msg push_notification plugin hook.");
+ e_debug(tctx->event, "Message data: Mailbox [%s], UID [%u], UIDVALIDITY [%u]",
msg->mailbox, msg->uid, msg->uid_validity);
+ struct push_notification_txn_event *event;
if (array_is_created(&msg->eventdata)) {
array_foreach_elem(&msg->eventdata, event) {
if (event->event->event->msg.debug_msg != NULL)
struct push_notification_driver_txn *dtxn,
bool success ATTR_UNUSED)
{
- i_debug("Called end_txn push_notification plugin hook.");
struct dlog_push_notification_txn_context *tctx = dtxn->context;
+ e_debug(tctx->event, "Called end_txn push_notification plugin hook.");
event_unref(&tctx->event);
}
push_notification_driver_dlog_deinit(
struct push_notification_driver_user *duser)
{
- i_debug("Called deinit push_notification plugin hook.");
struct dlog_push_notification_context *ctx = duser->context;
+ e_debug(ctx->event, "Called deinit push_notification plugin hook.");
event_unref(&ctx->event);
}
driver = push_notification_driver_find_class(driver_name);
if (driver == NULL) {
- i_error("Unknown push notification driver: %s", driver_name);
+ e_error(user->event,
+ "Unknown push notification driver: %s", driver_name);
return -1;
}
ret = driver->v.init(config, user, pool,
&context, &error_r);
if (ret < 0)
- i_error("%s: %s", driver_name, error_r);
+ e_error(user->event, "%s: %s",
+ driver_name, error_r);
hash_table_destroy(&config->config);
} T_END;
push_notification_event_flagsclear_debug_msg(
struct push_notification_txn_event *event)
{
+ struct event *log_event = event->event->log_event;
struct push_notification_event_flagsclear_data *data = event->data;
const char *keyword;
if ((data->flags_clear & MAIL_ANSWERED) != 0)
- i_debug("%s: Answered flag cleared", EVENT_NAME);
+ e_debug(log_event, "%s: Answered flag cleared", EVENT_NAME);
if ((data->flags_clear & MAIL_FLAGGED) != 0)
- i_debug("%s: Flagged flag cleared", EVENT_NAME);
+ e_debug(log_event, "%s: Flagged flag cleared", EVENT_NAME);
if ((data->flags_clear & MAIL_DELETED) != 0)
- i_debug("%s: Deleted flag cleared", EVENT_NAME);
+ e_debug(log_event, "%s: Deleted flag cleared", EVENT_NAME);
if ((data->flags_clear & MAIL_SEEN) != 0)
- i_debug("%s: Seen flag cleared", EVENT_NAME);
+ e_debug(log_event, "%s: Seen flag cleared", EVENT_NAME);
if ((data->flags_clear & MAIL_DRAFT) != 0)
- i_debug("%s: Draft flag cleared", EVENT_NAME);
+ e_debug(log_event, "%s: Draft flag cleared", EVENT_NAME);
array_foreach_elem(&data->keywords_clear, keyword)
- i_debug("%s: Keyword clear [%s]", EVENT_NAME, keyword);
+ e_debug(log_event, "%s: Keyword clear [%s]", EVENT_NAME, keyword);
}
static struct push_notification_event_flagsclear_data *
push_notification_event_flagsset_debug_msg(
struct push_notification_txn_event *event)
{
+ struct event *log_event = event->event->log_event;
struct push_notification_event_flagsset_data *data = event->data;
const char *keyword;
if ((data->flags_set & MAIL_ANSWERED) != 0)
- i_debug("%s: Answered flag set", EVENT_NAME);
+ e_debug(log_event, "%s: Answered flag set", EVENT_NAME);
if ((data->flags_set & MAIL_FLAGGED) != 0)
- i_debug("%s: Flagged flag set", EVENT_NAME);
+ e_debug(log_event, "%s: Flagged flag set", EVENT_NAME);
if ((data->flags_set & MAIL_DELETED) != 0)
- i_debug("%s: Deleted flag set", EVENT_NAME);
+ e_debug(log_event, "%s: Deleted flag set", EVENT_NAME);
if ((data->flags_set & MAIL_SEEN) != 0)
- i_debug("%s: Seen flag set", EVENT_NAME);
+ e_debug(log_event, "%s: Seen flag set", EVENT_NAME);
if ((data->flags_set & MAIL_DRAFT) != 0)
- i_debug("%s: Draft flag set", EVENT_NAME);
+ e_debug(log_event, "%s: Draft flag set", EVENT_NAME);
array_foreach_elem(&data->keywords_set, keyword)
- i_debug("%s: Keyword set [%s]", EVENT_NAME, keyword);
+ e_debug(log_event, "%s: Keyword set [%s]", EVENT_NAME, keyword);
}
static struct push_notification_event_flagsset_data *
static void
push_notification_event_mailboxcreate_debug_mbox(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Mailbox was created", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Mailbox was created", EVENT_NAME);
}
static void
struct mailbox_status status;
if (mailbox_get_status(ptxn->mbox, STATUS_UIDVALIDITY, &status) < 0) {
- i_error(EVENT_NAME
+ e_error(ptxn->muser->event,
+ EVENT_NAME
"Failed to get created mailbox '%s' uidvalidity: %s",
mailbox_get_vname(ptxn->mbox),
mailbox_get_last_internal_error(ptxn->mbox, NULL));
static void
push_notification_event_mailboxdelete_debug_mbox(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Mailbox was deleted", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Mailbox was deleted", EVENT_NAME);
}
static void
struct push_notification_txn_event *event)
{
struct push_notification_event_mailboxrename_data *data = event->data;
+ struct event *log_event = event->event->log_event;
- i_debug("%s: Mailbox was renamed (old name: %s)",
+ e_debug(log_event, "%s: Mailbox was renamed (old name: %s)",
EVENT_NAME, data->old_mbox);
}
static void
push_notification_event_mailboxsubscribe_debug_mbox(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Mailbox was subscribed to", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Mailbox was subscribed to", EVENT_NAME);
}
static void
static void
push_notification_event_mailboxunsubscribe_debug_mbox(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Mailbox was subscribed to", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Mailbox was subscribed to", EVENT_NAME);
}
static void
push_notification_event_messageappend_debug_msg(
struct push_notification_txn_event *event)
{
+ struct event *log_event = event->event->log_event;
struct push_notification_event_messageappend_data *data = event->data;
struct tm *tm;
if (data->date != -1) {
tm = gmtime(&data->date);
- i_debug("%s: Date [%s]", EVENT_NAME,
+ e_debug(log_event, "%s: Date [%s]", EVENT_NAME,
iso8601_date_create_tm(tm, data->date_tz));
}
if (data->from != NULL)
- i_debug("%s: From [%s]", EVENT_NAME, data->from);
+ e_debug(log_event, "%s: From [%s]", EVENT_NAME, data->from);
if (data->snippet != NULL)
- i_debug("%s: Snippet [%s]", EVENT_NAME, data->snippet);
+ e_debug(log_event, "%s: Snippet [%s]", EVENT_NAME, data->snippet);
if (data->subject != NULL)
- i_debug("%s: Subject [%s]", EVENT_NAME, data->subject);
+ e_debug(log_event, "%s: Subject [%s]", EVENT_NAME, data->subject);
if (data->to != NULL)
- i_debug("%s: To [%s]", EVENT_NAME, data->to);
+ e_debug(log_event, "%s: To [%s]", EVENT_NAME, data->to);
}
static void
push_notification_event_messageexpunge_debug_msg(
struct push_notification_txn_event *event)
{
+ struct event *log_event = event->event->log_event;
struct push_notification_event_messageexpunge_data *data = event->data;
if (data != NULL)
- i_debug("%s: Message was expunged", EVENT_NAME);
+ e_debug(log_event, "%s: Message was expunged", EVENT_NAME);
}
static void
push_notification_event_messagenew_debug_msg(
struct push_notification_txn_event *event)
{
+ struct event *log_event = event->event->log_event;
struct push_notification_event_messagenew_data *data = event->data;
struct tm *tm;
if (data->date != -1) {
tm = gmtime(&data->date);
- i_debug("%s: Date [%s]", EVENT_NAME,
+ e_debug(log_event, "%s: Date [%s]", EVENT_NAME,
iso8601_date_create_tm(tm, data->date_tz));
}
if (data->from != NULL)
- i_debug("%s: From [%s]", EVENT_NAME, data->from);
+ e_debug(log_event, "%s: From [%s]", EVENT_NAME, data->from);
if (data->snippet != NULL)
- i_debug("%s: Snippet [%s]", EVENT_NAME, data->snippet);
+ e_debug(log_event, "%s: Snippet [%s]", EVENT_NAME, data->snippet);
if (data->subject != NULL)
- i_debug("%s: Subject [%s]", EVENT_NAME, data->subject);
+ e_debug(log_event, "%s: Subject [%s]", EVENT_NAME, data->subject);
if (data->to != NULL)
- i_debug("%s: To [%s]", EVENT_NAME, data->to);
+ e_debug(log_event, "%s: To [%s]", EVENT_NAME, data->to);
}
static void
static void
push_notification_event_messageread_debug_msg(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Message was flagged as seen", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Message was flagged as seen", EVENT_NAME);
}
static void
static void
push_notification_event_messagetrash_debug_msg(
- struct push_notification_txn_event *event ATTR_UNUSED)
+ struct push_notification_txn_event *event)
{
- i_debug("%s: Message was marked as deleted", EVENT_NAME);
+ struct event *log_event = event->event->log_event;
+ e_debug(log_event, "%s: Message was marked as deleted", EVENT_NAME);
}
static void