{
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:
{
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:
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");