Mercurial > pidgin
comparison libpurple/protocols/irc/msgs.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | fa666e7f747e |
children |
comparison
equal
deleted
inserted
replaced
32818:01ff09d4a463 | 32819:2c6510167895 |
---|---|
90 account = purple_connection_get_account(gc); | 90 account = purple_connection_get_account(gc); |
91 | 91 |
92 /* If we're away then set our away message */ | 92 /* If we're away then set our away message */ |
93 status = purple_account_get_active_status(irc->account); | 93 status = purple_account_get_active_status(irc->account); |
94 if (!purple_status_get_type(status) != PURPLE_STATUS_AVAILABLE) { | 94 if (!purple_status_get_type(status) != PURPLE_STATUS_AVAILABLE) { |
95 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); | 95 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
96 prpl_info->set_status(irc->account, status); | 96 prpl_info->set_status(irc->account, status); |
97 } | 97 } |
98 | 98 |
99 /* this used to be in the core, but it's not now */ | 99 /* this used to be in the core, but it's not now */ |
100 for (buddies = purple_find_buddies(account, NULL); buddies; | 100 for (buddies = purple_find_buddies(account, NULL); buddies; |
417 | 417 |
418 tmp2 = g_markup_escape_text(args[1], -1); | 418 tmp2 = g_markup_escape_text(args[1], -1); |
419 tmp = g_strdup_printf("%s%s%s", tmp2, | 419 tmp = g_strdup_printf("%s%s%s", tmp2, |
420 (irc->whois.ircop ? _(" <i>(ircop)</i>") : ""), | 420 (irc->whois.ircop ? _(" <i>(ircop)</i>") : ""), |
421 (irc->whois.identified ? _(" <i>(identified)</i>") : "")); | 421 (irc->whois.identified ? _(" <i>(identified)</i>") : "")); |
422 purple_notify_user_info_add_pair(user_info, _("Nick"), tmp); | 422 purple_notify_user_info_add_pair_html(user_info, _("Nick"), tmp); |
423 g_free(tmp2); | 423 g_free(tmp2); |
424 g_free(tmp); | 424 g_free(tmp); |
425 | 425 |
426 if (irc->whois.away) { | 426 if (irc->whois.away) { |
427 tmp = g_markup_escape_text(irc->whois.away, strlen(irc->whois.away)); | 427 purple_notify_user_info_add_pair_plaintext(user_info, _("Away"), irc->whois.away); |
428 g_free(irc->whois.away); | 428 g_free(irc->whois.away); |
429 purple_notify_user_info_add_pair(user_info, _("Away"), tmp); | |
430 g_free(tmp); | |
431 } | 429 } |
432 if (irc->whois.userhost) { | 430 if (irc->whois.userhost) { |
433 tmp = g_markup_escape_text(irc->whois.name, strlen(irc->whois.name)); | 431 purple_notify_user_info_add_pair_plaintext(user_info, _("Username"), irc->whois.userhost); |
432 purple_notify_user_info_add_pair_plaintext(user_info, _("Real name"), irc->whois.name); | |
433 g_free(irc->whois.userhost); | |
434 g_free(irc->whois.name); | 434 g_free(irc->whois.name); |
435 purple_notify_user_info_add_pair(user_info, _("Username"), irc->whois.userhost); | |
436 purple_notify_user_info_add_pair(user_info, _("Real name"), tmp); | |
437 g_free(irc->whois.userhost); | |
438 g_free(tmp); | |
439 } | 435 } |
440 if (irc->whois.server) { | 436 if (irc->whois.server) { |
441 tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo); | 437 tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo); |
442 purple_notify_user_info_add_pair(user_info, _("Server"), tmp); | 438 purple_notify_user_info_add_pair_plaintext(user_info, _("Server"), tmp); |
443 g_free(tmp); | 439 g_free(tmp); |
444 g_free(irc->whois.server); | 440 g_free(irc->whois.server); |
445 g_free(irc->whois.serverinfo); | 441 g_free(irc->whois.serverinfo); |
446 } | 442 } |
447 if (irc->whois.channels) { | 443 if (irc->whois.channels) { |
448 purple_notify_user_info_add_pair(user_info, _("Currently on"), irc->whois.channels->str); | 444 purple_notify_user_info_add_pair_plaintext(user_info, _("Currently on"), irc->whois.channels->str); |
449 g_string_free(irc->whois.channels, TRUE); | 445 g_string_free(irc->whois.channels, TRUE); |
450 } | 446 } |
451 if (irc->whois.idle) { | 447 if (irc->whois.idle) { |
452 gchar *timex = purple_str_seconds_to_string(irc->whois.idle); | 448 gchar *timex = purple_str_seconds_to_string(irc->whois.idle); |
453 purple_notify_user_info_add_pair(user_info, _("Idle for"), timex); | 449 purple_notify_user_info_add_pair_plaintext(user_info, _("Idle for"), timex); |
454 g_free(timex); | 450 g_free(timex); |
455 purple_notify_user_info_add_pair(user_info, | 451 purple_notify_user_info_add_pair_plaintext(user_info, |
456 _("Online since"), purple_date_format_full(localtime(&irc->whois.signon))); | 452 _("Online since"), purple_date_format_full(localtime(&irc->whois.signon))); |
457 } | 453 } |
458 if (!strcmp(irc->whois.nick, "Paco-Paco")) { | 454 if (!strcmp(irc->whois.nick, "elb")) { |
459 purple_notify_user_info_add_pair(user_info, | 455 purple_notify_user_info_add_pair_plaintext(user_info, |
460 _("<b>Defining adjective:</b>"), _("Glorious")); | 456 _("<b>Defining adjective:</b>"), _("Glorious")); |
461 } | 457 } |
462 | 458 |
463 gc = purple_account_get_connection(irc->account); | 459 gc = purple_account_get_connection(irc->account); |
464 | 460 |
526 g_list_free(values); | 522 g_list_free(values); |
527 | 523 |
528 g_free(userhost); | 524 g_free(userhost); |
529 g_free(realname); | 525 g_free(realname); |
530 | 526 |
531 flags = cb->flags; | 527 flags = purple_conv_chat_cb_get_flags(cb); |
532 | 528 |
533 /* FIXME: I'm not sure this is really a good idea, now | 529 /* FIXME: I'm not sure this is really a good idea, now |
534 * that we no longer do periodic WHO. It seems to me | 530 * that we no longer do periodic WHO. It seems to me |
535 * like it's more likely to be confusing than not. | 531 * like it's more likely to be confusing than not. |
536 * Comments? */ | 532 * Comments? */ |
537 if (args[6][0] == 'G' && !(flags & PURPLE_CBFLAGS_AWAY)) { | 533 if (args[6][0] == 'G' && !(flags & PURPLE_CBFLAGS_AWAY)) { |
538 purple_conv_chat_user_set_flags(chat, cb->name, flags | PURPLE_CBFLAGS_AWAY); | 534 purple_conv_chat_user_set_flags(chat, purple_conv_chat_cb_get_name(cb), flags | PURPLE_CBFLAGS_AWAY); |
539 } else if(args[6][0] == 'H' && (flags & PURPLE_CBFLAGS_AWAY)) { | 535 } else if(args[6][0] == 'H' && (flags & PURPLE_CBFLAGS_AWAY)) { |
540 purple_conv_chat_user_set_flags(chat, cb->name, flags & ~PURPLE_CBFLAGS_AWAY); | 536 purple_conv_chat_user_set_flags(chat, purple_conv_chat_cb_get_name(cb), flags & ~PURPLE_CBFLAGS_AWAY); |
541 } | 537 } |
542 } | 538 } |
543 } | 539 } |
544 | 540 |
545 void irc_msg_list(struct irc_conn *irc, const char *name, const char *from, char **args) | 541 void irc_msg_list(struct irc_conn *irc, const char *name, const char *from, char **args) |
1144 purple_notify_error(gc, _("Invalid nickname"), | 1140 purple_notify_error(gc, _("Invalid nickname"), |
1145 _("Invalid nickname"), | 1141 _("Invalid nickname"), |
1146 _("Your selected nickname was rejected by the server. It probably contains invalid characters.")); | 1142 _("Your selected nickname was rejected by the server. It probably contains invalid characters.")); |
1147 | 1143 |
1148 } else { | 1144 } else { |
1149 purple_connection_error_reason (gc, | 1145 purple_connection_error (gc, |
1150 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, | 1146 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, |
1151 _("Your selected account name was rejected by the server. It probably contains invalid characters.")); | 1147 _("Your selected account name was rejected by the server. It probably contains invalid characters.")); |
1152 } | 1148 } |
1153 } | 1149 } |
1154 | 1150 |