comparison src/protocols/msn/msn.c @ 2773:a0fd8f91e294

[gaim-migrate @ 2786] SPAM!!! All recipients of the email generated by this commit each owe me $125 per email sent, plus a $75 handling fee for all messages combined. Or was that supposed to be the other way around. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 20 Nov 2001 01:01:22 +0000
parents 269fb9005d13
children b917845dad3c
comparison
equal deleted inserted replaced
2772:f9227268db25 2773:a0fd8f91e294
667 }; 667 };
668 668
669 static void msn_accept_add(gpointer w, struct msn_add_permit *map) 669 static void msn_accept_add(gpointer w, struct msn_add_permit *map)
670 { 670 {
671 struct msn_data *md = map->gc->proto_data; 671 struct msn_data *md = map->gc->proto_data;
672 char *user; 672 char buf[MSN_BUF_LEN];
673 char buf[MSN_BUF_LEN]; 673
674 674 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, map->user, url_encode(map->friend));
675 user = g_strdup(url_encode(map->user));
676 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, user, url_encode(map->friend));
677 g_free(user);
678 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 675 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
679 hide_login_progress(map->gc, "Write error"); 676 hide_login_progress(map->gc, "Write error");
680 signoff(map->gc); 677 signoff(map->gc);
681 return; 678 return;
682 } 679 }
1710 l = l->next; 1707 l = l->next;
1711 } 1708 }
1712 if (l) 1709 if (l)
1713 return; 1710 return;
1714 1711
1715 who = url_encode(who);
1716 g_snprintf(buf, sizeof(buf), "ADD %d FL %s %s\r\n", ++md->trId, who, who); 1712 g_snprintf(buf, sizeof(buf), "ADD %d FL %s %s\r\n", ++md->trId, who, who);
1717 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1713 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1718 hide_login_progress(gc, "Write error"); 1714 hide_login_progress(gc, "Write error");
1719 signoff(gc); 1715 signoff(gc);
1720 return; 1716 return;
1724 static void msn_rem_buddy(struct gaim_connection *gc, char *who, char *group) 1720 static void msn_rem_buddy(struct gaim_connection *gc, char *who, char *group)
1725 { 1721 {
1726 struct msn_data *md = gc->proto_data; 1722 struct msn_data *md = gc->proto_data;
1727 char buf[MSN_BUF_LEN]; 1723 char buf[MSN_BUF_LEN];
1728 1724
1729 who = url_encode(who);
1730 g_snprintf(buf, sizeof(buf), "REM %d FL %s\r\n", ++md->trId, who); 1725 g_snprintf(buf, sizeof(buf), "REM %d FL %s\r\n", ++md->trId, who);
1731 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1726 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1732 hide_login_progress(gc, "Write error"); 1727 hide_login_progress(gc, "Write error");
1733 signoff(gc); 1728 signoff(gc);
1734 return; 1729 return;
1836 s = s->next; 1831 s = s->next;
1837 if (!strchr(who, '@')) { 1832 if (!strchr(who, '@')) {
1838 t = g_slist_append(t, who); 1833 t = g_slist_append(t, who);
1839 continue; 1834 continue;
1840 } 1835 }
1841 who = url_encode(who);
1842 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); 1836 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
1843 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1837 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1844 hide_login_progress(gc, "Write error"); 1838 hide_login_progress(gc, "Write error");
1845 signoff(gc); 1839 signoff(gc);
1846 return; 1840 return;
1864 s = s->next; 1858 s = s->next;
1865 if (!strchr(who, '@')) { 1859 if (!strchr(who, '@')) {
1866 t = g_slist_append(t, who); 1860 t = g_slist_append(t, who);
1867 continue; 1861 continue;
1868 } 1862 }
1869 who = url_encode(who);
1870 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); 1863 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
1871 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1864 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1872 hide_login_progress(gc, "Write error"); 1865 hide_login_progress(gc, "Write error");
1873 signoff(gc); 1866 signoff(gc);
1874 return; 1867 return;
1896 gc->permit = g_slist_remove(gc->permit, who); 1889 gc->permit = g_slist_remove(gc->permit, who);
1897 g_free(who); 1890 g_free(who);
1898 return; 1891 return;
1899 } 1892 }
1900 1893
1901 who = url_encode(who);
1902 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who); 1894 g_snprintf(buf, sizeof(buf), "ADD %d AL %s %s\r\n", ++md->trId, who, who);
1903 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1895 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1904 hide_login_progress(gc, "Write error"); 1896 hide_login_progress(gc, "Write error");
1905 signoff(gc); 1897 signoff(gc);
1906 return; 1898 return;
1910 static void msn_rem_permit(struct gaim_connection *gc, char *who) 1902 static void msn_rem_permit(struct gaim_connection *gc, char *who)
1911 { 1903 {
1912 struct msn_data *md = gc->proto_data; 1904 struct msn_data *md = gc->proto_data;
1913 char buf[MSN_BUF_LEN]; 1905 char buf[MSN_BUF_LEN];
1914 1906
1915 who = url_encode(who);
1916 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who); 1907 g_snprintf(buf, sizeof(buf), "REM %d AL %s\r\n", ++md->trId, who);
1917 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1908 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1918 hide_login_progress(gc, "Write error"); 1909 hide_login_progress(gc, "Write error");
1919 signoff(gc); 1910 signoff(gc);
1920 return; 1911 return;
1931 gc->deny = g_slist_remove(gc->deny, who); 1922 gc->deny = g_slist_remove(gc->deny, who);
1932 g_free(who); 1923 g_free(who);
1933 return; 1924 return;
1934 } 1925 }
1935 1926
1936 who = url_encode(who);
1937 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who); 1927 g_snprintf(buf, sizeof(buf), "ADD %d BL %s %s\r\n", ++md->trId, who, who);
1938 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1928 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1939 hide_login_progress(gc, "Write error"); 1929 hide_login_progress(gc, "Write error");
1940 signoff(gc); 1930 signoff(gc);
1941 return; 1931 return;
1945 static void msn_rem_deny(struct gaim_connection *gc, char *who) 1935 static void msn_rem_deny(struct gaim_connection *gc, char *who)
1946 { 1936 {
1947 struct msn_data *md = gc->proto_data; 1937 struct msn_data *md = gc->proto_data;
1948 char buf[MSN_BUF_LEN]; 1938 char buf[MSN_BUF_LEN];
1949 1939
1950 who = url_encode(who);
1951 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who); 1940 g_snprintf(buf, sizeof(buf), "REM %d BL %s\r\n", ++md->trId, who);
1952 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1941 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1953 hide_login_progress(gc, "Write error"); 1942 hide_login_progress(gc, "Write error");
1954 signoff(gc); 1943 signoff(gc);
1955 return; 1944 return;