| 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 |
351 |
| 351 if (pass && *pass) { |
352 if (pass && *pass) { |
| 352 buf = irc_format(irc, "vv", "PASS", pass); |
353 buf = irc_format(irc, "vv", "PASS", pass); |
| 353 if (irc_send(irc, buf) < 0) { |
354 if (irc_send(irc, buf) < 0) { |
| 354 /* purple_connection_error(gc, "Error sending password"); */ |
355 /* purple_connection_error(gc, "Error sending password"); */ |
| 357 } |
358 } |
| 358 g_free(buf); |
359 g_free(buf); |
| 359 } |
360 } |
| 360 |
361 |
| 361 |
362 |
| 362 gethostname(hostname, sizeof(hostname)); |
363 ret = gethostname(hostname, sizeof(hostname)); |
| 363 hostname[sizeof(hostname) - 1] = '\0'; |
364 hostname[sizeof(hostname) - 1] = '\0'; |
| |
365 if (ret < 0 || hostname[0] == '\0') { |
| |
366 purple_debug_warning("irc", "gethostname() failed -- is your hostname set?"); |
| |
367 strcpy(hostname, "localhost"); |
| |
368 } |
| 364 realname = purple_account_get_string(irc->account, "realname", ""); |
369 realname = purple_account_get_string(irc->account, "realname", ""); |
| 365 username = purple_account_get_string(irc->account, "username", ""); |
370 username = purple_account_get_string(irc->account, "username", ""); |
| 366 |
371 |
| 367 if (username == NULL || *username == '\0') { |
372 if (username == NULL || *username == '\0') { |
| 368 username = g_get_user_name(); |
373 username = g_get_user_name(); |