From: Eric W. <war...@us...> - 2001-10-27 01:58:15
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory usw-pr-cvs1:/tmp/cvs-serv9799/src/protocols/oscar Modified Files: CHANGES aim.h im.c Log Message: read CHANGES. Index: CHANGES =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/CHANGES,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CHANGES 2001/10/15 03:16:01 1.10 +++ CHANGES 2001/10/27 01:58:12 1.11 @@ -1,6 +1,9 @@ No release numbers ------------------ + - Fri Oct 26 15:18:10 PDT 2001 + - Fix buddy icons. (the checksum is only 16bits. hum.) + - Sun Oct 14 19:45:54 PDT 2001 - Fix aim_icq_setstatus - Minor touchups Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- aim.h 2001/10/15 03:16:01 1.10 +++ aim.h 2001/10/27 01:58:12 1.11 @@ -738,7 +738,7 @@ /* Only provided if AIM_IMFLAGS_HASICON is set */ time_t iconstamp; fu32_t iconlen; - fu32_t iconsum; + fu16_t iconsum; /* Only provided if AIM_IMFLAGS_CUSTOMFEATURES is set */ fu8_t *features; @@ -786,8 +786,8 @@ faim_export int aim_send_im_ext(aim_session_t *sess, aim_conn_t *conn, struct aim_sendimext_args *args); faim_export int aim_send_im(aim_session_t *, aim_conn_t *, const char *destsn, unsigned short flags, const char *msg); -faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu32_t iconsum); -faim_export fu32_t aim_iconsum(const fu8_t *buf, int buflen); +faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum); +faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen); faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg); faim_export const char *aim_directim_getsn(aim_conn_t *conn); faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, aim_conn_t *, const char *destsn); Index: im.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/im.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- im.c 2001/10/15 03:16:01 1.10 +++ im.c 2001/10/27 01:58:12 1.11 @@ -84,7 +84,7 @@ } /* This should be endian-safe now... but who knows... */ -faim_export fu32_t aim_iconsum(const fu8_t *buf, int buflen) +faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen) { fu32_t sum; int i; @@ -94,7 +94,7 @@ sum = ((sum & 0xffff0000) >> 16) + (sum & 0x0000ffff); - return sum; + return (fu16_t)sum; } /* @@ -314,7 +314,8 @@ aimbs_put16(&fr->data, 0x0008); aimbs_put16(&fr->data, 0x000c); aimbs_put32(&fr->data, args->iconlen); - aimbs_put32(&fr->data, args->iconsum); + aimbs_put16(&fr->data, 0x0001); + aimbs_put16(&fr->data, args->iconsum); aimbs_put32(&fr->data, args->iconstamp); } @@ -356,7 +357,7 @@ * This is also performance sensitive. (If you can believe it...) * */ -faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu32_t iconsum) +faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum) { int i; fu8_t ck[8]; @@ -418,7 +419,8 @@ /* TLV t(2711) */ aimbs_put16(&fr->data, 0x2711); aimbs_put16(&fr->data, 4+4+4+iconlen+strlen(AIM_ICONIDENT)); - aimbs_put32(&fr->data, iconsum); + aimbs_put16(&fr->data, 0x0000); + aimbs_put16(&fr->data, iconsum); aimbs_put32(&fr->data, iconlen); aimbs_put32(&fr->data, stamp); aimbs_putraw(&fr->data, icon, iconlen); @@ -854,8 +856,9 @@ } else if (type == 0x0008) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */ - args.iconsum = aimbs_get32(bs); args.iconlen = aimbs_get32(bs); + aimbs_get16(bs); /* 0x0001 */ + args.iconsum = aimbs_get16(bs); args.iconstamp = aimbs_get32(bs); args.icbmflags |= AIM_IMFLAGS_HASICON; |