changeset 270:cfa39d39dec6

[gaim-migrate @ 280] Fixed the 100% bug, but in doing so, broke permit/deny lists, so that got commented out (yet again). Gaim/Faim is now usable. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 26 May 2000 23:10:21 +0000
parents 46b6b894bc48
children f7706908f8ae
files libfaim/CHANGES.gaim libfaim/README.gaim libfaim/aim_txqueue.c src/aim.c src/oscar.c src/server.c
diffstat 6 files changed, 48 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/libfaim/CHANGES.gaim	Fri May 26 00:59:58 2000 +0000
+++ b/libfaim/CHANGES.gaim	Fri May 26 23:10:21 2000 +0000
@@ -1,3 +1,12 @@
+
+Fri May 26 22:56:00 UTC 2000 EWarmenhoven
+	- Adam explained to me everything I was doing wrong, ridiculed me a bit,
+	  and eventually told me how to fix the 100% bug. Gaim/Faim is now
+	  completely usable (chat is still a little funny). The only thing left
+	  to do is add better error handling.
+	- Changed aim_txqueue.c in libfaim to flush the queue after something
+	  was enqueue'd, per Adam's suggestion. This is the only real change I
+	  have made to libfaim in order to get it to work with gaim.
 
 Thu May 25 07:10:34 UTC 2000 EWarmenhoven
 	- Changed around aim.c a bit so that the registering of sounds and
--- a/libfaim/README.gaim	Fri May 26 00:59:58 2000 +0000
+++ b/libfaim/README.gaim	Fri May 26 23:10:21 2000 +0000
@@ -16,10 +16,9 @@
 I make into a file, but so far, I haven't made any changes other than moving the
 .h files down a directory.
 
-And finally, a word of warning. Gaim/Faim is VERY buggy. It'll screw with your
-.gaimrc file. It won't always sign on right. It uses all your CPU. Please, don't
-use this for anything other than laughs right now. Hopefully we'll get it
-working better soon (please help!).
+And finally, a word of warning. Gaim/Faim is VERY buggy. Please, don't use this
+for anything other than laughs right now. Hopefully we'll get it working better
+soon (please help!).
 
 CURRENTLY SUPPORTED FEATURES
 ============================
@@ -39,7 +38,6 @@
 Getting users' away messages (PLEASE do not use oscar/libfaim just because of
 	this, gaim with libfaim is still really buggy, none of you will listen
 	to me anyway)
-Telling the server who's on your permit/deny lists
 
 CURRENTLY UNSUPPORTED FEATURES
 ==============================
@@ -50,6 +48,7 @@
 Getting/setting dir info
 Changing your password
 File transfer/IM images/voice chat/etc.
+Telling the server who's on your permit/deny lists
 
 KNOWN ISSUES
 ============
@@ -57,6 +56,10 @@
 You can receive more messages in less time with TOC than with libfaim. It's not
 completely libfaim's fault though.
 
+- The permit/deny stuff is really funny. If I don't put it there, everything
+works great, if I do, it occasionally works, but not well. I've commented it out
+(again - I swear, this is the most on-again-off-again feature).
+
 - There are a lot of problems with panel support (funny that I'm supporting the
 panel code, and the oscar code I wrote doesn't work well with it). I think this
 is related to oscar_callback being funny.
@@ -64,8 +67,9 @@
 - Oscar doesn't do whispering in chat rooms any more (and hasn't for quite a
 while, evidently). So if you want to "whisper" to someone, just IM them.
 
-- Oh, yeah, by the way, it'll eat up all your CPU. (Someone please fix this,
-there's a nice FIXME near the top of oscar.c that says what the problem is.)
+- Chat is really funny. I have no idea what's going on with it. I'm not sure I
+want to know. I'm not worried about it, I never use chat. It's not exactly high-
+priority.
 
 - There are also FIXME's scattered about oscar.c. Grep around for those, figure
 out what needs to be fixed, do that sort of thing. :) (Fixing the things listed
--- a/libfaim/aim_txqueue.c	Fri May 26 00:59:58 2000 +0000
+++ b/libfaim/aim_txqueue.c	Fri May 26 23:10:21 2000 +0000
@@ -3,6 +3,11 @@
  *
  * Herein lies all the mangement routines for the transmit (Tx) queue.
  *
+ * Changes by EWarmenhoven Fri May 26 22:52:46 UTC 2000:
+ * - added aim_tx_flushqueue() to the end of aim_tx_enqueue() so that I don't
+ * have to worry about it any more. mid tells me that doing so will solve the
+ * 100% bug. Thanks mid!
+ *
  */
 
 #include <aim.h>
@@ -87,6 +92,9 @@
   faimdprintf(2, "back from aim_tx_printqueue()\n");
 #endif
 
+  /* mid tells me this should solve a lot of my problems */
+  aim_tx_flushqueue(sess);
+
   return 0;
 }
 
