src/protocols/trepia/trepia.c

changeset 5988
3ef7472fa5b5
parent 5952
8534bfd6407c
child 5990
9b89e8aaf168
equal deleted inserted replaced
5987:1c35193f8dcb 5988:3ef7472fa5b5
44 # include <net/if_arp.h> 44 # include <net/if_arp.h>
45 #endif 45 #endif
46 46
47 #define TREPIA_VERSION "2.52" 47 #define TREPIA_VERSION "2.52"
48 48
49 #define TREPIA_CONNECT_STEPS 3
50
49 static GaimPlugin *my_protocol = NULL; 51 static GaimPlugin *my_protocol = NULL;
50 52
51 typedef enum 53 typedef enum
52 { 54 {
53 TREPIA_LOGIN = 'C', 55 TREPIA_LOGIN = 'C',
658 return TRUE; 660 return TRUE;
659 661
660 if (info != NULL) { 662 if (info != NULL) {
661 switch (type) { 663 switch (type) {
662 case TREPIA_USER_LIST: 664 case TREPIA_USER_LIST:
665 gaim_connection_update_progress(session->gc,
666 _("Retrieving buddy list"), 2, TREPIA_CONNECT_STEPS);
667
663 gaim_connection_set_state(session->gc, GAIM_CONNECTED); 668 gaim_connection_set_state(session->gc, GAIM_CONNECTED);
664 serv_finish_login(session->gc); 669 serv_finish_login(session->gc);
665 break; 670 break;
666 671
667 case TREPIA_MSG_INCOMING: /* Incoming Message */ 672 case TREPIA_MSG_INCOMING: /* Incoming Message */
1037 1042
1038 #if 0 1043 #if 0
1039 g_free(mac); 1044 g_free(mac);
1040 #endif 1045 #endif
1041 1046
1047 gaim_connection_update_progress(session->gc, _("Logging in"), 1,
1048 TREPIA_CONNECT_STEPS);
1049
1042 if (trepia_write(session->fd, buffer, strlen(buffer)) < 0) { 1050 if (trepia_write(session->fd, buffer, strlen(buffer)) < 0) {
1043 gaim_connection_error(session->gc, _("Write error")); 1051 gaim_connection_error(session->gc, _("Write error"));
1044 return; 1052 return;
1045 } 1053 }
1046 1054
1070 session->fd = -1; 1078 session->fd = -1;
1071 session->user_profiles = g_hash_table_new_full(g_int_hash, g_int_equal, 1079 session->user_profiles = g_hash_table_new_full(g_int_hash, g_int_equal,
1072 g_free, NULL); 1080 g_free, NULL);
1073 1081
1074 __clear_user_list(session); 1082 __clear_user_list(session);
1083
1084 gaim_connection_update_progress(gc, _("Connecting"), 0,
1085 TREPIA_CONNECT_STEPS);
1075 1086
1076 i = gaim_proxy_connect(account, server, port, __login_cb, session); 1087 i = gaim_proxy_connect(account, server, port, __login_cb, session);
1077 1088
1078 if (i != 0) 1089 if (i != 0)
1079 gaim_connection_error(gc, _("Unable to create socket")); 1090 gaim_connection_error(gc, _("Unable to create socket"));

mercurial