changeset 4664:eab1309693b8

[gaim-migrate @ 4975] It's a step in the right direction. Maybe. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 07 Mar 2003 07:36:11 +0000
parents 788f78343113
children 818ee615b025
files src/protocols/oscar/aim.h src/protocols/oscar/icq.c src/protocols/oscar/oscar.c
diffstat 3 files changed, 48 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/aim.h	Fri Mar 07 07:01:44 2003 +0000
+++ b/src/protocols/oscar/aim.h	Fri Mar 07 07:36:11 2003 +0000
@@ -1303,6 +1303,7 @@
 
 faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess);
 faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess);
+faim_export int aim_icq_hideip(aim_session_t *sess);
 faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd);
 faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin);
 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin);
--- a/src/protocols/oscar/icq.c	Fri Mar 07 07:01:44 2003 +0000
+++ b/src/protocols/oscar/icq.c	Fri Mar 07 07:36:11 2003 +0000
@@ -70,6 +70,41 @@
 	return 0;
 }
 
+faim_export int aim_icq_hideip(aim_session_t *sess)
+{
+	aim_conn_t *conn;
+	aim_frame_t *fr;
+	aim_snacid_t snacid;
+	int bslen;
+
+	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
+		return -EINVAL;
+
+	bslen = 2+4+2+2+2+4;
+
+	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
+		return -ENOMEM;
+
+	snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
+	aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
+
+	/* For simplicity, don't bother using a tlvlist */
+	aimbs_put16(&fr->data, 0x0001);
+	aimbs_put16(&fr->data, bslen);
+
+	aimbs_putle16(&fr->data, bslen - 2);
+	aimbs_putle32(&fr->data, atoi(sess->sn));
+	aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
+	aimbs_putle16(&fr->data, snacid); /* eh. */
+	aimbs_putle16(&fr->data, 0x0424); /* shrug. */
+	aimbs_putle16(&fr->data, 0x0001);
+	aimbs_putle16(&fr->data, 0x0001);
+
+	aim_tx_enqueue(sess, fr);
+
+	return 0;
+}
+
 faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd)
 {
 	aim_conn_t *conn;
@@ -337,8 +372,12 @@
 		}
 
 		switch (subtype) {
+		case 0x00a0: { /* hide ip status */
+			/* nothing */
+		} break;
+
 		case 0x00aa: { /* password change status */
-			aimbs_getle8(&qbs); /* 0x000a for success */
+			/* nothing */
 		} break;
 
 		case 0x00c8: { /* general and "home" information */
--- a/src/protocols/oscar/oscar.c	Fri Mar 07 07:01:44 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Fri Mar 07 07:36:11 2003 +0000
@@ -3481,8 +3481,10 @@
 
 	/* XXX - Should call aim_bos_setidle with 0x0000 */
 
-	/* XXX - Should only call reqofflinemsgs when using ICQ? */
-	aim_icq_reqofflinemsgs(sess);
+	if (od->icq) {
+		aim_icq_reqofflinemsgs(sess);
+		aim_icq_hideip(sess);
+	}
 
 	aim_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV);
 	if (sess->authinfo->email)
@@ -3531,6 +3533,9 @@
 	info = va_arg(ap, struct aim_icq_info *);
 	va_end(ap);
 
+	if (!info->uin)
+		return 0;
+
 	g_snprintf(who, sizeof(who), "%lu", info->uin);
 	buf = g_strdup_printf("<b>UIN:</b> %s", who);
 	if (info->nick && info->nick[0]) {