void request_sticker_data(const char *mode, const char *category, const char *type)
{
- JsonObject *j_object = json_object_new();
+ JsonObject *j_object = NULL;
+ if (!priv_data.socket) {
+ pending_request.req_type = REQUEST_TYPE_SYNC;
+ pending_request.mode = string(mode ? mode : "manual");
+ pending_request.category = string(category? category : "arsticker");
+ pending_request.type = string(type ? type : "input");
+
+ LOGI("Push sync request");
+ return;
+ }
+
+ j_object = json_object_new();
if (j_object == NULL) {
LOGE("json object create error");
return;
json_object_set_string_member(j_object, "type", type);
if (_send_json_data(j_object) == FALSE) {
- pending_request.req_type = REQUEST_TYPE_SYNC;
- pending_request.mode = string(mode ? mode : "manual");
- pending_request.category = string(category? category : "arsticker");
- pending_request.type = string(type ? type : "input");
-
- LOGI("Push sync request");
+ LOGE("Failed to send STICKER_SYNC_START_REQ");
}
else {
current_request.req_type = REQUEST_TYPE_SYNC;
void request_sticker_feature()
{
- JsonObject *j_object = json_object_new();
+ JsonObject *j_object = NULL;
+
+ if (!priv_data.socket) {
+ pending_request.req_type = REQUEST_TYPE_FEATURE_REQ;
+ LOGI("Push sync feature request");
+ return;
+ }
+
+ j_object = json_object_new();
if (j_object == NULL) {
LOGE("json object create error");
return;
json_object_set_int_member(j_object, "tID", ++t_id);
if (_send_json_data(j_object) == FALSE) {
- pending_request.req_type = REQUEST_TYPE_FEATURE_REQ;
LOGE("Failed to send STICKER_SYNC_FEATURE_REQ");
}