--- a/src/aim.c	Fri May 26 00:59:58 2000 +0000
+++ b/src/aim.c	Fri May 26 23:10:21 2000 +0000
@@ -164,6 +164,10 @@
 #ifdef USE_OSCAR
 }
 
+void auth_failed() {
+	running = FALSE;
+}
+
 /* we need to do this for Oscar because serv_login only starts the login
  * process, it doesn't end there. gaim_setup will be called later from
  * oscar.c, after the buddy list is made and serv_finish_login is called */
--- a/src/oscar.c	Fri May 26 00:59:58 2000 +0000
+++ b/src/oscar.c	Fri May 26 23:10:21 2000 +0000
@@ -58,13 +58,6 @@
 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...);
 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...);
 
-/* FIXME ! This uses 100% of the CPU, guaranteed. It's not using aim_select
- * anymore, which is a good thing, but gdk still thinks there's always data
- * to be read, even though aim_get_command and aim_rxdispatch have already
- * taken care of the data that there was. So, it constantly calls this, and
- * it acts basically like an infinite loop that actually does some work, and
- * eats all of your CPU.
- */
 static void oscar_callback(gpointer data, gint source,
 				GdkInputCondition condition) {
 	struct aim_session_t *sess = (struct aim_session_t *)data;
@@ -76,9 +69,6 @@
 		gdk_input_remove(inpa);
 		return;
 	}
-	if (condition & GDK_INPUT_WRITE) {
-		aim_tx_flushqueue(sess);
-	}
 	if (condition & GDK_INPUT_READ) {
 		if (aim_get_command(sess, gaim_conn) < 0) {
 			debug_print("connection error!\n");
@@ -142,8 +132,7 @@
 	aim_send_login(sess, conn, username, password, &info);
 
 	gaim_conn = conn;
-	inpa = gdk_input_add(conn->fd,
-			GDK_INPUT_READ | GDK_INPUT_WRITE | GDK_INPUT_EXCEPTION,
+	inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
 			oscar_callback, sess);
 
 	u = find_user(username);
@@ -165,9 +154,9 @@
 
 int oscar_send_im(char *name, char *msg, int away) {
 	if (away)
-		aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
+		return aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
 	else
-		aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
+		return aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
 }
 
 void oscar_close() {
@@ -181,6 +170,8 @@
 	aim_logoff(gaim_sess);
 }
 
+extern void auth_failed();
+
 int gaim_parse_auth_resp(struct aim_session_t *sess,
 			 struct command_rx_struct *command, ...) {
 	struct aim_conn_t *bosconn = NULL;
@@ -202,6 +193,7 @@
 		hide_login_progress("Authentication Failed");
 		gdk_input_remove(inpa);
 		aim_conn_close(command->conn);
+		auth_failed();
 		return 0;
 	}
 
@@ -248,8 +240,7 @@
 	aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0);
 
 	aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie);
-	inpa = gdk_input_add(bosconn->fd,
-			GDK_INPUT_READ | GDK_INPUT_WRITE | GDK_INPUT_EXCEPTION,
+	inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
 			oscar_callback, sess);
 	set_login_progress(4, "Connection established, cookie sent");
 	return 1;
@@ -295,6 +286,10 @@
 	return 1;
 }
 
+extern void gaim_setup();
+extern int  bud_list_cache_exists();
+extern void do_import(GtkWidget *w, void *dummy);
+
 int gaim_handle_redirect(struct aim_session_t *sess,
 			 struct command_rx_struct *command, ...) {
 	va_list ap;
@@ -318,6 +313,8 @@
 
 		aim_bos_clientready(sess, command->conn);
 
+		aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
+
 		gaim_sess = sess;
 		gaim_conn = command->conn;
 
@@ -452,7 +449,6 @@
 		struct aim_userinfo_s *userinfo;
 		char *msg = NULL;
 		u_int icbmflags = 0;
-		char *tmpstr = NULL;
 		u_short flag1, flag2;
 
 		userinfo  = va_arg(ap, struct aim_userinfo_s *);
@@ -673,7 +669,7 @@
 		b = NULL;
 	}
 	if (!b)
-		return;
+		return 0;
 
 	serv_got_chat_in(b->id, info->sn, 0, msg);
 
--- a/src/server.c	Fri May 26 00:59:58 2000 +0000
+++ b/src/server.c	Fri May 26 23:10:21 2000 +0000
@@ -378,6 +378,7 @@
 #else
 	/* oscar requires us to do everyone at once (?) */
 	/* I think this code is OK now. */
+	/* FIXME : I changed my mind
 	if (!(permdeny == 1 || permdeny == 4)) {
 		list = permit; at = 0;
 		while (list) {
@@ -396,6 +397,7 @@
 		aim_bos_changevisibility(gaim_sess, gaim_conn,
 				AIM_VISIBILITYCHANGE_DENYADD, buf);
 	}
+	*/
 #endif
 }