libpurple/protocols/gg/gg.c

branch
soc.2012.gg
changeset 33314
57013b9e1a8e
parent 33313
5a0c6582d5b1
child 33315
42bbe5b85df8
equal deleted inserted replaced
33313:5a0c6582d5b1 33314:57013b9e1a8e
63 * @param Current action handler. 63 * @param Current action handler.
64 */ 64 */
65 static void ggp_action_buddylist_get(PurplePluginAction *action) 65 static void ggp_action_buddylist_get(PurplePluginAction *action)
66 { 66 {
67 PurpleConnection *gc = (PurpleConnection *)action->context; 67 PurpleConnection *gc = (PurpleConnection *)action->context;
68 GGPInfo *info = purple_connection_get_protocol_data(gc); 68 // TODO: just for debugging
69 69 // we will drop this action when roster will be ready
70 purple_debug_info("gg", "Downloading...\n"); 70 ggp_roster_update(gc);
71
72 gg_userlist_request(info->session, GG_USERLIST_GET, NULL);
73 } 71 }
74 72
75 /** 73 /**
76 * Upload the buddylist to the server. 74 * Upload the buddylist to the server.
77 * 75 *
1194 purple_debug_info("gg", "GG_EVENT_XML_EVENT\n"); 1192 purple_debug_info("gg", "GG_EVENT_XML_EVENT\n");
1195 ggp_xml_event_handler(gc, ev->event.xml_event.data); 1193 ggp_xml_event_handler(gc, ev->event.xml_event.data);
1196 break; 1194 break;
1197 case GG_EVENT_USER_DATA: 1195 case GG_EVENT_USER_DATA:
1198 ggp_events_user_data(gc, &ev->event.user_data); 1196 ggp_events_user_data(gc, &ev->event.user_data);
1197 break;
1198 case GG_EVENT_USERLIST100_VERSION:
1199 purple_debug_info("gg", "GG_EVENT_USERLIST100_VERSION: %u\n",
1200 ev->event.userlist100_version.version);
1201 break;
1202 case GG_EVENT_USERLIST100_REPLY:
1203 ggp_roster_reply(gc, &ev->event.userlist100_reply);
1199 break; 1204 break;
1200 default: 1205 default:
1201 purple_debug_error("gg", 1206 purple_debug_error("gg",
1202 "unsupported event type=%d\n", ev->type); 1207 "unsupported event type=%d\n", ev->type);
1203 break; 1208 break;
1566 1571
1567 purple_connection_set_protocol_data(gc, info); 1572 purple_connection_set_protocol_data(gc, info);
1568 1573
1569 ggp_image_setup(gc); 1574 ggp_image_setup(gc);
1570 ggp_avatar_setup(gc); 1575 ggp_avatar_setup(gc);
1576 ggp_roster_setup(gc);
1571 1577
1572 glp->uin = ggp_str_to_uin(purple_account_get_username(account)); 1578 glp->uin = ggp_str_to_uin(purple_account_get_username(account));
1573 glp->password = ggp_convert_to_cp1250(purple_account_get_password(account)); 1579 glp->password = ggp_convert_to_cp1250(purple_account_get_password(account));
1574 1580
1575 if (glp->uin == 0) { 1581 if (glp->uin == 0) {
1681 purple_notify_close_with_handle(gc); 1687 purple_notify_close_with_handle(gc);
1682 1688
1683 ggp_search_destroy(info->searches); 1689 ggp_search_destroy(info->searches);
1684 ggp_image_cleanup(gc); 1690 ggp_image_cleanup(gc);
1685 ggp_avatar_cleanup(gc); 1691 ggp_avatar_cleanup(gc);
1692 ggp_roster_cleanup(gc);
1686 1693
1687 if (info->inpa > 0) 1694 if (info->inpa > 0)
1688 purple_input_remove(info->inpa); 1695 purple_input_remove(info->inpa);
1689 1696
1690 purple_connection_set_protocol_data(gc, NULL); 1697 purple_connection_set_protocol_data(gc, NULL);

mercurial