src/protocols/irc/irc.c

changeset 6321
0b54b2a172d1
parent 6270
e3cb3b0c6c82
child 6333
551f4a5b3c33
equal deleted inserted replaced
6320:d220a4d78795 6321:0b54b2a172d1
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);
1869 GError *err = NULL; 1869 GError *err = NULL;
1870 1870
1871 idata = gc->proto_data; 1871 idata = gc->proto_data;
1872 1872
1873 if (source < 0) { 1873 if (source < 0) {
1874 gaim_connection_error(gc, "Write error"); 1874 gaim_connection_error(gc, _("Write error"));
1875 return; 1875 return;
1876 } 1876 }
1877 idata->fd = source; 1877 idata->fd = source;
1878 1878
1879 /* Try a quick conversion to see if the specified encoding is OK */ 1879 /* Try a quick conversion to see if the specified encoding is OK */
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 }

mercurial