From: Aki Tuomi Date: Fri, 28 Sep 2018 10:01:58 +0000 (+0300) Subject: push-notification: Make sure txn messages are unique X-Git-Tag: 2.3.9~1364 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=189ba69d5fbde29419d820baef1be39f93858011;p=thirdparty%2Fdovecot%2Fcore.git push-notification: Make sure txn messages are unique save_count is not reliable as it's not incremented for events like flag changes. --- diff --git a/src/plugins/push-notification/push-notification-txn-msg.c b/src/plugins/push-notification/push-notification-txn-msg.c index 8d8c3e37c6..b8cb552bf6 100644 --- a/src/plugins/push-notification/push-notification-txn-msg.c +++ b/src/plugins/push-notification/push-notification-txn-msg.c @@ -17,7 +17,7 @@ push_notification_txn_msg_create(struct push_notification_txn *txn, if (hash_table_is_created(txn->messages)) { msg = hash_table_lookup(txn->messages, - POINTER_CAST(txn->t->save_count + 1)); + POINTER_CAST(mail->seq)); } else { hash_table_create_direct(&txn->messages, txn->pool, 4); } @@ -29,7 +29,7 @@ push_notification_txn_msg_create(struct push_notification_txn *txn, msg->seq = txn->t->save_count; msg->uid = mail->uid; - hash_table_insert(txn->messages, POINTER_CAST(txn->t->save_count + 1), + hash_table_insert(txn->messages, POINTER_CAST(mail->seq), msg); }