changeset 10594:a78d9fac8183

[gaim-migrate @ 12009] Forward-port this from oldstatus committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Feb 2005 03:02:36 +0000
parents ffabeb0fdc64
children de34037a02c7
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Sun Feb 13 19:12:36 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Feb 14 03:02:36 2005 +0000
@@ -3576,14 +3576,22 @@
 
 		gaim_debug_info("oscar",
 				   "%s received direct im request from %s (%s)\n",
-				   username, userinfo->sn, args->clientip);
+				   username, userinfo->sn, args->verifiedip);
 
 		d->gc = gc;
 		d->sn = g_strdup(userinfo->sn);
 		/* Let's use the clientip here, because I think that's what AIM does.
 		 * Besides, if the clientip is wrong, we'll probably timeout faster,
 		 * and then ask them to connect to us. */
-		snprintf(d->ip, sizeof(d->ip), "%s:%d", args->clientip, args->port?args->port:5190);
+		/*
+		 * I disagree, let's use the verifiedip.  I think AIM tries the
+		 * verified IP first, then tries the client IP if that fails.  In
+		 * any case, there's a better chance the verified IP will be correct.
+		 * The client IP is what the other person _thinks_ their IP address
+		 * is.  The verified IP is the address that the AIM server sees the
+		 * other person using.
+		 */
+		snprintf(d->ip, sizeof(d->ip), "%s:%d", args->verifiedip, args->port?args->port:5190);
 		memcpy(d->cookie, args->cookie, 8);
 		if (dim && !dim->connected && aim_odc_getcookie(dim->conn) && args->cookie &&
 		    (!memcmp(aim_odc_getcookie(dim->conn), args->cookie, 8))) {