From 100f31be81afc31ba5e58a4ee9b9891971bf0fca Mon Sep 17 00:00:00 2001 From: Aziz Khoury Date: Sat, 13 Dec 2014 08:19:49 -0500 Subject: [PATCH] adding mid on the message returned data on addMessage --- src/messaging.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/messaging.js b/src/messaging.js index 9e9495337e..980dc13e86 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -74,8 +74,14 @@ var db = require('./database'), if (err) { return next(err); } + + if (!messages || !messages[0]) { + return next(null, null); + } + messages[0].newSet = isNewSet; - next(null, messages ? messages[0] : null); + messages[0].mid = mid; + next(null, messages[0]); }); } ], callback);