changeset 302:61894ab8c47e

[gaim-migrate @ 312] I think logging in for oscar works a bit better now. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 01 Jun 2000 10:06:37 +0000
parents f905caee43ca
children 1943ddaf8240
files libfaim/CHANGES.gaim libfaim/README.gaim src/oscar.c src/server.c
diffstat 4 files changed, 83 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/libfaim/CHANGES.gaim	Thu Jun 01 05:06:59 2000 +0000
+++ b/libfaim/CHANGES.gaim	Thu Jun 01 10:06:37 2000 +0000
@@ -1,3 +1,10 @@
+
+Thu Jun  1 09:36:04 UTC 2000 EWarmenhoven
+	- The buddy list and permit/deny list get set before you finish signing
+	  on now, so you shouldn't flash on the buddy lists of people you're
+	  denying. This should also help some (not all) signin problems.
+	- Added more debug_print statements to oscar.c and server.c to try to
+	  figure out why chat's not working.
 
 Wed May 31 19:15:38 UTC 2000 EWarmenhoven
 	- Signon works better; oscar_callback takes an aim_conn_t instead of an
--- a/libfaim/README.gaim	Thu Jun 01 05:06:59 2000 +0000
+++ b/libfaim/README.gaim	Thu Jun 01 10:06:37 2000 +0000
@@ -83,7 +83,7 @@
 
 - If you receive a message that's too large, gaim segfaults. I haven't watched
 this in gdb or gotten a backtrace on it, so I'm not exactly sure what the
-problem is.
+problem is. I think this actually happens on the TOC side of things too.
 
 - Gaim/TOC can do file transfers, but Gaim/Faim cannot. This is not because
 there is any difference in the two protocols as far as the actual transfer is
--- a/src/oscar.c	Thu Jun 01 05:06:59 2000 +0000
+++ b/src/oscar.c	Thu Jun 01 10:06:37 2000 +0000
@@ -90,6 +90,9 @@
 	struct aim_user *u;
 	char buf[256];
 
+	sprintf(debug_buff, "Logging in %s\n", username);
+	debug_print(debug_buff);
+
 	sess = g_new0(struct aim_session_t, 1);
 	aim_session_init(sess);
 	/* we need an immediate queue because we don't use a while-loop to
@@ -153,14 +156,9 @@
 				"%s", password);
 	save_prefs();
 
-	return 0;
-}
+	debug_print("Password sent, waiting for response\n");
 
-int oscar_send_im(char *name, char *msg, int away) {
-	if (away)
-		return aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
-	else
-		return aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
+	return 0;
 }
 
 void oscar_close() {
@@ -172,6 +170,7 @@
 		gdk_input_remove(inpa);
 	inpa = -1;
 	aim_logoff(gaim_sess);
+	debug_print("Signed off.\n");
 }
 
 extern void auth_failed();
@@ -184,6 +183,17 @@
 	debug_print(debug_buff);
 
 	if (sess->logininfo.errorcode) {
+		switch (sess->logininfo.errorcode) {
+		case 0x18:
+			do_error_dialog("You have been connecting and disconnecting too frequently.  Wait ten minutes and try again.  If you continue to try, you will need to wait even longer.", "Gaim - Error");
+			break;
+		case 0x05:
+			do_error_dialog("Incorrect nickname or password.", "Gaim - Error");
+			break;
+		case 0x1c:
+			do_error_dialog("AOL has decided your client is too old. Please download a newer version from http://www.marko.net/gaim/", "Gaim - Error");
+			break;
+		}
 		sprintf(debug_buff, "Login Error Code 0x%04x\n",
 				sess->logininfo.errorcode);
 		debug_print(debug_buff);
@@ -266,11 +276,11 @@
 		aim_bos_ackrateresp(sess, command->conn);
 		aim_bos_setprivacyflags(sess, command->conn, 0x00000003);
 		aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS);
-		aim_setversions(sess, command->conn);
 		aim_bos_setgroupperm(sess, command->conn, 0x1f);
 		debug_print("done with BOS ServerReady\n");
 		break;
 	case AIM_CONN_TYPE_CHATNAV:
+		debug_print("chatnav: got server ready\n");
 		aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
 		aim_bos_reqrate(sess, command->conn);
 		aim_bos_ackrateresp(sess, command->conn);
@@ -278,6 +288,7 @@
 		aim_chatnav_reqrights(sess, command->conn);
 		break;
 	case AIM_CONN_TYPE_CHAT:
+		debug_print("chat: got server ready\n");
 		aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0);
 		aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0);
 		aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0);
@@ -288,6 +299,8 @@
 		serv_got_joined_chat(id++, aim_chat_getname(command->conn));
 		break;
 	default: /* huh? */
