comparison src/protocols/irc/irc.c @ 10002:8ba9a9048d73

[gaim-migrate @ 10919] Configurable realname for IRC committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Fri, 10 Sep 2004 01:43:41 +0000
parents d908907d9441
children c124bef68132
comparison
equal deleted inserted replaced
10001:4d2269c6c673 10002:8ba9a9048d73
272 { 272 {
273 GaimConnection *gc = data; 273 GaimConnection *gc = data;
274 struct irc_conn *irc = gc->proto_data; 274 struct irc_conn *irc = gc->proto_data;
275 char hostname[256]; 275 char hostname[256];
276 char *buf; 276 char *buf;
277 const char *username; 277 const char *username, *realname;
278 GList *connections = gaim_connections_get_all(); 278 GList *connections = gaim_connections_get_all();
279 279
280 if (source < 0) { 280 if (source < 0) {
281 gaim_connection_error(gc, _("Couldn't connect to host")); 281 gaim_connection_error(gc, _("Couldn't connect to host"));
282 return; 282 return;
299 } 299 }
300 300
301 gethostname(hostname, sizeof(hostname)); 301 gethostname(hostname, sizeof(hostname));
302 hostname[sizeof(hostname) - 1] = '\0'; 302 hostname[sizeof(hostname) - 1] = '\0';
303 username = gaim_account_get_string(irc->account, "username", ""); 303 username = gaim_account_get_string(irc->account, "username", "");
304 realname = gaim_account_get_string(irc->account, "realname", "");
304 buf = irc_format(irc, "vvvv:", "USER", strlen(username) ? username : g_get_user_name(), hostname, irc->server, 305 buf = irc_format(irc, "vvvv:", "USER", strlen(username) ? username : g_get_user_name(), hostname, irc->server,
305 gc->account->alias && *gc->account->alias ? gc->account->alias : IRC_DEFAULT_ALIAS); 306 strlen(realname) ? realname : IRC_DEFAULT_ALIAS);
306 if (irc_send(irc, buf) < 0) { 307 if (irc_send(irc, buf) < 0) {
307 gaim_connection_error(gc, "Error registering with server"); 308 gaim_connection_error(gc, "Error registering with server");
308 return; 309 return;
309 } 310 }
310 g_free(buf); 311 g_free(buf);
708 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 709 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
709 710
710 option = gaim_account_option_string_new(_("Username"), "username", ""); 711 option = gaim_account_option_string_new(_("Username"), "username", "");
711 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 712 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
712 713
714 option = gaim_account_option_string_new(_("Real name"), "realname", "");
715 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
716
713 _irc_plugin = plugin; 717 _irc_plugin = plugin;
714 718
715 irc_register_commands(); 719 irc_register_commands();
716 } 720 }
717 721