changeset 2196:016c5307f26b

[gaim-migrate @ 2206] thanks adam committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 30 Aug 2001 00:19:06 +0000
parents d615f7e2d8c4
children 8f1ca76e46f5
files src/protocols/oscar/CHANGES src/protocols/oscar/aim.h src/protocols/oscar/im.c src/protocols/oscar/oscar.c
diffstat 4 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/CHANGES	Thu Aug 30 00:04:54 2001 +0000
+++ b/src/protocols/oscar/CHANGES	Thu Aug 30 00:19:06 2001 +0000
@@ -1,6 +1,11 @@
 
 No release numbers
 ------------------
+ - Wed Aug 29 16:59:24 PDT 2001
+  - Pass up entire icon triplet (checksum/length/timestamp) in all cases
+     that it is recieved.
+  - Eric was paying more attention than I am.
+
  - Sat Aug 25 19:46:38 PDT 2001
   - Pass "Maximum visible message length" to client in chat info update
     - This is the real maximum message length now.  There is still a
--- a/src/protocols/oscar/aim.h	Thu Aug 30 00:04:54 2001 +0000
+++ b/src/protocols/oscar/aim.h	Thu Aug 30 00:19:06 2001 +0000
@@ -674,6 +674,8 @@
 	int finlen;
 	unsigned char fingerprint[10];
 	time_t iconstamp;
+	unsigned long iconlength;
+	unsigned long iconchecksum;  
 	int extdatalen;
 	unsigned char *extdata;
 };
@@ -683,6 +685,7 @@
 	unsigned short status;
 	union {
 		struct {
+			unsigned long checksum;
 			unsigned int length;
 			time_t timestamp;
 			unsigned char *icon;
--- a/src/protocols/oscar/im.c	Thu Aug 30 00:04:54 2001 +0000
+++ b/src/protocols/oscar/im.c	Thu Aug 30 00:19:06 2001 +0000
@@ -578,6 +578,8 @@
 
 		} else if ((type == 0x0008) && (length == 0x000c)) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */
 
+			args.iconchecksum = aimutil_get32(data+i);
+			args.iconlength = aimutil_get32(data+i+4);
 			args.iconstamp = aimutil_get32(data+i+8);
 			args.icbmflags |= AIM_IMFLAGS_HASICON;
 
@@ -655,11 +657,11 @@
 	}
 
 	/* 
-	* What follows may be TLVs or nothing, depending on the
-	* purpose of the message.
-	*
-	* Ack packets for instance have nothing more to them.
-	*/
+	 * What follows may be TLVs or nothing, depending on the
+	 * purpose of the message.
+	 *
+	 * Ack packets for instance have nothing more to them.
+	 */
 	list2 = aim_readtlvchain(block1->value+2+8+16, block1->length-2-8-16);
 
 	if (!list2 || ((args.reqclass != AIM_CAPS_IMIMAGE) && !(aim_gettlv(list2, 0x2711, 1)))) {
@@ -719,7 +721,7 @@
 
 		miscinfo = aim_gettlv(list2, 0x2711, 1);
 
-		/* aimutil_get32(miscinfo->value+curpos); i don't know what this is */
+		args.info.icon.checksum = aimutil_get32(miscinfo->value+curpos);
 		curpos += 4;
 		args.info.icon.length = aimutil_get32(miscinfo->value+curpos);
 		curpos += 4;
--- a/src/protocols/oscar/oscar.c	Thu Aug 30 00:04:54 2001 +0000
+++ b/src/protocols/oscar/oscar.c	Thu Aug 30 00:19:06 2001 +0000
@@ -116,6 +116,7 @@
 struct icon_req {
 	char *user;
 	time_t timestamp;
+	unsigned long length;
 	unsigned long checksum;
 	gboolean request;
 };
@@ -1274,8 +1275,12 @@
 				ir->user = g_strdup(who);
 				od->hasicons = g_slist_append(od->hasicons, ir);
 			}
-			if (args->iconstamp > ir->timestamp)
+			if ((args->iconlength != ir->length) ||
+			    (args->iconchecksum != ir->checksum) ||
+			    (args->iconstamp != ir->timestamp))
 				ir->request = TRUE;
+			ir->length = args->iconlength;
+			ir->checksum = args->iconchecksum;
 			ir->timestamp = args->iconstamp;
 		}