Mercurial > pidgin
comparison src/protocols/yahoo/yahoo.c @ 9281:adde46ad65e9
[gaim-migrate @ 10084]
This keeps track of IP addresses that other clients send us, and displays
them in the Get Info dialog. Eventually we'll want to do other stuff with
them, probably.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Mon, 14 Jun 2004 07:05:10 +0000 |
parents | 2104c1039626 |
children | 66ff39319900 |
comparison
equal
deleted
inserted
replaced
9280:2104c1039626 | 9281:adde46ad65e9 |
---|---|
1826 | 1826 |
1827 l = l->next; | 1827 l = l->next; |
1828 } | 1828 } |
1829 | 1829 |
1830 if (base64) { | 1830 if (base64) { |
1831 guint32 ip; | |
1832 char *tmp2; | |
1833 YahooFriend *f; | |
1834 | |
1831 gaim_base64_decode(base64, &decoded, &len); | 1835 gaim_base64_decode(base64, &decoded, &len); |
1832 if (len) { | 1836 if (len) { |
1833 char *tmp = gaim_str_binary_to_ascii(decoded, len); | 1837 char *tmp = gaim_str_binary_to_ascii(decoded, len); |
1834 gaim_debug_info("yahoo", "Got P2P service packet (from server): who = %s, ip = %s\n", who, tmp); | 1838 gaim_debug_info("yahoo", "Got P2P service packet (from server): who = %s, ip = %s\n", who, tmp); |
1835 g_free(tmp); | 1839 g_free(tmp); |
1836 } | 1840 } |
1841 | |
1842 tmp2 = g_strndup(decoded, len); /* so its \0 terminated...*/ | |
1843 ip = strtol(tmp2, NULL, 10); | |
1844 g_free(tmp2); | |
1837 g_free(decoded); | 1845 g_free(decoded); |
1846 tmp2 = g_strdup_printf("%u.%u.%u.%u", ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff, | |
1847 (ip >> 24) & 0xff); | |
1848 f = yahoo_friend_find(gc, who); | |
1849 if (f) | |
1850 yahoo_friend_set_ip(f, tmp2); | |
1851 g_free(tmp2); | |
1838 } | 1852 } |
1839 } | 1853 } |
1840 | 1854 |
1841 static void yahoo_packet_process(GaimConnection *gc, struct yahoo_packet *pkt) | 1855 static void yahoo_packet_process(GaimConnection *gc, struct yahoo_packet *pkt) |
1842 { | 1856 { |