From 027b0a67b91f27178930e6d29f67f05c5ae0961b Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Tue, 8 Jan 2019 23:27:03 +0200 Subject: [PATCH] v1.12.3 --- lib/api/messages.js | 19 +++++++++++++++---- lib/message-handler.js | 1 + package.json | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/api/messages.js b/lib/api/messages.js index 734ca5af..c3808719 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -2630,19 +2630,26 @@ module.exports = (db, server, messageHandler, userHandler) => { * * @apiSuccess {Boolean} success Indicates successful response * @apiSuccess {String} queueId Message ID in outbound queue + * @apiSuccess {Object} [message] Information about submitted Message + * @apiSuccess {String} message.mailbox Mailbox ID the draft was moved to (usually Sent mail) + * @apiSuccess {Number} message.id Message ID in Mailbox * * @apiError error Description of the error * - * @apiExample {curl} Forward a Message: + * @apiExample {curl} Submit a Message: * curl -i -XPOST "http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit" \ * -H 'Content-type: application/json' \ * -d '{}' * - * @apiSuccessExample {json} Forward Response: + * @apiSuccessExample {json} Submit Response: * HTTP/1.1 200 OK * { * "success": true, - * "id": "1600d2f36470008b72" + * "queueId": "1682f5a712f000dfb6", + * "message": { + * "id": 3, + * "mailbox": "5c279b4e17abae166446f968" + * } * } * * @apiErrorExample {json} Error-Response: @@ -2807,7 +2814,11 @@ module.exports = (db, server, messageHandler, userHandler) => { }, messageQuery: messageData.uid }); - response.sent = moved.info; + + response.message = { + id: moved.info && moved.info.destinationUid && moved.info.destinationUid[0], + mailbox: moved.info && moved.info.target + }; } if (messageData.meta.reference) { diff --git a/lib/message-handler.js b/lib/message-handler.js index 11e1bf1e..291ac38e 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -691,6 +691,7 @@ class MessageHandler { sourceUid, destinationUid, mailbox: mailboxData._id, + target: targetData._id, status: 'moved' }); }; diff --git a/package.json b/package.json index 35d0c37a..7ad513d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.12.2", + "version": "1.12.3", "description": "IMAP/POP3 server built with Node.js and MongoDB", "main": "server.js", "scripts": {