comparison plugins/irc.c @ 1105:c964df5b2a84

[gaim-migrate @ 1115] Bugs, Schmugs. :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 19 Nov 2000 10:01:53 +0000
parents 79cdc86ef4c6
children 114cd406b022
comparison
equal deleted inserted replaced
1104:46c10fa4e557 1105:c964df5b2a84
119 return; 119 return;
120 120
121 idata->recblocks = 0; 121 idata->recblocks = 0;
122 idata->totalblocks = 1; 122 idata->totalblocks = 1;
123 123
124 /* First, let's check to see if we have anyone on our buddylist */
125 if (!grp) {
126 return;
127 }
128
124 /* Send the first part of our request */ 129 /* Send the first part of our request */
125 write(idata->fd, "ISON", 4); 130 write(idata->fd, "ISON", 4);
126 131
127 /* Step through our list of groups */ 132 /* Step through our list of groups */
128 while (grp) { 133 while (grp) {
356 do { 361 do {
357 status = recv(idata->fd, &c, 1, 0); 362 status = recv(idata->fd, &c, 1, 0);
358 363
359 if (!status) 364 if (!status)
360 { 365 {
361 exit(1); 366 return;
362 } 367 }
363 buf[i] = c; 368 buf[i] = c;
364 i++; 369 i++;
365 } while (c != '\n'); 370 } while (c != '\n');
366 371
372 /* For now, lets display everything to the console too. Im such 377 /* For now, lets display everything to the console too. Im such
373 * a bitch */ 378 * a bitch */
374 printf("IRC:'%'s\n", buf); 379 printf("IRC:'%'s\n", buf);
375 380
376 381
382
383 /* Check for errors */
384
385 if (((strstr(buf, "ERROR :") && (!strstr(buf, "PRIVMSG ")) &&
386 (!strstr(buf, "NOTICE ")) && (strlen(buf) > 7)))) {
387
388 gchar *u_errormsg;
389
390 /* Let's get our error message */
391 u_errormsg = strdup(buf + 7);
392
393 /* We got our error message. Now, let's reaise an
394 * error dialog */
395
396 do_error_dialog(u_errormsg, "Gaim: IRC Error");
397
398 /* And our necessary garbage collection */
399 free(u_errormsg);
400 }
401
377 /* Parse the list of names that we receive when we first sign on to 402 /* Parse the list of names that we receive when we first sign on to
378 * a channel */ 403 * a channel */
379 404
380 if (((strstr(buf, " 353 ")) && (!strstr(buf, "PRIVMSG")) && 405 if (((strstr(buf, " 353 ")) && (!strstr(buf, "PRIVMSG")) &&
381 (!strstr(buf, "NOTICE")))) { 406 (!strstr(buf, "NOTICE")))) {
864 889
865 /* This is where we will attempt to sign on */ 890 /* This is where we will attempt to sign on */
866 891
867 /* FIXME: This should be their servername, not their username. im just lazy right now */ 892 /* FIXME: This should be their servername, not their username. im just lazy right now */
868 893
869 g_snprintf(buf, 4096, "NICK %s\nUSER %s localhost %s :GAIM (www.marko.net/gaim)\n", gc->username, gc->username, gc->username); 894 g_snprintf(buf, 4096, "NICK %s\n USER %s localhost %s :GAIM (www.marko.net/gaim)\n", gc->username, getenv("USER"), user->proto_opt[0]);
895
896 printf("Sending: %s\n", buf);
870 write(idata->fd, buf, strlen(buf)); 897 write(idata->fd, buf, strlen(buf));
871
872 898
873 /* Now lets sign ourselves on */ 899 /* Now lets sign ourselves on */
874 account_online(gc); 900 account_online(gc);
875 serv_finish_login(gc); 901 serv_finish_login(gc);
876 902