Mercurial > pidgin
comparison plugins/irc.c @ 1017:bbd0d51b7d14
[gaim-migrate @ 1027]
GAIM now responds to /version and /ping requests.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sun, 22 Oct 2000 04:14:36 +0000 |
parents | bc4f6a535bd9 |
children | 1c253f8a117c |
comparison
equal
deleted
inserted
replaced
1016:661ac77ccd1b | 1017:bbd0d51b7d14 |
---|---|
531 /* Now that everything is parsed, the rest of this baby must be our message */ | 531 /* Now that everything is parsed, the rest of this baby must be our message */ |
532 strncpy(u_message, buf + i, IRC_BUF_LEN); | 532 strncpy(u_message, buf + i, IRC_BUF_LEN); |
533 | 533 |
534 /* Now, lets check the message to see if there's anything special in it */ | 534 /* Now, lets check the message to see if there's anything special in it */ |
535 if (u_message[0] == '\001') { | 535 if (u_message[0] == '\001') { |
536 if (g_strncasecmp(u_message, "\001VERSION", 8) == 0) { | |
537 /* Looks like we have a version request. Let | |
538 * us handle it thusly */ | |
539 | |
540 g_snprintf(buf, IRC_BUF_LEN, "NOTICE %s :%cVERSION GAIM %s:The Pimpin Penguin AIM Clone:www.marko.net/gaim%c\n", u_nick, '\001', VERSION, '\001'); | |
541 | |
542 write(idata->fd, buf, strlen(buf)); | |
543 | |
544 /* And get the heck out of dodge */ | |
545 return; | |
546 } | |
547 | |
548 if ((g_strncasecmp(u_message, "\001PING ", 6) == 0) && (strlen(u_message) > 6)) { | |
549 /* Someone's triyng to ping us. Let's respond */ | |
550 gchar u_arg[24]; | |
551 | |
552 strcpy(u_arg, u_message + 6); | |
553 u_arg[strlen(u_arg)-1] = '\0'; | |
554 | |
555 g_snprintf(buf, IRC_BUF_LEN, "NOTICE %s :%cPING %s%c\n", u_nick, '\001', u_arg, '\001'); | |
556 | |
557 write(idata->fd, buf, strlen(buf)); | |
558 | |
559 /* And get the heck out of dodge */ | |
560 return; | |
561 } | |
562 | |
536 if (g_strncasecmp(u_message, "\001ACTION ", 8) == 0) { | 563 if (g_strncasecmp(u_message, "\001ACTION ", 8) == 0) { |
537 /* Looks like we have an action. Let's parse it a little */ | 564 /* Looks like we have an action. Let's parse it a little */ |
538 strcpy(buf, u_message); | 565 strcpy(buf, u_message); |
539 | 566 |
540 strcpy(u_message, "/me "); | 567 strcpy(u_message, "/me "); |