diff src/protocols/oscar/oscar.c @ 2273:0b5c3338fa3d

[gaim-migrate @ 2283] One of the girls on the floor of my sister's dorm lost both her parents when their plane was hijacked and crashed into the World Trade Center. my girlfriend's boss's sister-in-law's brother died when the building collapsed. my parents flew to atlanta on monday; they're safe but currently stranded there. they had planned on flying to Raleigh, NC today but now are just hoping to be able to fly home soon. how did this happen? committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 12 Sep 2001 21:29:32 +0000
parents 59a11f4fa4d0
children 4f2a6268c5ec
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Wed Sep 12 18:57:46 2001 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Sep 12 21:29:32 2001 +0000
@@ -58,6 +58,7 @@
 static int gaim_caps = AIM_CAPS_CHAT |
 		       AIM_CAPS_BUDDYICON |
 		       AIM_CAPS_IMIMAGE;
+static fu8_t gaim_features[] = {0x01, 0x01, 0x01, 0x02, 0x66};
 
 struct oscar_data {
 	aim_session_t *sess;
@@ -1259,6 +1260,20 @@
 static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch1_args *args) {
 	char *tmp = g_malloc(BUF_LONG);
 	struct gaim_connection *gc = sess->aux_data;
+	int flags = 0;
+
+	if (sizeof(gaim_features) == args->featureslen) {
+		int i;
+		for (i = 0; i < args->featureslen; i++) {
+			if (gaim_features[i] != args->features[i])
+				break;
+		}
+		if (i == args->featureslen)
+			flags |= IM_FLAG_GAIMUSER;
+	}
+
+	if (args->icbmflags & AIM_IMFLAGS_AWAY)
+		flags |= IM_FLAG_AWAY;
 
 	if (args->icbmflags & AIM_IMFLAGS_HASICON) {
 		struct oscar_data *od = gc->proto_data;
@@ -1327,7 +1342,7 @@
 	} else
 		g_snprintf(tmp, BUF_LONG, "%s", args->msg);
 
-	serv_got_im(gc, userinfo->sn, tmp, args->icbmflags & AIM_IMFLAGS_AWAY, time(NULL));
+	serv_got_im(gc, userinfo->sn, tmp, flags, time(NULL));
 	g_free(tmp);
 
 	return 1;
@@ -2076,12 +2091,11 @@
 			struct icon_req *ir = NULL;
 			char *who = normalize(name);
 			struct stat st;
-			static fu8_t features[] = {0x01, 0x01, 0x01, 0x02, 0x66};
 
 			args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES;
 
-			args.features = features;
-			args.featureslen = sizeof(features);
+			args.features = gaim_features;
+			args.featureslen = sizeof(gaim_features);
 
 			while (h) {
 				ir = h->data;