file_on_progress = TRUE;
}
+static int _create_thumbnail_directory()
+{
+ char thumb_path[PATH_MAX];
+ char *data_path = NULL;
+ data_path = app_get_shared_data_path();
+ sprintf(thumb_path, "%s/thumbnail", data_path);
+
+ if (data_path)
+ free(data_path);
+
+ if (access(thumb_path, F_OK) == 0)
+ return 0;
+
+ if (mkdir(thumb_path, 0755) == -1) {
+ LOGE("directory create error");
+ return -1;
+ }
+
+ return 0;
+}
+
bool request_sticker_data(const char *mode, const char *category, const char *type)
{
bool result = false;
return false;
}
+ if (_create_thumbnail_directory() != 0)
+ LOGE("Failed to create thumbnail directory");
+
json_object_set_string_member(j_object, "msgId", STICKER_SYNC_START_REQ);
json_object_set_int_member(j_object, "tID", ++t_id);
json_object_set_string_member(j_object, "mode", mode);
return result;
}
-static int _create_directory(const char *path)
-{
- if (access(path, F_OK) == 0)
- return 0;
-
- if (mkdir(path, 0755) == -1) {
- LOGE("directory create error");
- return -1;
- }
-
- return 0;
-}
-
void request_sticker_feature()
{
JsonObject *j_object = NULL;
json_object_unref(j_object);
- char thumb_path[PATH_MAX];
- char *data_path = NULL;
- data_path = app_get_shared_data_path();
- sprintf(thumb_path, "%s/thumbnail", data_path);
-
- if (_create_directory(thumb_path) != 0)
+ if (_create_thumbnail_directory() != 0)
LOGE("Failed to create thumbnail directory");
}