dovecot-2.2: push-notification: Fix distinguishing between IMAP ...

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 1 09:28:31 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/39ae1789ba74
changeset: 19260:39ae1789ba74
user:      Michael Slusarz <michael.slusarz at dovecot.fi>
date:      Wed Sep 30 17:43:20 2015 -0600
description:
push-notification: Fix distinguishing between IMAP APPEND and MTA deliveries

diffstat:

 src/plugins/push-notification/push-notification-plugin.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (32 lines):

diff -r 2ceca0becf8e -r 39ae1789ba74 src/plugins/push-notification/push-notification-plugin.c
--- a/src/plugins/push-notification/push-notification-plugin.c	Wed Sep 30 18:50:09 2015 +0300
+++ b/src/plugins/push-notification/push-notification-plugin.c	Wed Sep 30 17:43:20 2015 -0600
@@ -141,13 +141,13 @@
 
 static void push_notification_mail_save(void *txn, struct mail *mail)
 {
-    struct push_notification_txn *ptxn = (struct push_notification_txn *)txn;
+    struct push_notification_txn *ptxn = txn;
 
-    /* External means a COPY or APPEND IMAP action. */
-    if (ptxn->t->flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) {
+    /* POST_SESSION means MTA delivery. */
+    if (mail->box->flags & MAILBOX_FLAG_POST_SESSION) {
+        push_notification_trigger_msg_save_new(ptxn, mail, NULL);
+    } else {
         push_notification_trigger_msg_save_append(ptxn, mail, NULL);
-    } else {
-        push_notification_trigger_msg_save_new(ptxn, mail, NULL);
     }
 }
 
@@ -155,8 +155,7 @@
                                         struct mail *src ATTR_UNUSED,
                                         struct mail *dest)
 {
-    push_notification_trigger_msg_save_append(
-            (struct push_notification_txn *)txn, dest, NULL);
+    push_notification_mail_save(txn, dest);
 }
 
 static void push_notification_mail_expunge(void *txn, struct mail *mail)


More information about the dovecot-cvs mailing list