Mercurial > pidgin
comparison plugins/irc.c @ 1012:7e8dcc609b30
[gaim-migrate @ 1022]
Small little bug fix. Man there's so much more that needs to be done.
committer: Tailor Script <tailor@pidgin.im>
| author | Rob Flynn <gaim@robflynn.com> |
|---|---|
| date | Fri, 20 Oct 2000 08:01:59 +0000 |
| parents | 4867280dbdc7 |
| children | bc4f6a535bd9 |
comparison
equal
deleted
inserted
replaced
| 1011:4867280dbdc7 | 1012:7e8dcc609b30 |
|---|---|
| 260 printf("IRC:'%'s\n", buf); | 260 printf("IRC:'%'s\n", buf); |
| 261 | 261 |
| 262 if ( (strstr(buf, " JOIN ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) { | 262 if ( (strstr(buf, " JOIN ")) && (buf[0] == ':') && (!strstr(buf, " NOTICE "))) { |
| 263 | 263 |
| 264 gchar u_channel[128]; | 264 gchar u_channel[128]; |
| 265 gchar u_nick[128]; | |
| 266 | |
| 265 struct irc_channel *channel; | 267 struct irc_channel *channel; |
| 266 int id; | 268 int id; |
| 267 int j; | 269 int j; |
| 268 | 270 |
| 269 for (j = 0, i = 1; buf[i] != '#'; j++, i++) { | 271 for (j = 0, i = 1; buf[i] != '!'; j++, i++) { |
| 272 u_nick[j] = buf[i]; | |
| 273 } | |
| 274 | |
| 275 u_nick[j] = '\0'; i++; | |
| 276 | |
| 277 for (j = 0; buf[i] != '#'; j++, i++) { | |
| 270 } | 278 } |
| 271 | 279 |
| 272 i++; | 280 i++; |
| 273 | 281 |
| 274 strcpy(u_channel, buf+i); | 282 strcpy(u_channel, buf+i); |
| 291 | 299 |
| 292 serv_got_joined_chat(gc, chat_id, u_channel); | 300 serv_got_joined_chat(gc, chat_id, u_channel); |
| 293 printf("IIII: I joined '%s' with a strlen() of '%d'\n", u_channel, strlen(u_channel)); | 301 printf("IIII: I joined '%s' with a strlen() of '%d'\n", u_channel, strlen(u_channel)); |
| 294 } else { | 302 } else { |
| 295 /* Someone else joined. */ | 303 /* Someone else joined. */ |
| 304 printf("%s has joined #%s\n", u_nick, u_channel); | |
| 296 } | 305 } |
| 297 | 306 |
| 298 return; | 307 return; |
| 299 } | 308 } |
| 300 | 309 |
| 349 printf("%s has left #%s\n", u_nick, u_channel); | 358 printf("%s has left #%s\n", u_nick, u_channel); |
| 350 | 359 |
| 351 return; | 360 return; |
| 352 } | 361 } |
| 353 | 362 |
| 354 if ( (strstr(buf, "PRIVMSG ")) && (buf[0] == ':')) { | 363 if ( (strstr(buf, " PRIVMSG ")) && (buf[0] == ':')) { |
| 355 gchar u_nick[128]; | 364 gchar u_nick[128]; |
| 356 gchar u_host[255]; | 365 gchar u_host[255]; |
| 357 gchar u_command[32]; | 366 gchar u_command[32]; |
| 358 gchar u_channel[128]; | 367 gchar u_channel[128]; |
| 359 gchar u_message[IRC_BUF_LEN]; | 368 gchar u_message[IRC_BUF_LEN]; |
| 413 serv_got_chat_in(gc, id, u_nick, 0, u_message); | 422 serv_got_chat_in(gc, id, u_nick, 0, u_message); |
| 414 } | 423 } |
| 415 } | 424 } |
| 416 else { | 425 else { |
| 417 /* Nope. Let's treat it as a private message */ | 426 /* Nope. Let's treat it as a private message */ |
| 418 printf("JUST GOT AN IM!!\n"); | |
| 419 serv_got_im(gc, u_nick, u_message, 0); | 427 serv_got_im(gc, u_nick, u_message, 0); |
| 420 } | 428 } |
| 421 | 429 |
| 422 return; | 430 return; |
| 423 } | 431 } |
