libpurple/protocols/irc/irc.c

changeset 19785
d0dd00294c4b
parent 19784
04904e614e47
child 19859
71d37b57eff2
equal deleted inserted replaced
19784:04904e614e47 19785:d0dd00294c4b
345 char *buf, *tmp = NULL; 345 char *buf, *tmp = NULL;
346 char hostname[256]; 346 char hostname[256];
347 const char *username, *realname; 347 const char *username, *realname;
348 struct irc_conn *irc = gc->proto_data; 348 struct irc_conn *irc = gc->proto_data;
349 const char *pass = purple_connection_get_password(gc); 349 const char *pass = purple_connection_get_password(gc);
350 int ret; 350 int ret;
351 351
352 if (pass && *pass) { 352 if (pass && *pass) {
353 buf = irc_format(irc, "vv", "PASS", pass); 353 buf = irc_format(irc, "vv", "PASS", pass);
354 if (irc_send(irc, buf) < 0) { 354 if (irc_send(irc, buf) < 0) {
355 /* purple_connection_error(gc, "Error sending password"); */ 355 /* purple_connection_error(gc, "Error sending password"); */
360 } 360 }
361 361
362 362
363 ret = gethostname(hostname, sizeof(hostname)); 363 ret = gethostname(hostname, sizeof(hostname));
364 hostname[sizeof(hostname) - 1] = '\0'; 364 hostname[sizeof(hostname) - 1] = '\0';
365 if (ret < 0 || hostname[0] == '\0') { 365 if (ret < 0 || hostname[0] == '\0') {
366 purple_debug_warning("irc", "gethostname() failed -- is your hostname set?"); 366 purple_debug_warning("irc", "gethostname() failed -- is your hostname set?");
367 strcpy(hostname, "localhost"); 367 strcpy(hostname, "localhost");
368 } 368 }
369 realname = purple_account_get_string(irc->account, "realname", ""); 369 realname = purple_account_get_string(irc->account, "realname", "");
370 username = purple_account_get_string(irc->account, "username", ""); 370 username = purple_account_get_string(irc->account, "username", "");
371 371
372 if (username == NULL || *username == '\0') { 372 if (username == NULL || *username == '\0') {
373 username = g_get_user_name(); 373 username = g_get_user_name();

mercurial