Mercurial > pidgin.yaz
changeset 5791:f5a4a17c58a5
[gaim-migrate @ 6216]
IRC works again.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 07 Jun 2003 05:53:57 +0000 |
parents | 995e63fb1a5a |
children | d89cadcafbec |
files | src/protocols/irc/irc.c |
diffstat | 1 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/irc/irc.c Sat Jun 07 05:52:31 2003 +0000 +++ b/src/protocols/irc/irc.c Sat Jun 07 05:53:57 2003 +0000 @@ -1872,13 +1872,9 @@ char hostname[256]; char buf[IRC_BUF_LEN]; char *test; + const char *alias; const char *charset = gaim_account_get_string(account, "charset", "UTF-8"); GError *err = NULL; - - if (!g_list_find(gaim_connections_get_all(), gc)) { - close(source); - return; - } idata = gc->proto_data; @@ -1902,11 +1898,13 @@ gethostname(hostname, sizeof(hostname) - 1); hostname[sizeof(hostname) - 1] = 0; + if (!*hostname) g_snprintf(hostname, sizeof(hostname), "localhost"); - if (gc->account->password != NULL) { - g_snprintf(buf, sizeof(buf), "PASS %s\r\n", gaim_account_get_password(account)); + if (gaim_account_get_password(account) != NULL) { + g_snprintf(buf, sizeof(buf), "PASS %s\r\n", + gaim_account_get_password(account)); if (irc_write(idata->fd, buf, strlen(buf)) < 0) { gaim_connection_error(gc, "Write error"); @@ -1914,16 +1912,21 @@ } } + alias = gaim_account_get_alias(account); + g_snprintf(buf, sizeof(buf), "USER %s %s %s :%s\r\n", g_get_user_name(), hostname, idata->server, - *gc->account->alias ? gc->account->alias : "gaim"); + (alias == NULL ? "gaim" : alias)); + if (irc_write(idata->fd, buf, strlen(buf)) < 0) { gaim_connection_error(gc, "Write error"); return; } - g_snprintf(buf, sizeof(buf), "NICK %s\r\n", gaim_connection_get_display_name(gc)); + g_snprintf(buf, sizeof(buf), "NICK %s\r\n", + gaim_connection_get_display_name(gc)); + if (irc_write(idata->fd, buf, strlen(buf)) < 0) { gaim_connection_error(gc, "Write error"); return; @@ -1964,7 +1967,7 @@ gaim_account_get_int(account, "port", 6667), irc_login_callback, gc); - if (!account->gc || (rc != 0)) { + if (rc != 0) { gaim_connection_error(gc, _("Unable to create socket")); return; }