Changed main items alignments. 88/55888/1
authorpolu.sandeep <polu.sandeep@samsung.com>
Wed, 30 Dec 2015 04:44:53 +0000 (13:44 +0900)
committerpolu.sandeep <polu.sandeep@samsung.com>
Wed, 30 Dec 2015 04:44:53 +0000 (13:44 +0900)
Change-Id: I510c6cd71f1a7efe76bee80e6627488d8fa23bd4

TelegramTizen/src/telegramtizen.c
TelegramTizen/src/tg_messaging_view.c

index 4628c87..02e9250 100644 (file)
@@ -1538,6 +1538,58 @@ static int on_message_received_from_buddy(appdata_s *app, bundle *const rec_msg,
        } else {
                id_to_check = to_id;
        }
+
+       if (type_of_chat == TGL_PEER_USER) {
+               if ((app->current_app_state ==  TG_CHAT_MESSAGING_VIEW_STATE || app->current_app_state ==  TG_SET_USER_INFO_STATE) && app->peer_in_cahtting_data
+                               && app->peer_in_cahtting_data->use_data->peer_id == from_id) {
+                       if (with_date) {
+                               char* date_id_str = NULL;
+                               result = bundle_get_str(rec_msg, "date_id", &date_id_str);
+                               int date_id = atoi(date_id_str);
+                               on_text_message_received_from_buddy(app, date_id, type_of_chat);
+                               wait_for(1);
+                               on_text_message_received_from_buddy(app, message_id, type_of_chat);
+                       } else {
+                               on_text_message_received_from_buddy(app, message_id, type_of_chat);
+                       }
+                       return result;
+               }
+
+       } else if (type_of_chat == TGL_PEER_CHAT) {
+               if ((app->current_app_state ==  TG_CHAT_MESSAGING_VIEW_STATE || app->current_app_state ==  TG_SET_CHAT_INFO_STATE) && app->peer_in_cahtting_data
+                               && app->peer_in_cahtting_data->use_data->peer_id == to_id) {
+                       char* tablename = get_table_name_from_number(to_id);
+                       tg_message_s* msg = get_message_from_message_table(message_id, tablename);
+                       if (msg) {
+                               // To be handled.
+                               if (with_date) {
+                                       char* date_id_str = NULL;
+                                       result = bundle_get_str(rec_msg, "date_id", &date_id_str);
+                                       int date_id = atoi(date_id_str);
+                                       on_text_message_received_from_buddy(app, date_id, type_of_chat);
+                                       wait_for(1);
+                                       on_text_message_received_from_buddy(app, message_id, type_of_chat);
+                               } else {
+                                       on_text_message_received_from_buddy(app, message_id, type_of_chat);
+                               }
+                               if(msg->message) {
+                                       free(msg->message);
+                                       msg->message = NULL;
+                               }
+
+                               if(msg->media_id) {
+                                       free(msg->media_id);
+                                       msg->media_id = NULL;
+                               }
+                       }
+                       free(msg);
+                       free(tablename);
+                       return result;
+               }
+       }
+
+
+
        if (app->main_list) {
                int main_list_size = eina_list_count(app->main_list);
                for (int i = 0; i < main_list_size; i++) {
@@ -1744,55 +1796,6 @@ static int on_message_received_from_buddy(appdata_s *app, bundle *const rec_msg,
                 }
        }
 
-       if (type_of_chat == TGL_PEER_USER) {
-               if ((app->current_app_state ==  TG_CHAT_MESSAGING_VIEW_STATE || app->current_app_state ==  TG_SET_USER_INFO_STATE) && app->peer_in_cahtting_data
-                               && app->peer_in_cahtting_data->use_data->peer_id == from_id) {
-                       if (with_date) {
-                               char* date_id_str = NULL;
-                               result = bundle_get_str(rec_msg, "date_id", &date_id_str);
-                               int date_id = atoi(date_id_str);
-                               on_text_message_received_from_buddy(app, date_id, type_of_chat);
-                               wait_for(1);
-                               on_text_message_received_from_buddy(app, message_id, type_of_chat);
-                       } else {
-                               on_text_message_received_from_buddy(app, message_id, type_of_chat);
-                       }
-                       return result;
-               }
-
-       } else if (type_of_chat == TGL_PEER_CHAT) {
-               if ((app->current_app_state ==  TG_CHAT_MESSAGING_VIEW_STATE || app->current_app_state ==  TG_SET_CHAT_INFO_STATE) && app->peer_in_cahtting_data
-                               && app->peer_in_cahtting_data->use_data->peer_id == to_id) {
-                       char* tablename = get_table_name_from_number(to_id);
-                       tg_message_s* msg = get_message_from_message_table(message_id, tablename);
-                       if (msg) {
-                               // To be handled.
-                               if (with_date) {
-                                       char* date_id_str = NULL;
-                                       result = bundle_get_str(rec_msg, "date_id", &date_id_str);
-                                       int date_id = atoi(date_id_str);
-                                       on_text_message_received_from_buddy(app, date_id, type_of_chat);
-                                       wait_for(1);
-                                       on_text_message_received_from_buddy(app, message_id, type_of_chat);
-                               } else {
-                                       on_text_message_received_from_buddy(app, message_id, type_of_chat);
-                               }
-                               if(msg->message) {
-                                       free(msg->message);
-                                       msg->message = NULL;
-                               }
-
-                               if(msg->media_id) {
-                                       free(msg->media_id);
-                                       msg->media_id = NULL;
-                               }
-                       }
-                       free(msg);
-                       free(tablename);
-                       return result;
-               }
-       }
-
        if (app->s_app_visible_state == APP_STATE_IN_BACKGROUND || app->current_app_state !=  TG_USER_MAIN_VIEW_STATE) {
                // show notification
                char *icon_path = (char*)ui_utils_get_resource(DEFAULT_TELEGRAM_ICON);
index 4a9cca0..b405578 100644 (file)
@@ -2141,7 +2141,7 @@ static void on_text_message_send_clicked(void *data, Evas_Object *obj, const cha
        if (add_date_item_to_chat(data)) {
                //ecore_timer_add(2, on_new_text_message_send_cb, chat_scroller);
                //return;
-               wait_for(1);
+               wait_for(2);
        }
 
        int unique_id = get_time_stamp_in_macro();
@@ -2537,7 +2537,7 @@ void send_contact_message_to_buddy(void *data, char *first_name, char *last_name
 
                ecore_timer_add(2, on_new_contact_message_send_cb, chat_scroller);
                return;*/
-               wait_for(1);
+               wait_for(2);
        }
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
@@ -2659,7 +2659,7 @@ void send_location_message_to_buddy(void *data, char *latitude, char *longitude)
                evas_object_data_set(chat_scroller, "contact_longitude", strdup(longitude));
                ecore_timer_add(2, on_new_location_message_send_cb, chat_scroller);
                return;*/
-               wait_for(1);
+               wait_for(2);
        }
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
@@ -2795,7 +2795,7 @@ void send_media_message_to_buddy(void *data, const char* file_path, enum tgl_mes
 
                ecore_timer_add(2, on_new_media_message_send_cb, chat_scroller);
                return;*/
-               wait_for(1);
+               wait_for(2);
        }
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);