// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <ctype.h>
#include "message_attachment.h"
#include "common/logger.h"
void MessageAttachment::setFilePath(const std::string &value)
{
- m_filePath = value;
+ std::string tmp = value;
+ // change to lower case
+ for (int i = 0; i < tmp.length() && i < 4; i++) {
+ tmp[i] = tolower(tmp[i]);
+ }
+ if (tmp.find("file://") != std::string::npos) {
+ m_filePath = value.substr(7);
+ } else {
+ m_filePath = value;
+ }
m_isFilePathSet = true;
}
var validator_ = xwalk.utils.validator;
var types_ = validator_.Types;
+var T_ = xwalk.utils.type;
var bridge = xwalk.utils.NativeBridge(extension, true);
function throwException_(err) {
if (value.length < _internal.length) {
_internal.splice(value.length, _internal.length - value.length);
}
- } else {
+ _internal.attachments = value;
+ } else if (T_.isArray(value)) {
for (var k = 0; k < value.length; ++k) {
if (!(value[k] instanceof tizen.MessageAttachment)) {
return;
{name: 'opId', type: types_.LONG}
]);
- if(arguments.opId === undefined){
- throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
- }
-
var self = this;
bridge.sync({
cmd: 'MessageService_stopSync',