From: Maciek Blim Date: Thu, 15 Jan 2015 14:24:20 +0000 (+0100) Subject: [Messaging] tct fixes for sms part 3 X-Git-Tag: submit/tizen_mobile/20150603.064609~1^2~600^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=caa64f397f3433aa28233313a64d0b69a3fd1416;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Messaging] tct fixes for sms part 3 tct: pass: 170 fail: 0 timeout: 12 pass rate: ~94.5% Change-Id: If013a0d9574971025ae25c9d4eae6aa308cdb11d Signed-off-by: Maciek Blim --- diff --git a/src/messaging/change_listener_container.h b/src/messaging/change_listener_container.h index 895d5f7..0598a97 100644 --- a/src/messaging/change_listener_container.h +++ b/src/messaging/change_listener_container.h @@ -130,10 +130,6 @@ class ChangeListenerContainer { itr->second->setActive(false); collection.erase(id); return true; - } else { - LoggerE("Removing callback which does not belong to the current context is not allowed."); - throw common::NotFoundException( - "Removing callback which does not belong to the current context is not allowed."); } return false; } diff --git a/src/messaging/messaging_api.js b/src/messaging/messaging_api.js index 9e566d1..3005e09 100644 --- a/src/messaging/messaging_api.js +++ b/src/messaging/messaging_api.js @@ -180,7 +180,7 @@ function Message(type, data) { folderId: folderId || null, type: type, timestamp: timestamp || null, - from: from || '', + from: from, to: to || [], cc: cc || [], bcc: bcc || [], @@ -250,8 +250,9 @@ function Message(type, data) { return _internal.timestamp ? new Date(_internal.timestamp) : _internal.timestamp; }, set: function (value) { - if (value instanceof InternalValues_) value = value.timestamp; - _internal.timestamp = value; + if (value instanceof InternalValues_) { + _internal.timestamp = value.timestamp; + } }, enumerable: true } @@ -469,7 +470,7 @@ function MessageInit_(data) { this.conversationId = data.conversationId || null; this.folderId = data.folderId || null; this.timestamp = data.timestamp || null; - this.from = data.from || null; + this.from = data.from || ''; this.to = data.to || []; this.cc = data.cc || []; this.bcc = data.bcc || []; diff --git a/src/messaging/messaging_util.cc b/src/messaging/messaging_util.cc index 1fcdb63..fe87e11 100644 --- a/src/messaging/messaging_util.cc +++ b/src/messaging/messaging_util.cc @@ -342,7 +342,7 @@ picojson::value MessagingUtil::messageToJson(std::shared_ptr message) o[MESSAGE_ATTRIBUTE_FROM] = message->is_from_set() ? picojson::value(message->getFrom()) - : picojson::value(); + : picojson::value(std::string("")); std::vector to = message->getTO(); for_each(to.begin(), to.end(), vectorToArray); @@ -409,6 +409,11 @@ picojson::value MessagingUtil::conversationToJson(std::shared_ptr to = conversation->getTo(); + for_each(to.begin(), to.end(), vectorToArray); + o[MESSAGE_ATTRIBUTE_TO] = picojson::value(array); + array.clear(); + switch (conversation->getType()) { case MessageType::SMS: break; @@ -418,11 +423,6 @@ picojson::value MessagingUtil::conversationToJson(std::shared_ptrgetSubject()); - std::vector to = conversation->getTo(); - for_each(to.begin(), to.end(), vectorToArray); - o[MESSAGE_ATTRIBUTE_TO] = picojson::value(array); - array.clear(); - std::vector cc = conversation->getCC(); for_each(cc.begin(), cc.end(), vectorToArray); o[MESSAGE_ATTRIBUTE_CC] = picojson::value(array);