Update change log and spec for wrt-plugins-tizen_0.4.12
[framework/web/wrt-plugins-tizen.git] / src / Messaging / JSMessage.cpp
index af0bb52..96cb6c7 100644 (file)
@@ -597,7 +597,17 @@ JSValueRef JSMessage::getBccAddress(JSContextRef context,
                        {
                                IEmailPtr email = MessageFactory::convertToEmail(msg);
                                RecipientsPtr recipient = email->getBccRecipientsPtr();
-                               return JSRecipientArray::createArray(converter->toJSGlobalContext(object), recipient);
+                               JSObjectRef arrayValue = JSCreateArrayObject(context, 0, NULL);
+                               if (NULL == arrayValue)
+                               {
+                                       LogError("Could not create js array object");
+                                       return JSValueMakeUndefined(context);
+                               }
+                               for(size_t i = 0; i < recipient->getRecipientSize(); i++)
+                               {
+                                       JSSetArrayElement(context, arrayValue, i, converter->toJSValueRef(recipient->getRecipient(i)));
+                               }
+                               return arrayValue;
                        }
                        case SMS:
                        case MMS:
@@ -664,7 +674,17 @@ JSValueRef JSMessage::getCcAddress(JSContextRef context,
                        {
                                IEmailPtr email = MessageFactory::convertToEmail(msg);
                                RecipientsPtr recipient = email->getCcRecipientsPtr();
-                               return JSRecipientArray::createArray(converter->toJSGlobalContext(object), recipient);
+                               JSObjectRef arrayValue = JSCreateArrayObject(context, 0, NULL);
+                               if (NULL == arrayValue)
+                               {
+                                       LogError("Could not create js array object");
+                                       return JSValueMakeUndefined(context);
+                               }
+                               for(size_t i = 0; i < recipient->getRecipientSize(); i++)
+                               {
+                                       JSSetArrayElement(context, arrayValue, i, converter->toJSValueRef(recipient->getRecipient(i)));
+                               }
+                               return arrayValue;
                        }
                        case MMS:
                        case SMS:
@@ -701,7 +721,17 @@ JSValueRef JSMessage::getDestinationAddress(JSContextRef context,
                ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
                IMessagePtr msg = converter->toIMessage(object);
                RecipientsPtr recipient = msg->getToRecipientsPtr();
-               return JSRecipientArray::createArray(converter->toJSGlobalContext(object), recipient);
+               JSObjectRef arrayValue = JSCreateArrayObject(context, 0, NULL);
+               if (NULL == arrayValue)
+               {
+                       LogError("Could not create js array object");
+                       return JSValueMakeUndefined(context);
+               }
+               for(size_t i = 0; i < recipient->getRecipientSize(); i++)
+               {
+                       JSSetArrayElement(context, arrayValue, i, converter->toJSValueRef(recipient->getRecipient(i)));
+               }
+               return arrayValue;
        }
        Catch(WrtDeviceApis::Commons::ConversionException) {
                LogError("Error on conversion");