summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOhyoun Kwon <sirot.kwon@samsung.com>2013-11-07 22:40:32 +0900
committerOhyoun Kwon <sirot.kwon@samsung.com>2013-11-07 22:40:32 +0900
commit95b91d978c1da10598746bdf7936f367a13869fa (patch)
tree44f24aa6031c01b6bf67997f2154741d6adbc2ff
parent0060763de7e46f196fe67f09a9424f810fe274f0 (diff)
downloadwrt-plugins-tizen-accepted/tizen/2.2/main.tar.gz
wrt-plugins-tizen-accepted/tizen/2.2/main.tar.bz2
wrt-plugins-tizen-accepted/tizen/2.2/main.zip
[model] REDWOOD [binary_type] PDA [customer] OPEN [Messaging] Fix Messaging TCT blocking case [Issue] N/A [Problem] Fix Messaging TCT blocking case [Cause] msg thread list length zero [Solution] check thread list length Change-Id: I1ead994d9cf577cfdfe063483eb2bbd0d10ca8a9
-rwxr-xr-xpackaging/wrt-plugins-tizen.spec2
-rwxr-xr-xsrc/Calendar/CalendarConverter.cpp21
-rwxr-xr-xsrc/Calendar/JSCalendar.cpp20
-rw-r--r--src/Messaging/Conversation.cpp25
4 files changed, 54 insertions, 14 deletions
diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec
index 4a4eb02..c1b78fd 100755
--- a/packaging/wrt-plugins-tizen.spec
+++ b/packaging/wrt-plugins-tizen.spec
@@ -1,6 +1,6 @@
Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.79
+Version: 0.4.80
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
diff --git a/src/Calendar/CalendarConverter.cpp b/src/Calendar/CalendarConverter.cpp
index 90909eb..9c82b2f 100755
--- a/src/Calendar/CalendarConverter.cpp
+++ b/src/Calendar/CalendarConverter.cpp
@@ -811,7 +811,26 @@ CalendarEventPtr CalendarConverter::toItem(const JSValueRef value, bool updateMo
if(updateMode) {
LoggerD("Update mode.");
- result = JSCalendarEvent::getPrivateObject(arg);
+ Try
+ {
+ if (CalendarEvent::EVENT_TYPE==m_calendarType) {
+ if (!JSValueIsObjectOfClass(m_context, value, JSCalendarEvent::getClassRef())) {
+ ThrowMsg(ConversionException, "Wrong calendar item type.");
+ }
+ } else if (CalendarEvent::TASK_TYPE==m_calendarType) {
+ if (!JSValueIsObjectOfClass(m_context, value, JSCalendarTask::getClassRef())) {
+ ThrowMsg(ConversionException, "Wrong calendar item type.");
+ }
+ } else {
+ ThrowMsg(ConversionException, "Wrong calendar type.");
+ }
+
+ result = JSCalendarEvent::getPrivateObject(arg);
+ }
+ Catch(Exception)
+ {
+ ThrowMsg(ConversionException, "Wrong calendar item type.");
+ }
} else {
LoggerD("Constructor mode.");
CalendarEventPtr resultPtr(new CalendarEvent());
diff --git a/src/Calendar/JSCalendar.cpp b/src/Calendar/JSCalendar.cpp
index da314bf..f30f12e 100755
--- a/src/Calendar/JSCalendar.cpp
+++ b/src/Calendar/JSCalendar.cpp
@@ -178,7 +178,7 @@ JSValueRef JSCalendar::add(JSContextRef context,
ThrowMsg(ConversionException, "Wrong calendar type.");
}
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
CalendarEventPtr item = converter.toItem(arguments[0], true);
if (!item) {
@@ -242,7 +242,7 @@ JSValueRef JSCalendar::addBatch(JSContextRef context,
ICalendarPtr calendar = getCalendar(context, thisObject, NULL);
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (argumentCount<1) {
ThrowMsg(ConversionException, "Wrong parameter type.");
@@ -336,7 +336,7 @@ JSValueRef JSCalendar::update(JSContextRef context,
ThrowMsg(ConversionException, "Wrong first parameter type.");
}
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
CalendarEventPtr item = converter.toItem(arguments[0], true);
if (!item) {
@@ -411,7 +411,7 @@ JSValueRef JSCalendar::updateBatch(JSContextRef context,
ICalendarPtr calendar = getCalendar(context, thisObject, exception);
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (argumentCount>=1) {
if (!JSIsArrayValue(context, arguments[0])) {
@@ -504,7 +504,7 @@ JSValueRef JSCalendar::remove(JSContextRef context,
ICalendarPtr calendar = getCalendar(context, thisObject, exception);
EventIdPtr itemId;
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (CalendarEvent::EVENT_TYPE==calendar->getType()) {
if (argumentCount<1) {
@@ -596,7 +596,7 @@ JSValueRef JSCalendar::removeBatch(JSContextRef context,
ICalendarPtr calendar = getCalendar(context, thisObject, exception);
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (argumentCount>=1) {
if (!JSIsArrayValue(context, arguments[0])) {
@@ -711,7 +711,7 @@ JSValueRef JSCalendar::find(JSContextRef context,
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
Validator validator(context, exception);
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
CalendarFilterConverterFactory::ConverterType filterConverter =
CalendarFilterConverterFactory::ConverterType(new CalendarFilterConverter(context));
@@ -823,7 +823,7 @@ JSValueRef JSCalendar::get(JSContextRef context,
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
EventIdPtr itemId;
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (CalendarEvent::EVENT_TYPE==calendar->getType()) {
if (argumentCount<1) {
ThrowMsg(ConversionException, "Wrong parameter type.");
@@ -923,7 +923,7 @@ JSValueRef JSCalendar::addChangeListener(JSContextRef context,
ICalendarPtr calendar = getCalendar(context, thisObject, exception);
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (argumentCount>=1) {
if (!JSValueIsObject(context, arguments[0])) {
@@ -1041,7 +1041,7 @@ JSValueRef JSCalendar::removeChangeListener(JSContextRef context,
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
long watchId = -1;
- CalendarConverter converter(context);
+ CalendarConverter converter(context, calendar->getType());
if (argumentCount>=1) {
watchId = converter.toLong(arguments[0]);
} else {
diff --git a/src/Messaging/Conversation.cpp b/src/Messaging/Conversation.cpp
index effe4a3..9af7c58 100644
--- a/src/Messaging/Conversation.cpp
+++ b/src/Messaging/Conversation.cpp
@@ -595,6 +595,11 @@ bool Conversation::makeConversationFromMsgId(unsigned int msgId, MessageType msg
// m_messageCount = convViewList.nCount;
// lastMsgIndex = msgList.nCount - 1; // on msg_get_conversation_view_list last is recent message but msg_get_message_list first is recent message
m_messageCount = msgList.nCount;
+ if(m_messageCount == 0)
+ {
+ m_result = false;
+ ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "msg_get_message_list not found" );
+ }
LoggerD("m_messageCount : " << m_messageCount);
// get thread read status
@@ -682,6 +687,16 @@ bool Conversation::makeConversationFromMsgId(unsigned int msgId, MessageType msg
LoggerD("m_subject : " << m_subject);
}
+ catch (const WrtDeviceApis::Commons::NotFoundException& ex)
+ {
+ LoggerE("Exception: " << ex.GetMessage());
+ msg_release_list_struct(&msgList);
+ msg_release_struct(&msgInfo);
+ msg_release_struct(&sendOpt);
+ msg_release_struct(&msg_thread);
+ LoggerE("m_result: " << m_result);
+ return !m_result;
+ }
catch (const WrtDeviceApis::Commons::UnknownException& ex)
{
m_result = false;
@@ -715,9 +730,15 @@ bool Conversation::makeConversationFromEmailThreadId(unsigned int emailTreadId)
try
{
- // Todo : will be re-implemented as using email_get_thread_information_ex
- if(email_get_thread_information_ex(emailTreadId, &resultMail) != EMAIL_ERROR_NONE)
+ // Todo : will be re-implemented as using email_get_thread_information_ex
+ err = email_get_thread_information_ex(emailTreadId, &resultMail);
+ if(err != EMAIL_ERROR_NONE)
{
+ if(err == EMAIL_ERROR_MAIL_NOT_FOUND)
+ {
+ m_result = false;
+ ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "email_get_thread_information_ex not found" );
+ }
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "email_get_thread_information_ex fail" );
}