Fix issue smartreply string isn't inserted when pressing 75/162775/5
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 5 Dec 2017 07:57:04 +0000 (16:57 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 5 Dec 2017 08:19:50 +0000 (17:19 +0900)
Change-Id: Id42a5586f3d03aacf1865ee99f1621d008a4684c
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/ise.cpp

index cd26cda..df9128d 100644 (file)
@@ -220,6 +220,7 @@ static void _input_smartreply_notify_cb(void *user_data)
                 candidate = reply;
                 if (candidate) {
                     candidate_strings.push_back(string(candidate));
+                    g_smartreply_size++;
                 }
             }
             g_ic_smartreply = g_ic;
@@ -2260,6 +2261,8 @@ static void ime_app_hide_cb(int ic, void *user_data)
     g_set_mime_type = FALSE;
 #endif
     g_ic_smartreply = -1;
+    g_smartreply_size = 0;
+    g_smartreply_reply_exist = false;
 }
 
 static void ime_app_return_key_type_set_cb(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data)
@@ -2586,8 +2589,12 @@ static void ime_app_prediction_hint_set_cb(const char *prediction_hint, void *us
         input_smartreply_init(caller_id, sender, hint);
         input_smartreply_set_notify(_input_smartreply_notify_cb, NULL);
 
-        if (input_smartreply_is_enabled())
+        if (input_smartreply_is_enabled()) {
+            g_smartreply_size = 0;
+            g_smartreply_reply_exist = false;
+
             input_smartreply_get_reply_async();
+        }
     }
 }