comparison plugins/msn/msn.c @ 1307:751937b4f109

[gaim-migrate @ 1317] MSN doesn't support sending a message to yourself. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 19 Dec 2000 07:02:41 +0000
parents f8557a227369
children 4741b5a75b9f
comparison
equal deleted inserted replaced
1306:868f9c98db13 1307:751937b4f109
123 123
124 int status; 124 int status;
125 char c; 125 char c;
126 int i = 0; 126 int i = 0;
127 127
128 printf("%s (%d)\n", strerror(errno), errno);
129
128 do { 130 do {
129 status = recv(fd, &c, 1, 0); 131 status = recv(fd, &c, 1, 0);
130 132
131 if (!status) 133 if (!status)
132 return; 134 return;
138 buf[i] = '\0'; 140 buf[i] = '\0';
139 g_strchomp(buf); 141 g_strchomp(buf);
140 142
141 /* I'm a bastard again :-) */ 143 /* I'm a bastard again :-) */
142 printf("MSN: %s\n", buf); 144 printf("MSN: %s\n", buf);
145 printf("%s (%d)\n", strerror(errno), errno);
143 } 146 }
144 147
145 int msn_connect(char *server, int port) 148 int msn_connect(char *server, int port)
146 { 149 {
147 int fd; 150 int fd;
647 char *buf; 650 char *buf;
648 651
649 mdata = (struct msn_data *)gc->proto_data; 652 mdata = (struct msn_data *)gc->proto_data;
650 mc = find_msn_conn_by_user(who); 653 mc = find_msn_conn_by_user(who);
651 654
655 /* Are we trying to send a message to ourselves? Naughty us! */
656 if (!g_strcasecmp(who, gc->username)) {
657 do_error_dialog("You cannot send a message to yourself!!", "GAIM: Msn Error");
658 return;
659 }
660
652 if (mc == NULL) { 661 if (mc == NULL) {
653 gchar buf2[4096]; 662 gchar buf2[4096];
654 gchar *address; 663 gchar *address;
655 gchar *auth; 664 gchar *auth;
656 gchar **resps; 665 gchar **resps;
708 write(mc->fd, buf2, strlen(buf2)); 717 write(mc->fd, buf2, strlen(buf2));
709 718
710 /* FIXME: This causes a delay. I will make some sort of queing feature to prevent 719 /* FIXME: This causes a delay. I will make some sort of queing feature to prevent
711 * this from being needed */ 720 * this from being needed */
712 721
713 while (!strstr(buf2, "JOI")) { 722 while ((!strstr(buf2, "JOI")) && (!g_strncasecmp(buf2, "215", 3))) {
714 msn_read_line(&buf2, mc->fd); 723 msn_read_line(&buf2, mc->fd);
715 } 724 }
716 725
717 g_free(auth); 726 g_free(auth);
718 g_free(address); 727 g_free(address);