changeset 11263:14a166f01a8e

[gaim-migrate @ 13443] Reverting sf patch #1247984 because Kevin and I think it's causing "Not supported by client" gaim_notify windows to pop up. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 15 Aug 2005 03:23:55 +0000
parents ecbbe6d18b0d
children 74b003b1ba8d
files COPYRIGHT src/protocols/oscar/im.c src/protocols/oscar/locate.c
diffstat 3 files changed, 12 insertions(+), 125 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Aug 14 15:58:57 2005 +0000
+++ b/COPYRIGHT	Mon Aug 15 03:23:55 2005 +0000
@@ -104,7 +104,6 @@
 Henry Jen
 Benjamin Kahn
 Akuke Kok
-Ilya Konstantinov
 Cole Kowalski
 Gary Kramlich
 Patrik Kullman
--- a/src/protocols/oscar/im.c	Sun Aug 14 15:58:57 2005 +0000
+++ b/src/protocols/oscar/im.c	Mon Aug 15 03:23:55 2005 +0000
@@ -972,10 +972,10 @@
 		aimbs_put16(&fr->data, 0x0036);
 		{ /* V */
 			aimbs_putle16(&fr->data, 0x001b); /* L */
-			aimbs_putle16(&fr->data, 0x0009); /* Protocol version */
+			aimbs_putle16(&fr->data, 0x0008); /* XXX - Protocol version */
 			aim_putcap(&fr->data, AIM_CAPS_EMPTY);
 			aimbs_putle16(&fr->data, 0x0000); /* Unknown */
-			aimbs_putle16(&fr->data, 0x0001); /* Client features? */
+			aimbs_putle16(&fr->data, 0x0003); /* Client features? */
 			aimbs_putle16(&fr->data, 0x0000); /* Unknown */
 			aimbs_putle8(&fr->data, 0x00); /* Unkizown */
 			aimbs_putle16(&fr->data, 0xffff); /* Sequence number?  XXX - This should decrement by 1 with each request */
@@ -988,19 +988,15 @@
 
 			/* The type of status message being requested */
 			if (type & AIM_ICQ_STATE_CHAT)
-				aimbs_putle8(&fr->data, 0xec);
+				aimbs_putle16(&fr->data, 0x03ec);
 			else if(type & AIM_ICQ_STATE_DND)
-				aimbs_putle8(&fr->data, 0xeb);
+				aimbs_putle16(&fr->data, 0x03eb);
 			else if(type & AIM_ICQ_STATE_OUT)
-				aimbs_putle8(&fr->data, 0xea);
+				aimbs_putle16(&fr->data, 0x03ea);
 			else if(type & AIM_ICQ_STATE_BUSY)
-				aimbs_putle8(&fr->data, 0xe9);
+				aimbs_putle16(&fr->data, 0x03e9);
 			else if(type & AIM_ICQ_STATE_AWAY)
-				aimbs_putle8(&fr->data, 0xe8);
-			else
-				/* This should not happen */
-				aimbs_putle8(&fr->data, 0x00);
-			aimbs_putle8(&fr->data, 0x03); /* Message Flags */
+				aimbs_putle16(&fr->data, 0x03e8);
 
 			aimbs_putle16(&fr->data, 0x0000); /* Status? */
 			aimbs_putle16(&fr->data, 0x0001); /* Priority of this message? */
@@ -2198,106 +2194,11 @@
 	sn = aimbs_getstr(bs, snlen);
 	reason = aimbs_get16(bs);
 
-	if (channel == 0x0002) {
-		switch (reason) {
-			case 0x0003: {
-				/* This is exactly like the Extended Data TLV (2711) */
-				fu16_t len;
-				fu16_t version;
-				fu8_t plugin_uuid[16];
-
-				len = aimbs_getle16(bs); /* Usually 0x001b */
-				version = aimbs_getle16(bs);
-				aimbs_getrawbuf(bs, plugin_uuid, sizeof(plugin_uuid));
-				aim_bstream_advance(bs, len - sizeof(version) - sizeof(plugin_uuid)); /* Rest is unknown */
-
-				len = aimbs_getle16(bs); /* Usually 0x000e */
-				aim_bstream_advance(bs, len); /* Unknown */
-
-				if (plugin_uuid[0] == 0 &&
-				    plugin_uuid[1] == 0 &&
-				    plugin_uuid[2] == 0 &&
-				    plugin_uuid[3] == 0 &&
-				    plugin_uuid[4] == 0 &&
-				    plugin_uuid[5] == 0 &&
-				    plugin_uuid[6] == 0 &&
-				    plugin_uuid[7] == 0 &&
-				    plugin_uuid[8] == 0 &&
-				    plugin_uuid[9] == 0 &&
-				    plugin_uuid[10] == 0 &&
-				    plugin_uuid[11] == 0 &&
-				    plugin_uuid[12] == 0 &&
-				    plugin_uuid[13] == 0 &&
-				    plugin_uuid[14] == 0 &&
-				    plugin_uuid[15] == 0)
-				{
-					fu8_t msg_type, msg_flags, *msg;
-					fu16_t status_code, priority_code, msg_length;
-					fu32_t state;
-
-					msg_type = aimbs_getle8(bs);
-					switch (msg_type) {
-						case 0xe8:
-							state = AIM_ICQ_STATE_AWAY;
-							break;
-						case 0xe9:
-							state = AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY;
-							break;
-						case 0xea:
-							state = AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_OUT;
-							break;
-						case 0xeb:
-							state = AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY;
-							break;
-						case 0xec:
-							state = AIM_ICQ_STATE_CHAT;
-							break;
-						default:
-							state = 0;
-							break;
-					}
-					msg_flags = aimbs_getle8(bs); /* would usually have 0x03 == auto msg */
-					status_code = aimbs_getle16(bs);
-					priority_code = aimbs_getle16(bs);
-
-					msg_length = aimbs_getle16(bs);
-					msg = aimbs_getraw(bs, msg_length);
-
-					if (state & AIM_ICQ_STATE_AWAY)
-					{
-						aim_userinfo_t *userinfo = aim_locate_finduserinfo(sess, sn);
-						free(userinfo->away);
-						free(userinfo->away_encoding);
-						if (msg_length > 0)
-						{
-							userinfo->away = (char *)malloc(msg_length);
-							memcpy(userinfo->away, msg, msg_length);
-						}
-						else
-						{
-							userinfo->away = NULL;
-						}
-						userinfo->away_len = msg_length - 1; /* msg_length includes a terminating '\0' */
-						userinfo->away_encoding = strdup("text/x-aolrtf; charset=\"utf-8\"");
-					}
-
-					if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-						ret = userfunc(sess, rx, channel, sn, reason, state, msg);
-				}
-				else
-				{
-					if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-						ret = userfunc(sess, rx, channel, sn, reason, ck);
-				}
-				break;
-			}
-
-			default: {
-				/* File transfer declined? */
-				if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-					ret = userfunc(sess, rx, channel, sn, reason, ck);
-			}
-		}
+	if (channel == 0x0002) { /* File transfer declined */
+		aimbs_get16(bs); /* Unknown */
+		aimbs_get16(bs); /* Unknown */
+		if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+			ret = userfunc(sess, rx, channel, sn, reason, ck);
 	} else if (channel == 0x0004) { /* ICQ message */
 		switch (reason) {
 			case 0x0003: { /* ICQ status message.  Maybe other stuff too, you never know with these people. */
--- a/src/protocols/oscar/locate.c	Sun Aug 14 15:58:57 2005 +0000
+++ b/src/protocols/oscar/locate.c	Mon Aug 15 03:23:55 2005 +0000
@@ -1135,19 +1135,6 @@
 		userinfo->away = (char *)malloc(tlv->length);
 		memcpy(userinfo->away, tlv->value, tlv->length);
 		userinfo->away_len = tlv->length;
-		/*
-		 * ICQ cannot be trusted with non-Latin-1 away messages
-		 * delivered in 0x02,0x06; see SF issue 1175975.
-		 * Therefore, we try to get its Away information
-		 * in an alternative fashion -- same as used
-		 * by the official client.
-		 */
-		if (((userinfo->icqinfo.status & AIM_ICQ_STATE_AWAY) ||
-		     (userinfo->icqinfo.status & AIM_ICQ_STATE_CHAT)) &&
-		    (userinfo->sn != NULL) && aim_sn_is_icq(userinfo->sn))
-		{
-			aim_im_sendch2_geticqaway(sess, userinfo->sn, userinfo->icqinfo.status);
-		}
 	}
 
 	/* Caps will be 5 */