Mercurial > pidgin
comparison src/protocols/yahoo/yahoo_filexfer.c @ 9306:04a3e9e869ee
[gaim-migrate @ 10114]
Ok, this is yahoo buddy icon uploading support.
It's still not quite right, but it mostly works.
We don't send out updates yet so changing it or unsetting it may not work.
But setting it initally, or changing it and relogging will probably work.
I never did figure out what hash function yahoo is using, so I just used
g_string_hash. It probably won't matter.
I hope to finish this up before release. But people probably won't notice
the bugs too much anyway. It shouldn't crash or anything, people just might
not always see your newest icon right away.
Have fun kids.
For the record, Simguy tells me Yahoo likes 96x96 PNGs.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Fri, 18 Jun 2004 07:28:25 +0000 |
parents | 9171e528d7e5 |
children | d27156c9c876 |
comparison
equal
deleted
inserted
replaced
9305:0c201a2386c7 | 9306:04a3e9e869ee |
---|---|
76 buf = g_strdup_printf("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n", xd->path, xd->host); | 76 buf = g_strdup_printf("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n", xd->path, xd->host); |
77 write(xfer->fd, buf, strlen(buf)); | 77 write(xfer->fd, buf, strlen(buf)); |
78 g_free(buf); | 78 g_free(buf); |
79 | 79 |
80 return; | 80 return; |
81 } | |
82 | |
83 static int yahoo_send_packet_special(int fd, struct yahoo_packet *pkt, int pad) | |
84 { | |
85 int pktlen = yahoo_packet_length(pkt); | |
86 int len = YAHOO_PACKET_HDRLEN + pktlen; | |
87 int ret; | |
88 | |
89 guchar *data; | |
90 int pos = 0; | |
91 | |
92 if (fd < 0) | |
93 return -1; | |
94 | |
95 data = g_malloc0(len + 1); | |
96 | |
97 memcpy(data + pos, "YMSG", 4); pos += 4; | |
98 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); | |
99 pos += yahoo_put16(data + pos, 0x0000); | |
100 pos += yahoo_put16(data + pos, pktlen + pad); | |
101 pos += yahoo_put16(data + pos, pkt->service); | |
102 pos += yahoo_put32(data + pos, pkt->status); | |
103 pos += yahoo_put32(data + pos, pkt->id); | |
104 | |
105 yahoo_packet_write(pkt, data + pos); | |
106 | |
107 ret = write(fd, data, len); | |
108 g_free(data); | |
109 | |
110 return ret; | |
111 } | 81 } |
112 | 82 |
113 static void yahoo_sendfile_connected(gpointer data, gint source, GaimInputCondition condition) | 83 static void yahoo_sendfile_connected(gpointer data, gint source, GaimInputCondition condition) |
114 { | 84 { |
115 GaimXfer *xfer; | 85 GaimXfer *xfer; |