changeset 2626:93f9bbd62630

[gaim-migrate @ 2639] read CHANGES. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 27 Oct 2001 01:58:12 +0000
parents d8d2df2bdf01
children f119632012bc
files src/protocols/oscar/CHANGES src/protocols/oscar/aim.h src/protocols/oscar/im.c
diffstat 3 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/CHANGES	Sat Oct 27 00:12:14 2001 +0000
+++ b/src/protocols/oscar/CHANGES	Sat Oct 27 01:58:12 2001 +0000
@@ -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
--- a/src/protocols/oscar/aim.h	Sat Oct 27 00:12:14 2001 +0000
+++ b/src/protocols/oscar/aim.h	Sat Oct 27 01:58:12 2001 +0000
@@ -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);
--- a/src/protocols/oscar/im.c	Sat Oct 27 00:12:14 2001 +0000
+++ b/src/protocols/oscar/im.c	Sat Oct 27 01:58:12 2001 +0000
@@ -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;