From: polu.sandeep Date: Tue, 8 Dec 2015 08:14:06 +0000 (+0900) Subject: Implemented "Add contact" and fixed UI issues. X-Git-Tag: release/160311~92^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F53621%2F1;p=apps%2Fnative%2Ftelegram-tizen.git Implemented "Add contact" and fixed UI issues. Change-Id: I2cc80a0d8b657f5e38a0ddcd999ff95f7fce212e --- diff --git a/TelegramTizen/db_manager/tg_db_manager.c b/TelegramTizen/db_manager/tg_db_manager.c index 733a0cd..4669e4e 100644 --- a/TelegramTizen/db_manager/tg_db_manager.c +++ b/TelegramTizen/db_manager/tg_db_manager.c @@ -620,7 +620,8 @@ Eina_List* get_values_from_table_sync(const char* table_name, Eina_List* column_ text = (const char *)sqlite3_column_text(stmt, col); if (!text || text[0] == '\0') { - val = strdup("_null_"); + //val = strdup("_null_"); + val = strdup(""); } else { val = strdup(text); } diff --git a/TelegramTizen/inc/tg_search_peer_view.h b/TelegramTizen/inc/tg_search_peer_view.h index 311e17d..dc2aa69 100644 --- a/TelegramTizen/inc/tg_search_peer_view.h +++ b/TelegramTizen/inc/tg_search_peer_view.h @@ -12,6 +12,6 @@ extern void launch_start_peer_search_view(appdata_s* ad); extern int on_create_new_contact(appdata_s* ad); - +extern void on_new_contact_added_response_received(appdata_s *ad, int buddy_id, Eina_Bool is_success); #endif /* TG_SEARCH_PEER_VIEW_H_ */ diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index e46d40a..13f7fb7 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -16,6 +16,7 @@ #include #include "tg_settings_view.h" #include "device_contacts_manager.h" +#include "tg_search_peer_view.h" static void free_app_data(appdata_s *app_data, Eina_Bool destroy_server); @@ -395,7 +396,11 @@ void load_main_list_data(appdata_s *ad) media_msg = get_media_details_from_db(atoll(msg->media_id)); if (media_msg && media_msg->doc_type) { - item->last_message = strdup(media_msg->doc_type); + if (strlen(media_msg->doc_type) > 0) { + item->last_message = strdup(media_msg->doc_type); + } else { + item->last_message = strdup("Document"); + } free_media_details(media_msg); } else { if (msg->message && strlen(msg->message) > 0) { @@ -1791,6 +1796,31 @@ static int on_message_received_from_buddy(appdata_s *app, bundle *const rec_msg) return result; } +static int on_new_contact_added(appdata_s *app, bundle *const rec_msg) +{ + int result = SVC_RES_FAIL; + char* buddy_id_str = NULL; + result = bundle_get_str(rec_msg, "buddy_id", &buddy_id_str); + int buddy_id = atoi(buddy_id_str); + + Eina_Bool is_success = EINA_FALSE; + char* is_success_val = NULL; + result = bundle_get_str(rec_msg, "is_success", &is_success_val); + if (strncmp("true", is_success_val, strlen("true")) == 0) { + is_success = EINA_TRUE; + } else { + is_success = EINA_FALSE; + } + if (is_success) { + load_buddy_list_data(app); + load_peer_data(app); + } + hide_loading_popup(app); + if (app->current_app_state == TG_ADD_CONTACT_STATE) { + on_new_contact_added_response_received(app, buddy_id, is_success); + } + return result; +} static int on_buddy_re_added_to_chat(appdata_s *app, bundle *const rec_msg) { @@ -2743,6 +2773,10 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) return on_buddy_re_added_to_chat(data, rec_msg); + } else if (strcmp(rec_key_val, "new_contact_added") == 0) { + + return on_new_contact_added(data, rec_msg); + } else if (strcmp(rec_key_val, "buddy_deleted") == 0) { return on_buddy_deleted_from_group_chat(data, rec_msg); @@ -3109,8 +3143,229 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) ad->main_list = eina_list_prepend(ad->main_list, latest_item); } } + refresh_main_list_view(ad, EINA_FALSE); + } else { + if (ad->peer_in_cahtting_data) { + peer_with_pic_s *item = ad->peer_in_cahtting_data; + if (item) { + tg_peer_info_s* peer_info = item->use_data; + if(peer_info) { + //if (peer_info->last_msg_id > 0) { + + // get message from message table. + + char* tablename = get_table_name_from_number(peer_info->peer_id); + //tg_message_s* msg = get_message_from_message_table(peer_info->last_msg_id, tablename); + tg_message_s* msg = get_latest_message_from_message_table(tablename); + + if (msg) { + + if (msg->service) { + if (msg->message && strlen(msg->message) > 0) { + item->last_message = strdup(msg->message); + } else { + item->last_message = strdup(" "); + } + } else { + + int media_type = msg->media_type; + if(media_type == tgl_message_media_none) { + if (msg->message && strlen(msg->message) > 0) { + item->last_message = strdup(msg->message); + } else { + item->last_message = strdup(" "); + } + } else if(media_type == tgl_message_media_photo) { + item->last_message = strdup("Image"); + } else if(media_type == tgl_message_media_document) { + tgl_media_s *media_msg = NULL; + media_msg = get_media_details_from_db(atoll(msg->media_id)); + + if (media_msg && media_msg->doc_type) { + if (strlen(media_msg->doc_type) > 0) { + item->last_message = strdup(media_msg->doc_type); + } else { + item->last_message = strdup("Document"); + } + free_media_details(media_msg); + } else { + if (msg->message && strlen(msg->message) > 0) { + item->last_message = strdup(msg->message); + } else { + item->last_message = strdup("Document"); + } + } + + } else if(media_type == tgl_message_media_geo) { + item->last_message = strdup("Geo location"); + } else if(media_type == tgl_message_media_contact) { + item->last_message = strdup("Contact"); + } else if(media_type == tgl_message_media_unsupported) { + item->last_message = strdup(" "); + } else if(media_type == tgl_message_media_photo_encr) { + item->last_message = strdup("Image encrypted"); + } else if(media_type == tgl_message_media_document_encr) { + item->last_message = strdup("Document encrypted"); + } else { + item->last_message = strdup(" "); + } + } + + tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s)); + main_list_item->peer_id = peer_info->peer_id; + main_list_item->peer_type = peer_info->peer_type; + if ((peer_info->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(peer_info->peer_id)) { + //set phone number + main_list_item->peer_print_name = strdup(get_buddy_phone_num_from_id(peer_info->peer_id)); + } else { + main_list_item->peer_print_name = strdup(peer_info->print_name); + } + main_list_item->last_seen_time = msg->date; + main_list_item->profile_pic = NULL; + main_list_item->last_msg_id = msg->msg_id; + main_list_item->last_message = strdup(item->last_message); + main_list_item->last_msg_type = msg->media_type; + main_list_item->is_out_msg = msg->out; + main_list_item->last_msg_status = msg->msg_state; + main_list_item->last_msg_service = msg->service; + main_list_item->number_of_unread_msgs = get_unread_message_count(tablename); + + + if (peer_info->peer_type == TGL_PEER_USER) { + if (peer_info->is_unknown == 1) { + main_list_item->buddy_display_name = get_buddy_phone_num_from_id(peer_info->peer_id); + } else { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name || strstr(first_name ,"null") != 0) { + first_name = NULL; + } + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name || strstr(last_name ,"null") != 0) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + + + if (peer_info->photo_path) { + main_list_item->profile_pic_path = strdup(peer_info->photo_path); + } else { + main_list_item->profile_pic_path = NULL; + } + main_list_item->user_name_lbl = NULL; + main_list_item->status_lbl = NULL; + main_list_item->date_lbl = NULL; + main_list_item->msg_status_lbl = NULL; + main_list_item->main_item_layout = NULL; + ad->main_list = eina_list_prepend(ad->main_list, main_list_item); + + // delete message object + if(msg->message) { + free(msg->message); + msg->message = NULL; + } + + if(msg->media_id) { + free(msg->media_id); + msg->media_id = NULL; + } + + free(msg); + msg = NULL; + + } else { + item->last_message = strdup(" "); + if (peer_info->peer_type == TGL_PEER_CHAT) { + tg_main_list_item_s* main_list_item = (tg_main_list_item_s*)malloc(sizeof(tg_main_list_item_s)); + main_list_item->peer_id = peer_info->peer_id; + main_list_item->peer_type = peer_info->peer_type; + if ((peer_info->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(peer_info->peer_id)) { + //set phone number + main_list_item->peer_print_name = strdup(get_buddy_phone_num_from_id(peer_info->peer_id)); + } else { + main_list_item->peer_print_name = strdup(peer_info->print_name); + } + main_list_item->last_seen_time = peer_info->last_seen_time; + main_list_item->profile_pic = NULL; + main_list_item->last_message = strdup(item->last_message); + main_list_item->last_msg_type = -1; + main_list_item->last_msg_service = 0; + main_list_item->is_out_msg = -1; + main_list_item->last_msg_id = -1; + main_list_item->last_msg_status = -1; + main_list_item->number_of_unread_msgs = 0; + if (peer_info->peer_type == TGL_PEER_USER) { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name || strstr(first_name ,"null") != 0) { + first_name = NULL; + } + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name || strstr(last_name ,"null") != 0) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + + if (peer_info->photo_path) { + main_list_item->profile_pic_path = strdup(peer_info->photo_path); + } else { + main_list_item->profile_pic_path = NULL; + } + main_list_item->user_name_lbl = NULL; + main_list_item->status_lbl = NULL; + main_list_item->date_lbl = NULL; + main_list_item->msg_status_lbl = NULL; + main_list_item->main_item_layout = NULL; + ad->main_list = eina_list_prepend(ad->main_list, main_list_item); + } + } + + if (tablename) { + free(tablename); + tablename = NULL; + } + //} + } + } + refresh_main_list_view(ad, EINA_TRUE); + } } - refresh_main_list_view(ad, EINA_FALSE); + } elm_naviframe_item_pop(ad->nf); ad->current_app_state = TG_USER_MAIN_VIEW_STATE; diff --git a/TelegramTizen/src/tg_search_peer_view.c b/TelegramTizen/src/tg_search_peer_view.c index 910be59..f560422 100755 --- a/TelegramTizen/src/tg_search_peer_view.c +++ b/TelegramTizen/src/tg_search_peer_view.c @@ -11,6 +11,8 @@ #include "contact_selection_view.h" #include "ucol.h" #include "device_contacts_manager.h" +#include "tg_search_peer_view.h" +#include "server_requests.h" #define COMMAND_MENU_ITEM_COUNT 2 #define MOBILE_BUTTON_SIZE (98*1.4f) @@ -22,7 +24,9 @@ typedef struct { Elm_Object_Item *item; } _command_item_info; - +static void _append_command_item(Evas_Object *genlist, appdata_s *ad); +static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list); +static void _append_contact_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list); static void on_invite_friends_clicked(void *data, Evas_Object *obj, void *event_info); static void on_group_chat_clicked(void *data, Evas_Object *obj, void *event_info); static void on_secret_chat_clicked(void *data, Evas_Object *obj, void *event_info); @@ -357,6 +361,11 @@ static Evas_Object *_get_content_cb(void *data, Evas_Object *obj, const char *pa evas_object_smart_callback_add(phone_entry, "unfocused", onUnfocus, layout); evas_object_show(phone_entry); + appdata_s *ad = evas_object_data_get(obj, "app_data"); + if (ad) { + evas_object_data_set(ad->nf, "add_contact_phone_number", phone_entry); + } + return layout; } else if (0 == strcmp(part, "elm.icon.2")) { @@ -390,6 +399,11 @@ static Evas_Object *_get_first_name_content_cb(void *data, Evas_Object *obj, con evas_object_smart_callback_add(phone_entry, "unfocused", onUnfocus, layout); evas_object_show(phone_entry); + appdata_s *ad = evas_object_data_get(obj, "app_data"); + if (ad) { + evas_object_data_set(ad->nf, "add_contact_first_name", phone_entry); + } + return layout; } else if (0 == strcmp(part, "elm.icon.2")) { @@ -422,6 +436,11 @@ static Evas_Object *_get_second_name_content_cb(void *data, Evas_Object *obj, co evas_object_smart_callback_add(phone_entry, "unfocused", onUnfocus, layout); evas_object_show(phone_entry); + appdata_s *ad = evas_object_data_get(obj, "app_data"); + if (ad) { + evas_object_data_set(ad->nf, "add_contact_last_name", phone_entry); + } + return layout; } else if (0 == strcmp(part, "elm.icon.2")) { @@ -471,6 +490,10 @@ static Evas_Object *_get_picture_cb(void *data, Evas_Object *obj, const char *pa profile_pic = get_image_from_path(ui_utils_get_resource(TG_CALLER_ID_IMAGE), obj); evas_object_color_set(profile_pic, 45, 165, 224, 225); + appdata_s *ad = evas_object_data_get(obj, "app_data"); + if (ad) { + evas_object_data_set(ad->nf, "add_contact_pic", profile_pic); + } elm_object_part_content_set(image_layout, "image", profile_pic); return image_layout; @@ -631,9 +654,60 @@ static Evas_Object* create_genlist(appdata_s *ad, Evas_Object *layout) return list; } +void on_new_contact_added_response_received(appdata_s *ad, int buddy_id, Eina_Bool is_success) +{ + if (is_success) { + elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_PEER_SEARCH_VIEW_STATE; + show_floating_button(ad); + + // add new buddy to list + Evas_Object *peer_list = evas_object_data_get(ad->nf, "search_list"); + if (peer_list) { + elm_genlist_clear(peer_list); + clear_search_list(ad); + free_contact_list(ad->contact_list); + + ad->search_peer_list = load_buddy_data_by_name(ad->user_id.id, NULL); + ad->contact_list = get_contact_list_from_device_db(); + + _append_command_item(peer_list, ad); + _append_peer_item(peer_list, ad, ad->search_peer_list); + if (ad->contact_list && eina_list_count(ad->contact_list) > 0) { + _append_contact_item(peer_list, ad, ad->contact_list); + } + } + } else { + // show failed message + } +} + static void on_new_contact_done_clicked(void *data, Evas_Object *obj, void *event_info) { appdata_s* ad = data; + char* phone_num = NULL; + char* first_name = NULL; + char* last_name = NULL; + char* profile_pic_path = NULL; + + Evas_Object *phone_num_entry = evas_object_data_get(ad->nf, "add_contact_phone_number"); + if (phone_num_entry) + phone_num = elm_entry_markup_to_utf8(elm_object_text_get(phone_num_entry)); + + Evas_Object *first_name_entry = evas_object_data_get(ad->nf, "add_contact_first_name"); + if (first_name_entry) + first_name = elm_entry_markup_to_utf8(elm_object_text_get(first_name_entry)); + + Evas_Object *last_name_entry = evas_object_data_get(ad->nf, "add_contact_last_name"); + if (last_name_entry) + last_name = elm_entry_markup_to_utf8(elm_object_text_get(last_name_entry)); + + if ((phone_num && strlen(phone_num) > 0) && (first_name && strlen(first_name) > 0) && (last_name && strlen(last_name) > 0)) { + show_loading_popup(ad); + send_add_buddy_request(ad, ad->service_client, -1, first_name, last_name, phone_num); + } else { + // show message + } } static void on_new_contact_cancel_clicked(void *data, Evas_Object *obj, void *event_info) @@ -685,7 +759,7 @@ int on_create_new_contact(appdata_s* ad) elm_object_item_part_content_set(navi_item, "title_left_btn", cancel_btn); evas_object_data_set(ad->nf, "name_done_btn", (void*)done_btn); - elm_object_disabled_set(done_btn, EINA_TRUE); + //elm_object_disabled_set(done_btn, EINA_TRUE); } @@ -807,7 +881,7 @@ static void _update_index_item(void *data, void *item_data, int id, Eina_List *l } #endif -static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) +void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) { int i; static Elm_Genlist_Item_Class itc; @@ -937,7 +1011,7 @@ Evas_Object* on_contact_list_image_requested(void *data, Evas_Object *obj, const } -static void _append_contact_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) +void _append_contact_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) { if (!genlist || !ad || !item_list) { @@ -969,7 +1043,7 @@ static void _append_contact_item(Evas_Object *genlist, appdata_s *ad, Eina_List* } } -static void _append_command_item(Evas_Object *genlist, appdata_s *ad) +void _append_command_item(Evas_Object *genlist, appdata_s *ad) { int i; static Elm_Genlist_Item_Class itc; diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index 732787d..e76a614 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -367,9 +367,6 @@ void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info) /**************************************************************************/ - - - void on_chat_bg_select_result_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { if (result == APP_CONTROL_RESULT_SUCCEEDED) { diff --git a/tg-engine-service/inc/server_response.h b/tg-engine-service/inc/server_response.h index 9a6d461..00b87f8 100644 --- a/tg-engine-service/inc/server_response.h +++ b/tg-engine-service/inc/server_response.h @@ -77,6 +77,7 @@ extern void send_group_chat_new_buddy_response(tg_engine_data_s *tg_data, int pe extern void send_group_chat_delete_buddy_response(tg_engine_data_s *tg_data, int peer_id, Eina_Bool is_success); extern void send_response_for_server_connection_status(tg_engine_data_s *tg_data, Eina_Bool connection_status); extern void send_response_for_logout(tg_engine_data_s *tg_data); +extern void send_new_contact_added_response(tg_engine_data_s *tg_data, int buddy_id, Eina_Bool is_success); extern void send_self_profile_name_updated_response(tg_engine_data_s *tg_data, char *first_name, char *last_name, Eina_Bool is_success); extern void send_response_to_group_chat_updated_response(tg_engine_data_s *tg_data, int chat_id); diff --git a/tg-engine-service/src/server_response.c b/tg-engine-service/src/server_response.c index da07ace..cb9b216 100644 --- a/tg-engine-service/src/server_response.c +++ b/tg-engine-service/src/server_response.c @@ -1064,6 +1064,47 @@ void send_group_chat_rename_response(tg_engine_data_s *tg_data, int peer_id, Ein bundle_free(msg); } +void send_new_contact_added_response(tg_engine_data_s *tg_data, int buddy_id, Eina_Bool is_success) +{ + bundle *msg = bundle_create(); + if (bundle_add_str(msg, "app_name", "Tizen Telegram") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "command", "new_contact_added") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + char usr_id_str[50]; + sprintf(usr_id_str,"%d",buddy_id); + + if (bundle_add_str(msg, "buddy_id", usr_id_str) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (is_success) { + if (bundle_add_str(msg, "is_success", "true") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + } else { + if (bundle_add_str(msg, "is_success", "false") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + } + int result = SVC_RES_FAIL; + result = tg_server_send_message(tg_data->tg_server, msg); + + if(result != SVC_RES_OK) { + // error: cient not ready + } + bundle_free(msg); +} + void send_buddy_readded_response(tg_engine_data_s *tg_data, int buddy_id, Eina_Bool is_success) { diff --git a/tg-engine-service/tg_engine/tg_engine.c b/tg-engine-service/tg_engine/tg_engine.c index 9e58aa2..f32c0c2 100644 --- a/tg-engine-service/tg_engine/tg_engine.c +++ b/tg-engine-service/tg_engine/tg_engine.c @@ -3071,6 +3071,39 @@ void on_buddy_readded(struct tgl_state *TLS,void *callback_extra, int success, i } } +void on_new_buddy_added(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_user *users[]) +{ + tg_engine_data_s *tg_data = TLS->callback_data; + if (success) { + struct tgl_user *buddy = users[0]; + if (buddy) { + char* msg_table = get_table_name_from_number(buddy->id.id); + create_buddy_msg_table(msg_table); + free(msg_table); + + if (buddy->id.id == 333000 || buddy->id.id == 777000) { + buddy->is_unknown = 1; + } else { + buddy->is_unknown = 0; + } + init_insert_buddy_into_db(BUDDY_INFO_TABLE_NAME, buddy); + tgl_peer_t* UC = tgl_peer_get(TLS, buddy->id); + if (UC) { + init_insert_peer_into_database(UC, 0, 0, 0); + } + tgl_do_get_user_info(TLS, buddy->id, 0, on_buddy_info_loaded, NULL); + + // send response to application + send_new_contact_added_response(tg_data, buddy->id.id, EINA_TRUE); + } else { + send_new_contact_added_response(tg_data, -1, EINA_FALSE); + } + + } else { + send_new_contact_added_response(tg_data, -1, EINA_TRUE); + } +} + void do_add_buddy(int buddy_id, char *first_name, char *last_name, char *phone_num) { if (!first_name) { @@ -3084,7 +3117,11 @@ void do_add_buddy(int buddy_id, char *first_name, char *last_name, char *phone_n } if (first_name && last_name && phone_num) { - tgl_do_add_contact(s_info.TLS, phone_num, first_name, last_name, 0, on_buddy_readded, (void*)(buddy_id)); + if (buddy_id == -1) { + tgl_do_add_contact(s_info.TLS, phone_num, first_name, last_name, 0, on_new_buddy_added, (void*)(buddy_id)); + } else { + tgl_do_add_contact(s_info.TLS, phone_num, first_name, last_name, 0, on_buddy_readded, (void*)(buddy_id)); + } } }