| 267 chat = purple_conversations_find_chat_with_account(args[1], irc->account); |
267 chat = purple_conversations_find_chat_with_account(args[1], irc->account); |
| 268 |
268 |
| 269 if (!strcmp(name, "367")) { |
269 if (!strcmp(name, "367")) { |
| 270 char *msg = NULL; |
270 char *msg = NULL; |
| 271 /* Ban list entry */ |
271 /* Ban list entry */ |
| 272 g_return_if_fail(args[2]); |
|
| 273 if (args[3] && args[4]) { |
272 if (args[3] && args[4]) { |
| 274 /* This is an extended syntax, not in RFC 1459 */ |
273 /* This is an extended syntax, not in RFC 1459 */ |
| 275 int t1 = atoi(args[4]); |
274 int t1 = atoi(args[4]); |
| 276 time_t t2 = time(NULL); |
275 time_t t2 = time(NULL); |
| 277 char *time = purple_str_seconds_to_string(t2 - t1); |
276 char *time = purple_str_seconds_to_string(t2 - t1); |
| 364 } |
363 } |
| 365 |
364 |
| 366 if (!strcmp(name, "301")) { |
365 if (!strcmp(name, "301")) { |
| 367 irc->whois.away = g_strdup(args[2]); |
366 irc->whois.away = g_strdup(args[2]); |
| 368 } else if (!strcmp(name, "311") || !strcmp(name, "314")) { |
367 } else if (!strcmp(name, "311") || !strcmp(name, "314")) { |
| 369 irc->whois.userhost = g_strdup_printf("%s@%s", args[2], args[3]); |
368 irc->whois.ident = g_strdup(args[2]); |
| 370 irc->whois.name = g_strdup(args[5]); |
369 irc->whois.host = g_strdup(args[3]); |
| |
370 irc->whois.real = g_strdup(args[5]); |
| 371 } else if (!strcmp(name, "312")) { |
371 } else if (!strcmp(name, "312")) { |
| 372 irc->whois.server = g_strdup(args[2]); |
372 irc->whois.server = g_strdup(args[2]); |
| 373 irc->whois.serverinfo = g_strdup(args[3]); |
373 irc->whois.serverinfo = g_strdup(args[3]); |
| 374 } else if (!strcmp(name, "313")) { |
374 } else if (!strcmp(name, "313")) { |
| 375 irc->whois.ircop = 1; |
375 irc->whois.ircop = 1; |
| 383 } else { |
383 } else { |
| 384 irc->whois.channels = g_string_append(irc->whois.channels, args[2]); |
384 irc->whois.channels = g_string_append(irc->whois.channels, args[2]); |
| 385 } |
385 } |
| 386 } else if (!strcmp(name, "320")) { |
386 } else if (!strcmp(name, "320")) { |
| 387 irc->whois.identified = 1; |
387 irc->whois.identified = 1; |
| |
388 } else if (!strcmp(name, "330")) { |
| |
389 purple_debug(PURPLE_DEBUG_INFO, "irc", "330 %s: 1=[%s] 2=[%s] 3=[%s]", |
| |
390 name, args[1], args[2], args[3]); |
| |
391 if (!strcmp(args[3], "is logged in as")) |
| |
392 irc->whois.login = g_strdup(args[2]); |
| 388 } |
393 } |
| 389 } |
394 } |
| 390 |
395 |
| 391 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args) |
396 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args) |
| 392 { |
397 { |
| 417 |
422 |
| 418 if (irc->whois.away) { |
423 if (irc->whois.away) { |
| 419 purple_notify_user_info_add_pair_plaintext(user_info, _("Away"), irc->whois.away); |
424 purple_notify_user_info_add_pair_plaintext(user_info, _("Away"), irc->whois.away); |
| 420 g_free(irc->whois.away); |
425 g_free(irc->whois.away); |
| 421 } |
426 } |
| 422 if (irc->whois.userhost) { |
427 if (irc->whois.real) { |
| 423 purple_notify_user_info_add_pair_plaintext(user_info, _("Username"), irc->whois.userhost); |
428 purple_notify_user_info_add_pair_plaintext(user_info, _("Real name"), irc->whois.real); |
| 424 purple_notify_user_info_add_pair_plaintext(user_info, _("Real name"), irc->whois.name); |
429 g_free(irc->whois.real); |
| 425 g_free(irc->whois.userhost); |
430 } |
| 426 g_free(irc->whois.name); |
431 if (irc->whois.login) { |
| |
432 purple_notify_user_info_add_pair_plaintext(user_info, _("Login name"), irc->whois.login); |
| |
433 g_free(irc->whois.login); |
| |
434 } |
| |
435 if (irc->whois.ident) { |
| |
436 purple_notify_user_info_add_pair_plaintext(user_info, _("Ident name"), irc->whois.ident); |
| |
437 g_free(irc->whois.ident); |
| |
438 } |
| |
439 if (irc->whois.host) { |
| |
440 purple_notify_user_info_add_pair_plaintext(user_info, _("Host name"), irc->whois.host); |
| |
441 g_free(irc->whois.host); |
| 427 } |
442 } |
| 428 if (irc->whois.server) { |
443 if (irc->whois.server) { |
| 429 tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo); |
444 tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo); |
| 430 purple_notify_user_info_add_pair_plaintext(user_info, _("Server"), tmp); |
445 purple_notify_user_info_add_pair_plaintext(user_info, _("Server"), tmp); |
| 431 g_free(tmp); |
446 g_free(tmp); |
| 548 { |
563 { |
| 549 char *chan, *topic, *msg, *nick, *tmp, *tmp2; |
564 char *chan, *topic, *msg, *nick, *tmp, *tmp2; |
| 550 PurpleChatConversation *chat; |
565 PurpleChatConversation *chat; |
| 551 |
566 |
| 552 if (!strcmp(name, "topic")) { |
567 if (!strcmp(name, "topic")) { |
| 553 g_return_if_fail(args[0]); |
|
| 554 g_return_if_fail(args[1]); |
|
| 555 chan = args[0]; |
568 chan = args[0]; |
| 556 topic = irc_mirc2txt (args[1]); |
569 topic = irc_mirc2txt (args[1]); |
| 557 } else { |
570 } else { |
| 558 g_return_if_fail(args[1]); |
|
| 559 g_return_if_fail(args[2]); |
|
| 560 chan = args[1]; |
571 chan = args[1]; |
| 561 topic = irc_mirc2txt (args[2]); |
572 topic = irc_mirc2txt (args[2]); |
| 562 } |
573 } |
| 563 |
574 |
| 564 chat = purple_conversations_find_chat_with_account(chan, irc->account); |
575 chat = purple_conversations_find_chat_with_account(chan, irc->account); |