comparison src/protocols/msn/msn.c @ 2210:3a6fd1e8f00a

[gaim-migrate @ 2220] i haven't even tested this. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 05 Sep 2001 05:25:13 +0000
parents c24595d3c364
children a226ebf4be47
comparison
equal deleted inserted replaced
2209:9b8b32ae3b41 2210:3a6fd1e8f00a
495 struct gaim_connection *gc = ms->gc; 495 struct gaim_connection *gc = ms->gc;
496 struct msn_data *md; 496 struct msn_data *md;
497 char buf[MSN_BUF_LEN]; 497 char buf[MSN_BUF_LEN];
498 498
499 if (source == -1 || !g_slist_find(connections, gc)) { 499 if (source == -1 || !g_slist_find(connections, gc)) {
500 close(source);
500 g_free(ms->sessid); 501 g_free(ms->sessid);
501 g_free(ms->auth); 502 g_free(ms->auth);
502 g_free(ms); 503 g_free(ms);
503 return; 504 return;
504 } 505 }
526 struct msn_switchboard *ms = data; 527 struct msn_switchboard *ms = data;
527 struct gaim_connection *gc = ms->gc; 528 struct gaim_connection *gc = ms->gc;
528 char buf[MSN_BUF_LEN]; 529 char buf[MSN_BUF_LEN];
529 530
530 if (source == -1 || !g_slist_find(connections, gc)) { 531 if (source == -1 || !g_slist_find(connections, gc)) {
532 close(source);
531 g_free(ms->auth); 533 g_free(ms->auth);
532 g_free(ms); 534 g_free(ms);
533 return; 535 return;
534 } 536 }
535 537
898 { 900 {
899 struct gaim_connection *gc = data; 901 struct gaim_connection *gc = data;
900 struct msn_data *md; 902 struct msn_data *md;
901 char buf[MSN_BUF_LEN]; 903 char buf[MSN_BUF_LEN];
902 904
903 if (!g_slist_find(connections, gc)) 905 if (!g_slist_find(connections, gc)) {
904 return; 906 close(source);
907 return;
908 }
905 909
906 md = gc->proto_data; 910 md = gc->proto_data;
907 911
908 if (md->fd != source) 912 if (md->fd != source)
909 md->fd = source; 913 md->fd = source;
973 return; 977 return;
974 } 978 }
975 979
976 set_login_progress(gc, 3, "Requesting to send password"); 980 set_login_progress(gc, 3, "Requesting to send password");
977 } else if (!g_strncasecmp(buf, "USR", 3)) { 981 } else if (!g_strncasecmp(buf, "USR", 3)) {
982 char *resp, *friend, *tmp = buf;
983
984 GET_NEXT(tmp);
985 GET_NEXT(tmp);
986 resp = tmp;
987 GET_NEXT(tmp);
988 GET_NEXT(tmp);
989 friend = tmp;
990
991 debug_printf("resp: %s; friend: %s\n", resp, friend);
992
978 /* so here, we're either getting the challenge or the OK */ 993 /* so here, we're either getting the challenge or the OK */
979 if (strstr(buf, "OK")) { 994 if (strstr(buf, "OK")) {
995 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend);
996
980 g_snprintf(buf, sizeof(buf), "SYN %d 0\n", ++md->trId); 997 g_snprintf(buf, sizeof(buf), "SYN %d 0\n", ++md->trId);
981 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 998 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
982 hide_login_progress(gc, "Unable to write"); 999 hide_login_progress(gc, "Unable to write");
983 signoff(gc); 1000 signoff(gc);
984 return; 1001 return;
1080 { 1097 {
1081 struct gaim_connection *gc = data; 1098 struct gaim_connection *gc = data;
1082 struct msn_data *md; 1099 struct msn_data *md;
1083 char buf[1024]; 1100 char buf[1024];
1084 1101
1085 if (!g_slist_find(connections, gc)) 1102 if (!g_slist_find(connections, gc)) {
1086 return; 1103 close(source);
1104 return;
1105 }
1087 1106
1088 md = gc->proto_data; 1107 md = gc->proto_data;
1089 1108
1090 if (md->fd != source) 1109 if (md->fd != source)
1091 md->fd = source; 1110 md->fd = source;