Mercurial > pidgin.yaz
comparison src/protocols/msn/msn.c @ 4056:4f3fb54ee669
[gaim-migrate @ 4266]
some _() and N_()'s from Nicol?s Lichtmaier
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Tue, 10 Dec 2002 14:19:26 +0000 |
parents | 133cf6424c53 |
children | 29401c9ccc2a |
comparison
equal
deleted
inserted
replaced
4055:caeef78fd198 | 4056:4f3fb54ee669 |
---|---|
792 char buf[MSN_BUF_LEN]; | 792 char buf[MSN_BUF_LEN]; |
793 | 793 |
794 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend)); | 794 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend)); |
795 | 795 |
796 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 796 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
797 hide_login_progress(map->gc, "Write error"); | 797 hide_login_progress(map->gc, _("Write error")); |
798 signoff(map->gc); | 798 signoff(map->gc); |
799 return; | 799 return; |
800 } | 800 } |
801 map->gc->permit = g_slist_append(map->gc->permit, map->user); | 801 map->gc->permit = g_slist_append(map->gc->permit, map->user); |
802 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */ | 802 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */ |
811 struct msn_data *md = map->gc->proto_data; | 811 struct msn_data *md = map->gc->proto_data; |
812 char buf[MSN_BUF_LEN]; | 812 char buf[MSN_BUF_LEN]; |
813 | 813 |
814 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend)); | 814 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend)); |
815 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 815 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
816 hide_login_progress(map->gc, "Write error"); | 816 hide_login_progress(map->gc, _("Write error")); |
817 signoff(map->gc); | 817 signoff(map->gc); |
818 return; | 818 return; |
819 } | 819 } |
820 map->gc->deny = g_slist_append(map->gc->deny, map->user); | 820 map->gc->deny = g_slist_append(map->gc->deny, map->user); |
821 build_block_list(); | 821 build_block_list(); |
910 g_snprintf(buf2, sizeof(buf2), "%02x", di[i]); | 910 g_snprintf(buf2, sizeof(buf2), "%02x", di[i]); |
911 strcat(sendbuf, buf2); | 911 strcat(sendbuf, buf2); |
912 } | 912 } |
913 | 913 |
914 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 914 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
915 hide_login_progress(gc, "Unable to write to server"); | 915 hide_login_progress(gc, _("Unable to write to server")); |
916 signoff(gc); | 916 signoff(gc); |
917 } | 917 } |
918 | 918 |
919 debug_printf("\n"); | 919 debug_printf("\n"); |
920 } else if (!g_strncasecmp(buf, "FLN", 3)) { | 920 } else if (!g_strncasecmp(buf, "FLN", 3)) { |
1027 if (pos != tot) | 1027 if (pos != tot) |
1028 return 1; /* this isn't the last one in the RL, so return. */ | 1028 return 1; /* this isn't the last one in the RL, so return. */ |
1029 | 1029 |
1030 g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId); | 1030 g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId); |
1031 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 1031 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
1032 hide_login_progress(gc, "Unable to write"); | 1032 hide_login_progress(gc, _("Unable to write")); |
1033 signoff(gc); | 1033 signoff(gc); |
1034 return 0; | 1034 return 0; |
1035 } | 1035 } |
1036 | 1036 |
1037 account_online(gc); | 1037 account_online(gc); |
1043 if (bud_list_cache_exists(gc)) | 1043 if (bud_list_cache_exists(gc)) |
1044 do_import(gc, NULL); | 1044 do_import(gc, NULL); |
1045 else { | 1045 else { |
1046 g_snprintf(sendbuf, sizeof(sendbuf), "BLP %d AL\r\n", ++md->trId); | 1046 g_snprintf(sendbuf, sizeof(sendbuf), "BLP %d AL\r\n", ++md->trId); |
1047 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 1047 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
1048 hide_login_progress(gc, "Unable to write"); | 1048 hide_login_progress(gc, _("Unable to write")); |
1049 signoff(gc); | 1049 signoff(gc); |
1050 return 0; | 1050 return 0; |
1051 } | 1051 } |
1052 } | 1052 } |
1053 while (md->fl) { | 1053 while (md->fl) { |
1253 char *tmp; | 1253 char *tmp; |
1254 | 1254 |
1255 if (!host) { | 1255 if (!host) { |
1256 host = strstr(buf, "NS"); | 1256 host = strstr(buf, "NS"); |
1257 if (!host) { | 1257 if (!host) { |
1258 hide_login_progress(gc, "Got invalid XFR\n"); | 1258 hide_login_progress(gc, _("Got invalid XFR\n")); |
1259 signoff(gc); | 1259 signoff(gc); |
1260 return 0; | 1260 return 0; |
1261 } | 1261 } |
1262 switchboard = FALSE; | 1262 switchboard = FALSE; |
1263 } | 1263 } |
1293 close(md->fd); | 1293 close(md->fd); |
1294 gaim_input_remove(md->inpa); | 1294 gaim_input_remove(md->inpa); |
1295 md->inpa = 0; | 1295 md->inpa = 0; |
1296 md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); | 1296 md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); |
1297 if (md->fd < 0) { | 1297 if (md->fd < 0) { |
1298 hide_login_progress(gc, "Error transfering"); | 1298 hide_login_progress(gc, _("Error transfering")); |
1299 signoff(gc); | 1299 signoff(gc); |
1300 return 0; | 1300 return 0; |
1301 } | 1301 } |
1302 } | 1302 } |
1303 } else if (isdigit(*buf)) { | 1303 } else if (isdigit(*buf)) { |
1461 | 1461 |
1462 if (md->fd != source) | 1462 if (md->fd != source) |
1463 md->fd = source; | 1463 md->fd = source; |
1464 | 1464 |
1465 if (md->fd == -1) { | 1465 if (md->fd == -1) { |
1466 hide_login_progress(gc, "Unable to connect to Notification Server"); | 1466 hide_login_progress(gc, _("Unable to connect to Notification Server")); |
1467 signoff(gc); | 1467 signoff(gc); |
1468 return; | 1468 return; |
1469 } | 1469 } |
1470 | 1470 |
1471 g_snprintf(buf, sizeof(buf), "VER %d MSNP5\r\n", ++md->trId); | 1471 g_snprintf(buf, sizeof(buf), "VER %d MSNP5\r\n", ++md->trId); |
1472 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 1472 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
1473 hide_login_progress(gc, "Unable to talk to Notification Server"); | 1473 hide_login_progress(gc, _("Unable to talk to Notification Server")); |
1474 signoff(gc); | 1474 signoff(gc); |
1475 return; | 1475 return; |
1476 } | 1476 } |
1477 | 1477 |
1478 md->inpa = gaim_input_add(md->fd, GAIM_INPUT_READ, msn_login_callback, gc); | 1478 md->inpa = gaim_input_add(md->fd, GAIM_INPUT_READ, msn_login_callback, gc); |
1484 char sendbuf[MSN_BUF_LEN]; | 1484 char sendbuf[MSN_BUF_LEN]; |
1485 | 1485 |
1486 if (!g_strncasecmp(buf, "VER", 3)) { | 1486 if (!g_strncasecmp(buf, "VER", 3)) { |
1487 /* we got VER, check to see that MSNP5 is in the list, then send INF */ | 1487 /* we got VER, check to see that MSNP5 is in the list, then send INF */ |
1488 if (!strstr(buf, "MSNP5")) { | 1488 if (!strstr(buf, "MSNP5")) { |
1489 hide_login_progress(gc, "Protocol not supported"); | 1489 hide_login_progress(gc, _("Protocol not supported")); |
1490 signoff(gc); | 1490 signoff(gc); |
1491 return 0; | 1491 return 0; |
1492 } | 1492 } |
1493 | 1493 |
1494 g_snprintf(sendbuf, sizeof(sendbuf), "INF %d\r\n", ++md->trId); | 1494 g_snprintf(sendbuf, sizeof(sendbuf), "INF %d\r\n", ++md->trId); |
1495 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 1495 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
1496 hide_login_progress(gc, "Unable to request INF\n"); | 1496 hide_login_progress(gc, _("Unable to request INF\n")); |
1497 signoff(gc); | 1497 signoff(gc); |
1498 return 0; | 1498 return 0; |
1499 } | 1499 } |
1500 } else if (!g_strncasecmp(buf, "INF", 3)) { | 1500 } else if (!g_strncasecmp(buf, "INF", 3)) { |
1501 /* check to make sure we can use md5 */ | 1501 /* check to make sure we can use md5 */ |
1502 if (!strstr(buf, "MD5")) { | 1502 if (!strstr(buf, "MD5")) { |
1503 hide_login_progress(gc, "Unable to login using MD5"); | 1503 hide_login_progress(gc, _("Unable to login using MD5")); |
1504 signoff(gc); | 1504 signoff(gc); |
1505 return 0; | 1505 return 0; |
1506 } | 1506 } |
1507 | 1507 |
1508 g_snprintf(sendbuf, sizeof(sendbuf), "USR %d MD5 I %s\r\n", ++md->trId, gc->username); | 1508 g_snprintf(sendbuf, sizeof(sendbuf), "USR %d MD5 I %s\r\n", ++md->trId, gc->username); |
1509 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 1509 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
1510 hide_login_progress(gc, "Unable to send USR\n"); | 1510 hide_login_progress(gc, _("Unable to send USR\n")); |
1511 signoff(gc); | 1511 signoff(gc); |
1512 return 0; | 1512 return 0; |
1513 } | 1513 } |
1514 | 1514 |
1515 set_login_progress(gc, 3, _("Requesting to send password")); | 1515 set_login_progress(gc, 3, _("Requesting to send password")); |
1528 if (!g_strcasecmp(resp, "OK")) { | 1528 if (!g_strcasecmp(resp, "OK")) { |
1529 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend); | 1529 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", friend); |
1530 | 1530 |
1531 g_snprintf(sendbuf, sizeof(sendbuf), "SYN %d 0\r\n", ++md->trId); | 1531 g_snprintf(sendbuf, sizeof(sendbuf), "SYN %d 0\r\n", ++md->trId); |
1532 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { | 1532 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { |
1533 hide_login_progress(gc, "Unable to write"); | 1533 hide_login_progress(gc, _("Unable to write")); |
1534 signoff(gc); | 1534 signoff(gc); |
1535 return 0; | 1535 return 0; |
1536 } | 1536 } |
1537 | 1537 |
1538 gaim_input_remove(md->inpa); | 1538 gaim_input_remove(md->inpa); |
1569 char *host = strstr(buf, "NS"); | 1569 char *host = strstr(buf, "NS"); |
1570 int port; | 1570 int port; |
1571 int i = 0; | 1571 int i = 0; |
1572 | 1572 |
1573 if (!host) { | 1573 if (!host) { |
1574 hide_login_progress(gc, "Got invalid XFR\n"); | 1574 hide_login_progress(gc, _("Got invalid XFR\n")); |
1575 signoff(gc); | 1575 signoff(gc); |
1576 return 0; | 1576 return 0; |
1577 } | 1577 } |
1578 | 1578 |
1579 GET_NEXT(host); | 1579 GET_NEXT(host); |
1590 md->inpa = 0; | 1590 md->inpa = 0; |
1591 md->fd = 0; | 1591 md->fd = 0; |
1592 md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); | 1592 md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc); |
1593 md->sl = time(NULL); | 1593 md->sl = time(NULL); |
1594 if (md->fd < 0) { | 1594 if (md->fd < 0) { |
1595 hide_login_progress(gc, "Unable to transfer"); | 1595 hide_login_progress(gc, _("Unable to transfer")); |
1596 signoff(gc); | 1596 signoff(gc); |
1597 } | 1597 } |
1598 return 0; | 1598 return 0; |
1599 } else { | 1599 } else { |
1600 if (isdigit(*buf)) | 1600 if (isdigit(*buf)) |
1601 hide_login_progress(gc, handle_errcode(buf, FALSE)); | 1601 hide_login_progress(gc, handle_errcode(buf, FALSE)); |
1602 else | 1602 else |
1603 hide_login_progress(gc, "Unable to parse message"); | 1603 hide_login_progress(gc, _("Unable to parse message")); |
1604 signoff(gc); | 1604 signoff(gc); |
1605 return 0; | 1605 return 0; |
1606 } | 1606 } |
1607 | 1607 |
1608 return 1; | 1608 return 1; |
1782 msn_kill_switch(ms); | 1782 msn_kill_switch(ms); |
1783 debug_printf("\n"); | 1783 debug_printf("\n"); |
1784 } else if (strcmp(who, gc->username)) { | 1784 } else if (strcmp(who, gc->username)) { |
1785 g_snprintf(buf, MSN_BUF_LEN, "XFR %d SB\r\n", ++md->trId); | 1785 g_snprintf(buf, MSN_BUF_LEN, "XFR %d SB\r\n", ++md->trId); |
1786 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 1786 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
1787 hide_login_progress(gc, "Write error"); | 1787 hide_login_progress(gc, _("Write error")); |
1788 signoff(gc); | 1788 signoff(gc); |
1789 return 1; | 1789 return 1; |
1790 } | 1790 } |
1791 | 1791 |
1792 ms = g_new0(struct msn_switchboard, 1); | 1792 ms = g_new0(struct msn_switchboard, 1); |
1900 else | 1900 else |
1901 away = "NLN"; | 1901 away = "NLN"; |
1902 | 1902 |
1903 g_snprintf(buf, sizeof(buf), "CHG %d %s\r\n", ++md->trId, away); | 1903 g_snprintf(buf, sizeof(buf), "CHG %d %s\r\n", ++md->trId, away); |
1904 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 1904 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
1905 hide_login_progress(gc, "Write error"); | 1905 hide_login_progress(gc, _("Write error")); |
1906 signoff(gc); | 1906 signoff(gc); |
1907 return; | 1907 return; |
1908 } | 1908 } |
1909 } | 1909 } |
1910 | 1910 |
1918 if (idle) | 1918 if (idle) |
1919 g_snprintf(buf, sizeof(buf), "CHG %d IDL\r\n", ++md->trId); | 1919 g_snprintf(buf, sizeof(buf), "CHG %d IDL\r\n", ++md->trId); |
1920 else | 1920 else |
1921 g_snprintf(buf, sizeof(buf), "CHG %d NLN\r\n", ++md->trId); | 1921 g_snprintf(buf, sizeof(buf), "CHG %d NLN\r\n", ++md->trId); |
1922 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 1922 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
1923 hide_login_progress(gc, "Write error"); | 1923 hide_login_progress(gc, _("Write error")); |
1924 signoff(gc); | 1924 signoff(gc); |
1925 return; | 1925 return; |
1926 } | 1926 } |
1927 } | 1927 } |
1928 | 1928 |
1941 | 1941 |
1942 static char *msn_get_away_text(int s) | 1942 static char *msn_get_away_text(int s) |
1943 { | 1943 { |
1944 switch (s) { | 1944 switch (s) { |
1945 case MSN_BUSY : | 1945 case MSN_BUSY : |
1946 return "Busy"; | 1946 return _("Busy"); |
1947 case MSN_BRB : | 1947 case MSN_BRB : |
1948 return "Be right back"; | 1948 return _("Be right back"); |
1949 case MSN_AWAY : | 1949 case MSN_AWAY : |
1950 return "Away from the computer"; | 1950 return _("Away from the computer"); |
1951 case MSN_PHONE : | 1951 case MSN_PHONE : |
1952 return "On the phone"; | 1952 return _("On the phone"); |
1953 case MSN_LUNCH : | 1953 case MSN_LUNCH : |
1954 return "Out to lunch"; | 1954 return _("Out to lunch"); |
1955 case MSN_IDLE : | 1955 case MSN_IDLE : |
1956 return "Idle"; | 1956 return _("Idle"); |
1957 default: | 1957 default: |
1958 return "Available"; | 1958 return _("Available"); |
1959 } | 1959 } |
1960 } | 1960 } |
1961 | 1961 |
1962 static void msn_reset_friend(struct gaim_connection *gc, char *who) | 1962 static void msn_reset_friend(struct gaim_connection *gc, char *who) |
1963 { | 1963 { |
2018 if (l) | 2018 if (l) |
2019 return; | 2019 return; |
2020 | 2020 |
2021 g_snprintf(buf, sizeof(buf), "ADD %d FL %s %s\r\n", ++md->trId, who, who); | 2021 g_snprintf(buf, sizeof(buf), "ADD %d FL %s %s\r\n", ++md->trId, who, who); |
2022 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2022 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2023 hide_login_progress(gc, "Write error"); | 2023 hide_login_progress(gc, _("Write error")); |
2024 signoff(gc); | 2024 signoff(gc); |
2025 return; | 2025 return; |
2026 } | 2026 } |
2027 } | 2027 } |
2028 | 2028 |
2031 struct msn_data *md = gc->proto_data; | 2031 struct msn_data *md = gc->proto_data; |
2032 char buf[MSN_BUF_LEN]; | 2032 char buf[MSN_BUF_LEN]; |
2033 | 2033 |
2034 g_snprintf(buf, sizeof(buf), "REM %d FL %s\r\n", ++md->trId, who); | 2034 g_snprintf(buf, sizeof(buf), "REM %d FL %s\r\n", ++md->trId, who); |
2035 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2035 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2036 hide_login_progress(gc, "Write error"); | 2036 hide_login_progress(gc, _("Write error")); |
2037 signoff(gc); | 2037 signoff(gc); |
2038 return; | 2038 return; |
2039 } | 2039 } |
2040 } | 2040 } |
2041 | 2041 |
2057 } | 2057 } |
2058 | 2058 |
2059 g_snprintf(buf, sizeof(buf), "REA %d %s %s\r\n", ++md->trId, gc->username, url_encode(alias)); | 2059 g_snprintf(buf, sizeof(buf), "REA %d %s %s\r\n", ++md->trId, gc->username, url_encode(alias)); |
2060 g_free(alias); | 2060 g_free(alias); |
2061 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2061 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2062 hide_login_progress(gc, "Write error"); | 2062 hide_login_progress(gc, _("Write error")); |
2063 signoff(gc); | 2063 signoff(gc); |
2064 return; | 2064 return; |
2065 } | 2065 } |
2066 } | 2066 } |
2067 | 2067 |
2087 static GList *msn_actions() | 2087 static GList *msn_actions() |
2088 { | 2088 { |
2089 GList *m = NULL; | 2089 GList *m = NULL; |
2090 | 2090 |
2091 m = g_list_append(m, _("Set Friendly Name")); | 2091 m = g_list_append(m, _("Set Friendly Name")); |
2092 m = g_list_append(m, "Reset All Friendly Names"); | 2092 m = g_list_append(m, _("Reset All Friendly Names")); |
2093 | 2093 |
2094 return m; | 2094 return m; |
2095 } | 2095 } |
2096 | 2096 |
2097 static void msn_convo_closed(struct gaim_connection *gc, char *who) | 2097 static void msn_convo_closed(struct gaim_connection *gc, char *who) |
2107 struct msn_data *md = gc->proto_data; | 2107 struct msn_data *md = gc->proto_data; |
2108 char buf[MSN_BUF_LEN]; | 2108 char buf[MSN_BUF_LEN]; |
2109 | 2109 |
2110 g_snprintf(buf, sizeof(buf), "PNG\r\n"); | 2110 g_snprintf(buf, sizeof(buf), "PNG\r\n"); |
2111 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2111 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2112 hide_login_progress(gc, "Write error"); | 2112 hide_login_progress(gc, _("Write error")); |
2113 signoff(gc); | 2113 signoff(gc); |
2114 return; | 2114 return; |
2115 } | 2115 } |
2116 } | 2116 } |
2117 | 2117 |
2125 g_snprintf(buf, sizeof(buf), "BLP %d AL\r\n", ++md->trId); | 2125 g_snprintf(buf, sizeof(buf), "BLP %d AL\r\n", ++md->trId); |
2126 else | 2126 else |
2127 g_snprintf(buf, sizeof(buf), "BLP %d BL\r\n", ++md->trId); | 2127 g_snprintf(buf, sizeof(buf), "BLP %d BL\r\n", ++md->trId); |
2128 | 2128 |
2129 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2129 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2130 hide_login_progress(gc, "Write error"); | 2130 hide_login_progress(gc, _("Write error")); |
2131 signoff(gc); | 2131 signoff(gc); |
2132 return; | 2132 return; |
2133 } | 2133 } |
2134 | 2134 |
2135 /* this is safe because we'll always come here after we've gotten the list off the server, | 2135 /* this is safe because we'll always come here after we've gotten the list off the server, |
2160 t = g_slist_append(t, who); | 2160 t = g_slist_append(t, who); |
2161 continue; | 2161 continue; |
2162 } | 2162 } |
2163 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); | 2163 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); |
2164 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2164 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2165 hide_login_progress(gc, "Write error"); | 2165 hide_login_progress(gc, _("Write error")); |
2166 signoff(gc); | 2166 signoff(gc); |
2167 return; | 2167 return; |
2168 } | 2168 } |
2169 } | 2169 } |
2170 while (t) { | 2170 while (t) { |
2194 t = g_slist_append(t, who); | 2194 t = g_slist_append(t, who); |
2195 continue; | 2195 continue; |
2196 } | 2196 } |
2197 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); | 2197 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); |
2198 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2198 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2199 hide_login_progress(gc, "Write error"); | 2199 hide_login_progress(gc, _("Write error")); |
2200 signoff(gc); | 2200 signoff(gc); |
2201 return; | 2201 return; |
2202 } | 2202 } |
2203 } | 2203 } |
2204 while (t) { | 2204 while (t) { |
2235 (GCompareFunc)strcmp))) { | 2235 (GCompareFunc)strcmp))) { |
2236 debug_printf("MSN: Moving %s from BL to AL\n", who); | 2236 debug_printf("MSN: Moving %s from BL to AL\n", who); |
2237 gc->deny = g_slist_remove(gc->deny, dupl); | 2237 gc->deny = g_slist_remove(gc->deny, dupl); |
2238 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who); | 2238 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who); |
2239 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2239 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2240 hide_login_progress(gc, "Write error"); | 2240 hide_login_progress(gc, _("Write error")); |
2241 signoff(gc); | 2241 signoff(gc); |
2242 return; | 2242 return; |
2243 } | 2243 } |
2244 } | 2244 } |
2245 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); | 2245 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); |
2246 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2246 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2247 hide_login_progress(gc, "Write error"); | 2247 hide_login_progress(gc, _("Write error")); |
2248 signoff(gc); | 2248 signoff(gc); |
2249 return; | 2249 return; |
2250 } | 2250 } |
2251 } | 2251 } |
2252 | 2252 |
2255 struct msn_data *md = gc->proto_data; | 2255 struct msn_data *md = gc->proto_data; |
2256 char buf[MSN_BUF_LEN]; | 2256 char buf[MSN_BUF_LEN]; |
2257 | 2257 |
2258 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who); | 2258 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who); |
2259 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2259 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2260 hide_login_progress(gc, "Write error"); | 2260 hide_login_progress(gc, _("Write error")); |
2261 signoff(gc); | 2261 signoff(gc); |
2262 return; | 2262 return; |
2263 } | 2263 } |
2264 | 2264 |
2265 g_slist_append(gc->deny, who); | 2265 g_slist_append(gc->deny, who); |
2266 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); | 2266 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); |
2267 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2267 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2268 hide_login_progress(gc, "Write error"); | 2268 hide_login_progress(gc, _("Write error")); |
2269 signoff(gc); | 2269 signoff(gc); |
2270 return; | 2270 return; |
2271 } | 2271 } |
2272 } | 2272 } |
2273 | 2273 |
2292 (GCompareFunc)strcmp))) { | 2292 (GCompareFunc)strcmp))) { |
2293 debug_printf("MSN: Moving %s from AL to BL\n", who); | 2293 debug_printf("MSN: Moving %s from AL to BL\n", who); |
2294 gc->permit = g_slist_remove(gc->permit, dupl); | 2294 gc->permit = g_slist_remove(gc->permit, dupl); |
2295 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who); | 2295 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who); |
2296 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2296 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2297 hide_login_progress(gc, "Write error"); | 2297 hide_login_progress(gc, _("Write error")); |
2298 signoff(gc); | 2298 signoff(gc); |
2299 return; | 2299 return; |
2300 } | 2300 } |
2301 } | 2301 } |
2302 | 2302 |
2303 | 2303 |
2304 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); | 2304 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); |
2305 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2305 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2306 hide_login_progress(gc, "Write error"); | 2306 hide_login_progress(gc, _("Write error")); |
2307 signoff(gc); | 2307 signoff(gc); |
2308 return; | 2308 return; |
2309 } | 2309 } |
2310 } | 2310 } |
2311 | 2311 |
2314 struct msn_data *md = gc->proto_data; | 2314 struct msn_data *md = gc->proto_data; |
2315 char buf[MSN_BUF_LEN]; | 2315 char buf[MSN_BUF_LEN]; |
2316 | 2316 |
2317 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who); | 2317 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who); |
2318 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2318 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2319 hide_login_progress(gc, "Write error"); | 2319 hide_login_progress(gc, _("Write error")); |
2320 signoff(gc); | 2320 signoff(gc); |
2321 return; | 2321 return; |
2322 } | 2322 } |
2323 | 2323 |
2324 g_slist_append(gc->permit, who); | 2324 g_slist_append(gc->permit, who); |
2325 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); | 2325 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); |
2326 if (msn_write(md->fd, buf, strlen(buf)) < 0) { | 2326 if (msn_write(md->fd, buf, strlen(buf)) < 0) { |
2327 hide_login_progress(gc, "Write error"); | 2327 hide_login_progress(gc, _("Write error")); |
2328 signoff(gc); | 2328 signoff(gc); |
2329 return; | 2329 return; |
2330 } | 2330 } |
2331 } | 2331 } |
2332 | 2332 |