| 1810 gchar buf[1024]; |
1810 gchar buf[1024]; |
| 1811 gboolean off; |
1811 gboolean off; |
| 1812 |
1812 |
| 1813 i = read(idata->fd, buf, 1024); |
1813 i = read(idata->fd, buf, 1024); |
| 1814 if (i <= 0) { |
1814 if (i <= 0) { |
| 1815 gaim_connection_error(gc, "Read error"); |
1815 gaim_connection_error(gc, _("Read error")); |
| 1816 return; |
1816 return; |
| 1817 } |
1817 } |
| 1818 |
1818 |
| 1819 idata->rxqueue = g_realloc(idata->rxqueue, i + idata->rxlen + 1); |
1819 idata->rxqueue = g_realloc(idata->rxqueue, i + idata->rxlen + 1); |
| 1820 memcpy(idata->rxqueue + idata->rxlen, buf, i); |
1820 memcpy(idata->rxqueue + idata->rxlen, buf, i); |
| 1897 if (gaim_account_get_password(account) != NULL) { |
1897 if (gaim_account_get_password(account) != NULL) { |
| 1898 g_snprintf(buf, sizeof(buf), "PASS %s\r\n", |
1898 g_snprintf(buf, sizeof(buf), "PASS %s\r\n", |
| 1899 gaim_account_get_password(account)); |
1899 gaim_account_get_password(account)); |
| 1900 |
1900 |
| 1901 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
1901 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
| 1902 gaim_connection_error(gc, "Write error"); |
1902 gaim_connection_error(gc, _("Write error")); |
| 1903 return; |
1903 return; |
| 1904 } |
1904 } |
| 1905 } |
1905 } |
| 1906 |
1906 |
| 1907 alias = gaim_account_get_alias(account); |
1907 alias = gaim_account_get_alias(account); |
| 1910 g_get_user_name(), hostname, |
1910 g_get_user_name(), hostname, |
| 1911 idata->server, |
1911 idata->server, |
| 1912 (alias == NULL ? "gaim" : alias)); |
1912 (alias == NULL ? "gaim" : alias)); |
| 1913 |
1913 |
| 1914 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
1914 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
| 1915 gaim_connection_error(gc, "Write error"); |
1915 gaim_connection_error(gc, _("Write error")); |
| 1916 return; |
1916 return; |
| 1917 } |
1917 } |
| 1918 |
1918 |
| 1919 g_snprintf(buf, sizeof(buf), "NICK %s\r\n", |
1919 g_snprintf(buf, sizeof(buf), "NICK %s\r\n", |
| 1920 gaim_connection_get_display_name(gc)); |
1920 gaim_connection_get_display_name(gc)); |
| 1921 |
1921 |
| 1922 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
1922 if (irc_write(idata->fd, buf, strlen(buf)) < 0) { |
| 1923 gaim_connection_error(gc, "Write error"); |
1923 gaim_connection_error(gc, _("Write error")); |
| 1924 return; |
1924 return; |
| 1925 } |
1925 } |
| 1926 |
1926 |
| 1927 gc->inpa = gaim_input_add(idata->fd, GAIM_INPUT_READ, irc_callback, gc); |
1927 gc->inpa = gaim_input_add(idata->fd, GAIM_INPUT_READ, irc_callback, gc); |
| 1928 } |
1928 } |