+		sprintf(debug_buff, "server ready: got unexpected connection type %04x\n", command->conn->type);
+		debug_print(debug_buff);
 		break;
 	}
 	return 1;
@@ -313,19 +326,14 @@
 
 	switch(serviceid) {
 	case 0x0005: /* Ads */
+		debug_print("Received Ads, finishing login\n");
 		sprintf(buddies, "%s&", current_user->username);
 		aim_bos_setbuddylist(sess, command->conn, buddies);
 		aim_bos_setprofile(sess, command->conn, current_user->user_info,
 					NULL, gaim_caps);
-		
 		aim_seticbmparam(sess, command->conn);
-
-		aim_bos_clientready(sess, command->conn);
-
-		aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
 		aim_conn_setlatency(command->conn, 1);
 
-		debug_print("Roger that, all systems go\n");
 #ifdef USE_APPLET
 		make_buddy();
 		if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
@@ -348,8 +356,13 @@
 		if (bud_list_cache_exists())
 			do_import(NULL, 0);
 
+		aim_bos_clientready(sess, command->conn);
+		debug_print("Roger that, all systems go\n");
+		aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
+
 		break;
 	case 0x7: /* Authorizer */
+		debug_print("Reconnecting with authorizor...\n");
 		{
 		struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
 		if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR)
@@ -378,6 +391,9 @@
 			debug_print("unable to connect to chat server\n");
 			return 1;
 		}
+		sprintf(debug_buff, "Connected to chat room %s\n", roomname);
+		debug_print(debug_buff);
+
 		aim_chat_attachname(tstconn, roomname);
 		aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
 		aim_auth_sendcookie(sess, tstconn, cookie);
@@ -483,7 +499,7 @@
 					     userinfo->sn,
 					     msg);
 		} else if (rendtype == 1) {
-			/* FIXME : voice chat */
+			/* voice chat */
 		} else {
 			sprintf(debug_buff, "Unknown rendtype %d\n", rendtype);
 			debug_print(debug_buff);
@@ -507,11 +523,11 @@
 	subtype = aimutil_get16(command->data+2);
 
 	switch (family) {
-/*	case 0x0001:
+	case 0x0001:
 		if (subtype == 0x000a)
 			sprintf(buf, "You are sending messages too fast.");
 		break;
-*/	case 0x0002:
+	case 0x0002:
 		if (subtype == 0x0001)
 			sprintf(buf, "Unknown SNAC error (I'm hungry)");
 		break;
@@ -587,9 +603,42 @@
 
 int gaim_chatnav_info(struct aim_session_t *sess,
 		      struct command_rx_struct *command, ...) {
-	/* FIXME */
-	debug_print("inside chatnav_info\n");
-	aim_conn_close(command->conn);
+	va_list ap = va_start(ap, command);
+	u_short type = va_arg(ap, u_short);
+
+	switch(type) {
+		case 0x0002: {
+			int maxrooms;
+			struct aim_chat_exchangeinfo *exchanges;
+			int exchangecount, i = 0;
+
+			maxrooms = va_arg(ap, u_char);
+			exchangecount = va_arg(ap, int);
+			exchanges = va_arg(ap, struct aim_chat_exchangeinfo *);
+			va_end(ap);
+
+			debug_print("chat info: Chat Rights:\n");
+			sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms);
+			debug_print(debug_buff);
+			sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount);
+			debug_print(debug_buff);
+			while (i < exchangecount) {
+				sprintf(debug_buff, "chat info: \t\t%x: %s (%s/%s)\n",
+						exchanges[i].number,
+						exchanges[i].name,
+						exchanges[i].charset1,
+						exchanges[i].lang1);
+				debug_print(debug_buff);
+				i++;
+			}
+			}
+			break;
+		default:
+			va_end(ap);
+			sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type);
+			debug_print(debug_buff);
+			break;
+	}
 	return 1;
 }
 
--- a/src/server.c	Thu Jun 01 05:06:59 2000 +0000
+++ b/src/server.c	Thu Jun 01 10:06:37 2000 +0000
@@ -160,7 +160,10 @@
                    message, ((away) ? " auto" : ""));
 	sflap_send(buf, strlen(buf), TYPE_DATA);
 #else
-	oscar_send_im(name, message, away);
+	if (away)
+		aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, message);
+	else
+		aim_send_im(gaim_sess, gaim_conn, name, 0, message);
 #endif
         if (!away)
                 serv_touch_idle();
@@ -479,6 +482,8 @@
         g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name);
         sflap_send(buf, -1, TYPE_DATA);
 #else
+	sprintf(debug_buff, "Attempting to join chat room %s.\n", name);
+	debug_print(debug_buff);
 	aim_chat_join(gaim_sess, gaim_conn, 0x0004, name);
 #endif
 }