Mercurial > pidgin
comparison src/protocols/oscar/bart.c @ 11024:1d58cc6c4552
[gaim-migrate @ 12897]
sf patch #1222377, from Evan Schoenberg
"Improve buddy icon retrieval"
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 23 Jun 2005 02:24:22 +0000 |
parents | 8d74ae785a46 |
children |
comparison
equal
deleted
inserted
replaced
11023:9a99b0815459 | 11024:1d58cc6c4552 |
---|---|
74 * @param sn The screen name of the person who's icon you are requesting. | 74 * @param sn The screen name of the person who's icon you are requesting. |
75 * @param iconcsum The MD5 checksum of the icon you are requesting. | 75 * @param iconcsum The MD5 checksum of the icon you are requesting. |
76 * @param iconcsumlen Length of the MD5 checksum given above. Should be 10 bytes. | 76 * @param iconcsumlen Length of the MD5 checksum given above. Should be 10 bytes. |
77 * @return Return 0 if no errors, otherwise return the error number. | 77 * @return Return 0 if no errors, otherwise return the error number. |
78 */ | 78 */ |
79 faim_export int aim_bart_request(aim_session_t *sess, const char *sn, const fu8_t *iconcsum, fu16_t iconcsumlen) | 79 faim_export int aim_bart_request(aim_session_t *sess, const char *sn, fu8_t iconcsumtype, const fu8_t *iconcsum, fu16_t iconcsumlen) |
80 { | 80 { |
81 aim_conn_t *conn; | 81 aim_conn_t *conn; |
82 aim_frame_t *fr; | 82 aim_frame_t *fr; |
83 aim_snacid_t snacid; | 83 aim_snacid_t snacid; |
84 | 84 |
95 aimbs_putstr(&fr->data, sn); | 95 aimbs_putstr(&fr->data, sn); |
96 | 96 |
97 /* Some numbers. You like numbers, right? */ | 97 /* Some numbers. You like numbers, right? */ |
98 aimbs_put8(&fr->data, 0x01); | 98 aimbs_put8(&fr->data, 0x01); |
99 aimbs_put16(&fr->data, 0x0001); | 99 aimbs_put16(&fr->data, 0x0001); |
100 aimbs_put8(&fr->data, 0x01); | 100 aimbs_put8(&fr->data, iconcsumtype); |
101 | 101 |
102 /* Icon string */ | 102 /* Icon string */ |
103 aimbs_put8(&fr->data, iconcsumlen); | 103 aimbs_put8(&fr->data, iconcsumlen); |
104 aimbs_putraw(&fr->data, iconcsum, iconcsumlen); | 104 aimbs_putraw(&fr->data, iconcsum, iconcsumlen); |
105 | 105 |
117 { | 117 { |
118 int ret = 0; | 118 int ret = 0; |
119 aim_rxcallback_t userfunc; | 119 aim_rxcallback_t userfunc; |
120 char *sn; | 120 char *sn; |
121 fu16_t flags, iconlen; | 121 fu16_t flags, iconlen; |
122 fu8_t number, iconcsumlen, *iconcsum, *icon; | 122 fu8_t iconcsumtype, iconcsumlen, *iconcsum, *icon; |
123 | 123 |
124 sn = aimbs_getstr(bs, aimbs_get8(bs)); | 124 sn = aimbs_getstr(bs, aimbs_get8(bs)); |
125 flags = aimbs_get16(bs); | 125 flags = aimbs_get16(bs); |
126 number = aimbs_get8(bs); | 126 iconcsumtype = aimbs_get8(bs); |
127 iconcsumlen = aimbs_get8(bs); | 127 iconcsumlen = aimbs_get8(bs); |
128 iconcsum = aimbs_getraw(bs, iconcsumlen); | 128 iconcsum = aimbs_getraw(bs, iconcsumlen); |
129 iconlen = aimbs_get16(bs); | 129 iconlen = aimbs_get16(bs); |
130 icon = aimbs_getraw(bs, iconlen); | 130 icon = aimbs_getraw(bs, iconlen); |
131 | 131 |
132 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) | 132 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
133 ret = userfunc(sess, rx, sn, iconcsum, iconcsumlen, icon, iconlen); | 133 ret = userfunc(sess, rx, sn, iconcsumtype, iconcsum, iconcsumlen, icon, iconlen); |
134 | 134 |
135 free(sn); | 135 free(sn); |
136 free(iconcsum); | 136 free(iconcsum); |
137 free(icon); | 137 free(icon); |
138 | 138 |