changeset 1612:fd5d27358418

[gaim-migrate @ 1622] libfaim updates. also, we don't need CHANGES.gaim and README.gaim anymore, especially since libfaim/oscar isn't the only library/protocol we're using besides toc anymore. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 18 Mar 2001 02:24:41 +0000
parents 9ff8cac19352
children 35a13ece3a9c
files libfaim/CHANGES.gaim libfaim/Makefile.am libfaim/README.gaim libfaim/rxhandlers.c
diffstat 4 files changed, 176 insertions(+), 726 deletions(-) [+]
line wrap: on
line diff
--- a/libfaim/CHANGES.gaim	Sat Mar 17 13:10:00 2001 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,329 +0,0 @@
-
-Tue Dec  5 00:13:58 UTC 2000 EWarmenhoven
-	- Holy crap, it's been a long time since I've updated this file.
-	  Well, actually, not much has changed. There's the beginnings
-	  of GetFile-send (someone requests to get a file from you, and
-	  you send it), but it's not really working well yet.
-
-Sat Oct 21 10:18:30 UTC 2000 EWarmenhoven
-	- After signing off chat room structs and input watchers weren't
-	  being removed. This definitely caused leaks (though small ones)
-	  and may have caused a lot of CPU usage. This got modified, and
-	  hopefully fixed.
-
-Wed Oct 18 02:29:38 UTC 2000 EWarmenhoven
-	- removed Direct IM temporarily while I figure out the UI for how
-	  to do stuff
-
-Mon Oct  9 22:40:56 UTC 2000 EWarmenhoven
-	- added multiple connections to gaim. This actually happened over
-	  the course of about 3 or 4 days. It is now somewhat functional;
-	  enough for me to commit.
-	- libfaim had some updates which make Direct IM not quite work.
-	  Please don't use Direct IM for a short time. There is a fix that
-	  has been submitted but has not been put into CVS yet.
-
-Fri Sep 22 10:12:37 UTC 2000 EWarmenhoven
-	- yeah, libfaim does socks 5 proxying now. it may be fragile though,
-	  and the necessary call in gaim to get it to work isn't there yet.
-	  be patient. i just don't want to write the UI for it yet.
-
-Wed Sep 20 23:30:32 UTC 2000 EWarmenhoven
-	- libfaim does dir info now
-	- for those wishing to use gaim as an ICQ client, libfaim took one
-	  step closer to that. but gaim hasn't taken the corresponding step.
-
-Thu Sep 14 17:37:28 UTC 2000 EWarmenhoven
-	- libfaim has create room callback now, so you can create and join
-	  empty rooms.
-
-Tue Sep 12 22:58:13 UTC 2000 EWarmenhoven
-	- Added option to send flap_nop every minute
-
-Tue Sep 12 20:20:07 UTC 2000 EWarmenhoven
-	- Oscar works again. :)
-	- I'm updating to the latest libfaim. Everything should theoretically
-	  work, except some users (notably Solaris) may not be able to start
-	  Direct IM. Please tell me if you can't.
-
-Mon Sep  4 01:08:33 UTC 2000 EWarmenhoven
-	- libfaim updates, gaim updates.
-	- hopefully gaim/faim is much more stable now
-	- gaim/faim reports errors much better
-
-Sat Sep  2 12:32:44 UTC 2000 EWarmenhoven
-	- Modified chat handling a bit so that if we've signed off, we don't
-	  try to kill the chat connection when the window is closed. This
-	  should get rid of a couple segfaults.
-
-Sat Sep  2 02:35:34 UTC 2000 EWarmenhoven
-	- very good news. the very-long-message DOS against libfaim was fixed.
-	  libfaim users can now send and receive Very Long Messages. GtkHTML
-	  has problems drawing them, but resizing seems to help.
-	- the fix also makes long buddy lists a non-issue.
-	- oh yeah, the login process was changed so it should go quicker now.
-	  and we don't request ads at all, so not even your packet sniffer can
-	  pick up the gifs.
-
-Mon Aug 28 05:02:39 UTC 2000 EWarmenhoven
-	- libfaim gets warnings. no blocking, just warnings.
-
-Tue Aug 22 23:34:47 UTC 2000 EWarmenhoven
-	- New login method. Don't ask me anything about it. The only
-	  thing I know about Oscar is its name.
-
-Fri Aug 18 00:21:11 UTC 2000 EWarmenhoven
-	- Adam got rid of a lot of leaks thanks to me :)
-
-Thu Aug 17 07:56:49 UTC 2000 EWarmenhoven
-	- The permit/deny stuff is warped. It's untested and just doesn't
-	  work. I'm diabling it in gaim. If you want to deny someone,
-	  use TOC.
-
-Tue Aug  8 21:04:30 UTC 2000 EWarmenhoven
-	- Solaris doesn't have getaddrinfo(). Well, old versions of Solaris
-	  don't. I changed aim_ft.c to try to work around this problem.
-
-Tue Aug  8 04:59:55 UTC 2000 EWarmenhoven
-	- Small updates to libfaim. Hopefully this should fix a lot of the
-	  conn->type segfaults and pthread hangs.
-
-Fri Jul 21 19:47:36 UTC 2000 EWarmenhoven
-	- Direct IM. I think I ironed out most of the bugs. Now all I have
-	  to do is add support for the <BINARY> tags. Fun.
-	- ChatNav stuff works a little better (the connection actually gets
-	  closed now).
-	- Changes I've made to libfaim are now kept in README.gaim, and are
-	  easier to update.
-	- People can see the capabilities of users now.
-
-Tue Jul 18 05:31:15 UTC 2000 EWarmenhoven
-	- Lots of updates to libfaim; updates to gaim to use latest libfaim.
-	- libfaim can do directIM now, but I haven't brought gaim up-to-date
-	  on that yet. I will soon (hopefully tonight).
-	- Just a side note: I got WinAIM to run under wine, which means I
-	  don't need to do testing in the dark anymore (hopefully).
-
-Fri Jun 30 02:29:40 UTC 2000 EWarmenhoven
-	- AOL is trying to prevent us from using Oscar. Fortunately, Adam's
-	  been able to figure out what's going on, and so we can sign on
-	  again.
-	- faimconfig.h used to only USEPTHREADS if we were using Linux, but
-	  now it fakes it otherwise (which is kinda stupid since other systems
-	  have pthreads too), but it should make everything still work fine,
-	  so that's back to what's in libfaim's CVS.
-	- Made those 'bleck' printf's that I had made faimdprintf's back to
-	  printf's, just because I don't like having things be very different
-	  from the main libfaim tree.
-
-Wed Jun 21 19:38:18 UTC 2000 EWarmenhoven
-	- Wow, long time since I've been here. Anyway, libfaim is now
-	  compiled (not only by default; there's no way not to compile it).
-	- Adam's been working on the RVOUS stuff, but I don't think he's
-	  gotten too far with it. I did have a patch to get file transfer to
-	  work for gaim/faim but never applied it.
-
-Fri Jun  9 08:13:36 UTC 2000 EWarmenhoven
-	- OK, so TOC can do ICQ too, but I don't care. Adam's still cool.
-	- Chat is working almost perfectly now. I haven't figured out why it
-	  won't join a room that no one's already in yet, but I think I know
-	  what the problem is.
-	- Adam says file transfer stuff will be here RSN, so be patient.
-
-Sat Jun  3 07:22:50 UTC 2000 EWarmenhoven
-	- Adam is by far the coolest person I know. He figured out how to get
-	  libfaim not only to use ICQ, but how to make it so that there aren't
-	  any client changes that are required - just use your UIN instead of
-	  your SN.
-
-Fri Jun  2 19:39:13 UTC 2000 EWarmenhoven
-	- Buddy lists no longer get sent individually, but all together (as
-	  many as fit in the buffer at one time). This should reduce a lot
-	  of the "You're sending messages too fast" errors at signon.
-	- Chat is improved a bit, mostly because I think I'm starting to get
-	  some clue as to what's going on.
-
-Fri Jun  2 08:53:53 UTC 2000 EWarmenhoven
-	- Well, I got chat working again.
-	- Added struct chat_connection to keep track of file descriptors and
-	  input watchers.
-	- Added oscar_chats to keep track of chat_connection's.
-	- It still doesn't work well, nor all the time. But at least it works.
-
-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
-	  aim_session_t now to try and prevent reported connection errors.
-	- Setting the latency before creating the buddy list seems to remove
-	  some signon problems, especially if you have a larger buddy list.
-
-Wed May 31 02:50:36 UTC 2000 EWarmenhoven
-	- Good fun things here. Sometimes I think Adam does things just to make
-	  it difficult for me, I swear (j/k :) ).
-	- I moved all the .h files into the faim/ directory because I'm tired
-	  of changing faim/aim.h to just aim.h every time Adam makes an update.
-	- libfaim can now send messages much longer than WinAIM or TOC can. But,
-	  the length checking code is still in conversation.c, and I haven't
-	  changed it yet, mostly because I'm lazy.
-
-Wed May 31 00:40:42 UTC 2000 EWarmenhoven
-	- Adam added a file to libfaim, aim_meta.c, that has one main function:
-	  to return the libfaim version and when it was build (date/time). So
-	  I added it to gaim's copy.
-	- aim_meta.c included a file, aim_buildcode.h, which was created by a
-	  shell script, and defined two values at build time. Instead of have
-	  the Makefile run that script, I decided it would be easier to have
-	  the Makefile define those values itself. This marks now two minor
-	  changes to libfaim: changing some printf's to faimdprintf's, and not
-	  including the shell script in favor of the Makefile way of doing it.
-	- Just for grins (mostly to see if the code I added to Makefile.am did
-	  what I wanted it to), I added a line to oscar.c to print the gaim and
-	  libfaim versions to the debug window when you sign on. Maybe it'll be
-	  useful in debugging at some point?
-
-Tue May 30 23:40:11 UTC 2000 EWarmenhoven
-	- So today, somone IMs me and says that he thinks that allowing only the
-	  people on your buddy list to see you is a good thing, and that I
-	  should implement it. Well, I did, but it doesn't work right most of
-	  the time, as far as I can tell. At least it works occasionally. I
-	  think I did everything right though. Maybe my timing is off?
-	- Updates to libfaim, so I updated gaim's copy. There should really be a
-	  better system.
-
-Tue May 30 04:04:40 UTC 2000 EWarmenhoven
-	- Well, after trying to screw around with the permit/deny stuff a bit,
-	  I finally decided that having a permit list was for people who didn't
-	  want AIM in the first place. Therefore, I only need to implement the
-	  deny list. This made things work much better. I'm declaring the deny
-	  list as working.
-	- Chat isn't working, and hasn't for a while. I don't know why; I've
-	  been playing with it for a few days now without much luck. I finally
-	  decided it was time to move it to the UNSUPPORTED section in the
-	  README.gaim file. I actually got it to work once; I don't know how.
-	- Oscar support in gaim (since I started working on it) is now 10 days
-	  old, and already I've had more than 5 people (not counting Rob) ask
-	  me about it; one person even filed bugs against it. I'm not sure if
-	  that's a good thing or not.
-
-Mon May 29 20:24:24 UTC 2000 EWarmenhoven
-	- Updated the libfaim code to the latest that's in libfaim's CVS. The
-	  new code has one nice feature and one feature that may or may not
-	  cause problems. The nice feature is aim_tx_enqueue__immediate, which
-	  means that the change to aim_txenqueue I made no longer applies, I
-	  just have to set gaim_sess->tx_enqueue to the __immediate function.
-	  The one that may cause problems is libfaim has the beginnings of
-	  threads. The way the code worked in libfaim was if you were using
-	  linux, FAIM_USEPTHREADS was defined, otherwise, you couldn't use
-	  libfaim. Since gaim requires pthreads at ./configure-time, we can
-	  let anyone use it. So I changed that in faimconfig.h.
-	- The changes clued me in to a few bugs in oscar.c that were causing
-	  signon problems. Those should be fixed now.
-
-Sun May 28 21:33:43 UTC 2000 EWarmenhoven
-	- Figured out how aim_set_latency works, and why I thought it wasn't
-	  working before, and so now you can receive messages a lot faster, I
-	  hope.
-	- Chat still isn't working, and I don't know why.
-	- It no longer has me as one of your buddies, and no longer sets your
-	  profile when you don't have one to 'Hello'.
-
-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.
-	- Commented out the permit/deny list stuff (again).
-
-Thu May 25 07:10:34 UTC 2000 EWarmenhoven
-	- Changed around aim.c a bit so that the registering of sounds and
-	  plugins and such gets taken care of after we actually finish signing
-	  on. this should fix a lot of things, but still not the 100% bug (as I
-	  call it now).
-
-Wed May 24 19:10:19 UTC 2000 EWarmenhoven
-	- Got rid of aim_select. Good. But it still uses 100% of the CPU. Bad.
-	  The reason is because oscar_callback gets called whenever there's
-	  data waiting on the file descriptor, and it always thinks there's
-	  data waiting, even when we've already dealt with the data.
-
-Wed May 24 05:20:31 UTC 2000 EWarmenhoven
-	- Inviting someone is possible now (I hope - I haven't been able to get
-	  into a chat room using libfaim (any client) for a couple days now).
-	- I found out from Adam that whispering (which is kind of a stupid idea
-	  anyway) isn't in Oscar, and hasn't been for quite some time, so I
-	  put a nice little error message when you try to whisper.
-
-Tue May 23 18:07:00 UTC 2000 EWarmenhoven
-	- I fixed the code to tell the server who's on your permit/deny list.
-	  I still don't think it works right in all cases, but it does in most.
-
-Tue May 23 03:32:26 UTC 2000 EWarmenhoven
-	- I commented out the code to tell the server who's on your permit or
-	  deny lists. I coded that part seriously wrong.
-	- un-#ifndef'd rvous.c, so theoretically, once libfaim supports file
-	  transfer (et al.) it should be relatively easy to add the code for
-	  it.
-	- Placed FIXME's throughout the code to try to signal problems
-	- Other touch-ups (not worth mentioning)
-
-Mon May 22 19:02:19 UTC 2000 EWarmenhoven
-	- Able to be invited to join a chat room
-
-Mon May 22 01:14:36 UTC 2000 EWarmenhoven
-	- You can now get users' away messages
-
-Sun May 21 11:42:22 UTC 2000 EWarmenhoven
-	- There were small changes to the libfaim code, which I updated
-	- Went ahead and implemented chat (since I said I wouldn't touch it
-	  until libfaim got updated again)
-
-Sat May 20 22:42:24 UTC 2000 EWarmenhoven
-	- Getting a user's info now displays the familiar dialog window
-	- You can now add people to your permit/deny list (I think - but I
-	  also think I did it wrong)
-	- It's been a busy day, I think I'm done until libfaim gets updated
-	  again (which means no chat for a while, sorry)
-
-Sat May 20 09:56:16 UTC 2000 EWarmenhoven
-	- That 2 second delay in updates is gone, and I think it's actually
-	  faster than the TOC code now.
-	- I figured out why it was segfaulting. I'm stupid sometimes.
-	- I figured out why the idle times were appearing bizarrely. Once
-	  again, I'm stupid sometimes.
-	- You can now be idle
-	- You can now get a user's info (sort of - use the debug window) (still
-	  no away messages though....)
-	- You can now be away
-	- You can now set your info (but not your dir info - yet)
-	- I think it's almost at a point where it's ready for use.
-
-Sat May 20 06:29:31 UTC 2000 EWarmenhoven
-	- You can add and remove buddies now. It also tries to retrieve the
-	  buddy list using the .gaimbdcache list, and saves it the same way
-	  (remember the Oscar server doesn't save the list for us).
-	- When someone goes idle (e.g. 10 minutes idle), it appears as 266334.5
-	  hours idle. I'm not sure if that's my problem or libfaim's.
-	- Sometimes it segfaults when you try to sign in, sometimes it doesn't.
-	  I can't figure out why.
-	- It still has the 2 second delay between display updates. I think I'm
-	  going insane; it doesn't bug as much as it used to.
-
-Sat May 20 00:16:25 UTC 2000 EWarmenhoven
-	- First log entry! Yay!
-	- Updated the libfaim code to the latest in CVS
-	- Rewrote much of oscar.c (if not all).
-	- Current supported features:
-		Signing On
-		Receiving IMs
-		Sending IMs
-	- There is a 2 second delay between GTK updates. Please, someone
-	  fix this before I go insane.
--- a/libfaim/Makefile.am	Sat Mar 17 13:10:00 2001 +0000
+++ b/libfaim/Makefile.am	Sun Mar 18 02:24:41 2001 +0000
@@ -1,7 +1,7 @@
 noinst_LIBRARIES = libfaim.a
 
 EXTRA_DIST = aim.h aim_cbtypes.h aim_internal.h faimconfig.h md5.h README \
-		README.gaim CHANGES CHANGES.gaim COPYING BUGS AUTHORS
+		CHANGES COPYING BUGS AUTHORS
 
 libfaim_a_SOURCES = 	adverts.c	\
 			auth.c 		\
--- a/libfaim/README.gaim	Sat Mar 17 13:10:00 2001 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-Hello, your good friend EW here with a nice little notice that I'm sure will
-affect the ten of you who actually read this.
-
-I'm going to start trying to get gaim to use Oscar through libfaim. As far as I
-can tell, the only thing it used to be able to do is sign on and receive IMs. I
-updated libfaim to what's currently in the libfaim CVS on sourceforge. As of
-right now, I've been able to implement most of the features libfaim offers.
-
-I'm going to try to make as few modifications as possible to the libfaim code.
-The only two modifications I'll probably ever make to it are 1) to make my life
-easier or 2) to fix a compilation error. That means that what you're getting
-when you enable oscar is basically faimtest (the very instructional program
-included with the libfaim source on sourceforge) with the Gaim GTK front-end.
-So far the changes to libfaim that I've made are:
-- remove mkbuildinfo.sh and put the #defines it creates into Makefile.am
-- check for socklen_t for Solaris people (in aim_ft.c)
-
-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!).
-
-I think I'm ready to start dealing with bugs being reported against it now
-though. If you're going to report a bug, please check first that a) you're using
-the to-the-second absolute latest CVS version, b) it's not in the unsupported
-features/known issues lists below, c) someone hasn't already reported the bug on
-sourceforge (please check BOTH the open and closed bugs), and finally d) that
-you can reproduce it.
-
-Also, please *don't* IM me about a bug, as I have a tendency to forget things
-like that. Reporting it on sourceforge is a much better way of reporting bugs,
-because then other people can see that the bug is already known, and it's harder
-for me to forget.
-
-CURRENTLY SUPPORTED FEATURES
-============================
-Signing on
-Receiving IMs
-Sending IMs
-Being idle
-Being away/coming back
-Setting your info
-Getting users' info
-Getting users' away messages
-Setting your dir info
-Warning users/getting warned
-Telling the server who's on your permit/deny lists
-Chat:
- - joining rooms
- - leaving rooms
- - talking
- - inviting someone
- - getting invited
- - creating rooms (needed to join empty rooms)
- - refreshing the chatlist in the preferences dialog
-
-CURRENTLY UNSUPPORTED FEATURES
-==============================
-Chat:
- - whispering (this will never happen)
-Getting dir info
-Changing your password
-File Transfer (Get/Send)
-Voice Chat
-Buddy Icon
-Direct IM (aka IM Image, for sounds and pictures)
-
-KNOWN ISSUES
-============
-- 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. (TOC
-doesn't either?)
-
-- Gaim/TOC can do some RVOUS actions, and Gaim/Faim can do others. This is not
-because there is any difference in the protocols as far as the actual transfer
-is concerned. The only difference is what has been implemented and what hasn't
-been.
-
-- What *is* protocol-dependent about the RVOUS stuff is that only Oscar can
-request RVOUS actions, though both can receive them.
-
-- Getting Dir Info is not in libfaim yet, and so is not in Gaim/Faim yet.
-
-- There are also FIXME's scattered about gaim. Grep around for those, figure
-out what needs to be fixed, do that sort of thing. :) (Fixing the things listed
-in KNOWN ISSUES above, or any other bugs you happen to find, is a very good use
-of your time.) (You didn't hear that from me.)
--- a/libfaim/rxhandlers.c	Sat Mar 17 13:10:00 2001 +0000
+++ b/libfaim/rxhandlers.c	Sun Mar 18 02:24:41 2001 +0000
@@ -315,6 +315,8 @@
   } else {
     workingPtr = sess->queue_incoming;
     for (i = 0; workingPtr != NULL; workingPtr = workingPtr->next, i++) {
+      unsigned short family,subtype;
+
       /*
        * XXX: This is still fairly ugly.
        */
@@ -334,324 +336,182 @@
 	continue;
       }
 
-      switch(workingPtr->conn->type) {
-      case -1:
-	/*
-	 * This can happen if we have a queued command
-	 * that was recieved after a connection has 
-	 * been terminated.  In which case, the handler
-	 * list has been cleared, and there's nothing we
-	 * can do for it.  We can only cancel it.
-	 */
-	workingPtr->handled = 1;
-	break;
-      case AIM_CONN_TYPE_AUTH: {
-	unsigned long head;
-	
-	head = aimutil_get32(workingPtr->data);
-	if ((head == 0x00000001) && (workingPtr->commandlen == 4)) {
-	  faimdprintf(sess, 1, "got connection ack on auth line\n");
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
-	} else if (workingPtr->hdr.oscar.type == 0x04) {
-	  /* Used only by the older login protocol */
-	  workingPtr->handled = aim_authparse(sess, workingPtr);
-        } else {
-	  unsigned short family,subtype;
-	  
-	  family = aimutil_get16(workingPtr->data);
-	  subtype = aimutil_get16(workingPtr->data+2);
-	  
-	  switch (family) {
-	    /* New login protocol */
-	  case 0x0017:
-	    if (subtype == 0x0001)
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0001, workingPtr);
-	    else if (subtype == 0x0003)
-	      workingPtr->handled = aim_authparse(sess, workingPtr);
-	    else if (subtype == 0x0007)
-	      workingPtr->handled = aim_authkeyparse(sess, workingPtr);
-	    else
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
-	    break;
-
-	  case 0x0001:
-	    if (subtype == 0x0003)
-	      workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
-	    else if (subtype == 0x0007)
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
-	    else if (subtype == 0x0018)
-	      workingPtr->handled = aim_parse_hostversions(sess, workingPtr);
-	    else
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0xffff, workingPtr);
-	    break;
-
-	  case 0x0007:
-	    if (subtype == 0x0003)
-	      workingPtr->handled = aim_parse_infochange(sess, workingPtr);
-	    else if (subtype == 0x0005)
-	      workingPtr->handled = aim_parse_infochange(sess, workingPtr);
-	    else if (subtype == 0x0007)
-	      workingPtr->handled = aim_parse_accountconfirm(sess, workingPtr);
-	    break;
-
-	  case AIM_CB_FAM_SPECIAL:
-	    if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-	      break;
-	    } else
-	      workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
-	    break;
-
-	  default:
-	    break;
-	  }
-	}
-	break;
-      }
-      case AIM_CONN_TYPE_BOS: {
-	u_short family;
-	u_short subtype;
-
-	if (workingPtr->hdr.oscar.type == 0x04) {
-	  workingPtr->handled = aim_negchan_middle(sess, workingPtr);
-	  break;
-	}
-
-	family = aimutil_get16(workingPtr->data);
-	subtype = aimutil_get16(workingPtr->data+2);
-	
-	switch (family) {
-	case 0x0000: /* not really a family, but it works */
-	  if (subtype == 0x0001)
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
-	  else
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
-	  break;
-	case 0x0001: /* Family: General */
-	  switch (subtype) {
-	  case 0x0001:
-	    workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
-	    break;
-	  case 0x0003:
-	    workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
-	    break;
-	  case 0x0005:
-	    workingPtr->handled = aim_handleredirect_middle(sess, workingPtr);
-	    break;
-	  case 0x0007:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
-	    break;
-	  case 0x000a:
-	    workingPtr->handled = aim_parse_ratechange_middle(sess, workingPtr);
-	    break;
-	  case 0x000f:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x000f, workingPtr);
-	    break;
-	  case 0x0010:
-	    workingPtr->handled = aim_parse_evilnotify_middle(sess, workingPtr);
-	    break;
-	  case 0x0013:
-	    workingPtr->handled = aim_parsemotd_middle(sess, workingPtr);
-	    break;
-	  case 0x0018:
-	    workingPtr->handled = aim_parse_hostversions(sess, workingPtr);
-	    break;
-	  default:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_GEN, AIM_CB_GEN_DEFAULT, workingPtr);
-	    break;
-	  }
-	  break;
-	case 0x0002: /* Family: Location */
-	  switch (subtype) {
-	  case 0x0001:
-	    workingPtr->handled = aim_parse_locateerr(sess, workingPtr);
-	    break;
-	  case 0x0003:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0002, 0x0003, workingPtr);
-	    break;
-	  case 0x0006:
-	    workingPtr->handled = aim_parse_userinfo_middle(sess, workingPtr);
-	    break;
-	  default:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOC, AIM_CB_LOC_DEFAULT, workingPtr);
-	    break;
-	  }
-	  break;
-	case 0x0003: /* Family: Buddy List */
-	  switch (subtype) {
-	  case 0x0001:
-	    workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
-	    break;
-	  case 0x0003:
-	    workingPtr->handled = aim_parse_buddyrights(sess, workingPtr);
-	    break;
-	  case 0x000b: /* oncoming buddy */
-	    workingPtr->handled = aim_parse_oncoming_middle(sess, workingPtr);
-	    break;
-	  case 0x000c: /* offgoing buddy */
-	    workingPtr->handled = aim_parse_offgoing_middle(sess, workingPtr);
-	    break;
-	  default:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_DEFAULT, workingPtr);
-	  }
-	  break;
-	case 0x0004: /* Family: Messaging */
-	  switch (subtype) {
-	  case 0x0001:
-	    workingPtr->handled = aim_parse_msgerror_middle(sess, workingPtr);
-	    break;
-	  case 0x0005:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0004, 0x0005, workingPtr);
-	    break;
-	  case 0x0006:
-	    workingPtr->handled = aim_parse_outgoing_im_middle(sess, workingPtr);
-	    break;
-	  case 0x0007:
-	    workingPtr->handled = aim_parse_incoming_im_middle(sess, workingPtr);
-	    break;
-	  case 0x000a:
-	    workingPtr->handled = aim_parse_missedcall(sess, workingPtr);
-	    break;
-	  case 0x000c:
-	    workingPtr->handled = aim_parse_msgack_middle(sess, workingPtr);
-	    break;
-	  default:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_MSG, AIM_CB_MSG_DEFAULT, workingPtr);
-	  }
-	  break;
-	case 0x0009:
-	  if (subtype == 0x0001)
-	    workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
-	  else if (subtype == 0x0003)
-	    workingPtr->handled = aim_parse_bosrights(sess, workingPtr);
-	  else
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BOS, AIM_CB_BOS_DEFAULT, workingPtr);
-	  break;
-	case 0x000a:  /* Family: User lookup */
-	  switch (subtype) {
-	  case 0x0001:
-	    workingPtr->handled = aim_parse_searcherror(sess, workingPtr);
-	    break;
-	  case 0x0003:
-	    workingPtr->handled = aim_parse_searchreply(sess, workingPtr);
-	    break;
-	  default:
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOK, AIM_CB_LOK_DEFAULT, workingPtr);
-	  }
-	  break;
-	case 0x000b: {
-	  if (subtype == 0x0001)
-	    workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
-	  else if (subtype == 0x0002)
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000b, 0x0002, workingPtr);
-	  else
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_STS, AIM_CB_STS_DEFAULT, workingPtr);
-	  break;
-	}
-	case 0x0013: {
-	  faimdprintf(sess, 0, "lalala: 0x%04x/0x%04x\n", family, subtype);
-	  break;
-	}
-	case AIM_CB_FAM_SPECIAL: 
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-	  break;
-	default:
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
-	  break;
-	} /* switch(family) */
-	break;
-      } /* AIM_CONN_TYPE_BOS */
-      case AIM_CONN_TYPE_ADS: {
-	unsigned short family;
-	unsigned short subtype;
-
-	family = aimutil_get16(workingPtr->data);
-	subtype= aimutil_get16(workingPtr->data+2);
-
-	if ((family == 0x0000) && (subtype == 0x00001)) {
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
-	} else if ((family == 0x0001) && (subtype == 0x0003)) {
-	  workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
-	} else {
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-	}
-	break;
-      }
-      case AIM_CONN_TYPE_CHATNAV: {
-	u_short family;
-	u_short subtype;
-	family = aimutil_get16(workingPtr->data);
-	subtype= aimutil_get16(workingPtr->data+2);
-
-	if ((family == 0x0000) && (subtype == 0x00001)) {
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
-	} else if ((family == 0x0001) && (subtype == 0x0003)) {
-	  workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
-	} else if ((family == 0x000d) && (subtype == 0x0009)) {
-	  workingPtr->handled = aim_chatnav_parse_info(sess, workingPtr);
-	} else {
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-	}
-	break;
-      }
-      case AIM_CONN_TYPE_CHAT: {
-	u_short family, subtype;
-	
-	family = aimutil_get16(workingPtr->data);
-	subtype= aimutil_get16(workingPtr->data+2);
-	
-	if ((family == 0x0000) && (subtype == 0x00001)) {
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
-	} else if (family == 0x0001) {
-	  if (subtype == 0x0001)
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0001, workingPtr);
-	  else if (subtype == 0x0003)
-	    workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
-	  else if (subtype == 0x0007)
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
-	  else if (subtype == 0x000a)
-	    workingPtr->handled = aim_parse_ratechange_middle(sess, workingPtr);
-	  else
-	    workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
-	} else if (family == 0x000e) {
-	  if (subtype == 0x0002)
-	    workingPtr->handled = aim_chat_parse_infoupdate(sess, workingPtr);
-	  else if (subtype == 0x0003)
-	    workingPtr->handled = aim_chat_parse_joined(sess, workingPtr);	
-	  else if (subtype == 0x0004)
-	    workingPtr->handled = aim_chat_parse_leave(sess, workingPtr);	
-	  else if (subtype == 0x0006)
-	    workingPtr->handled = aim_chat_parse_incoming(sess, workingPtr);
-	  else	
-	    faimdprintf(sess, 0, "Chat: unknown snac %04x/%04x\n", family, subtype); 
-	} else {
-	  faimdprintf(sess, 0, "Chat: unknown snac %04x/%04x\n", family, subtype);
-	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_DEFAULT, workingPtr);
-	}
-	break;
-      }
-      case AIM_CONN_TYPE_RENDEZVOUS: {
+      if (workingPtr->conn->type == AIM_CONN_TYPE_RENDEZVOUS) {
 	/* make sure that we only get OFT frames on these connections */
 	if (workingPtr->hdrtype != AIM_FRAMETYPE_OFT) {
 	  faimdprintf(sess, 0, "internal error: non-OFT frames on OFT connection\n");
 	  workingPtr->handled = 1; /* get rid of it */
-	  break;
+	} else {
+	  /* XXX: implement this */
+	  faimdprintf(sess, 0, "faim: OFT frame!\n");
+	  workingPtr->handled = 1; /* get rid of it */
 	}
-	
-	/* XXX: implement this */
-	faimdprintf(sess, 0, "faim: OFT frame!\n");
-	
-	break;
+	continue;
+      }
+
+      if (workingPtr->conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) {
+	/* not possible */
+	faimdprintf(sess, 0, "rxdispatch called on RENDEZVOUS_OUT connection!\n");
+	workingPtr->handled = 1;
+	continue;
+      }
+
+      if ((workingPtr->commandlen == 4) && 
+	  (aimutil_get32(workingPtr->data) == 0x00000001)) {
+	workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
+	continue;
+      } 
+
+      if (workingPtr->hdr.oscar.type == 0x04) {
+	workingPtr->handled = aim_negchan_middle(sess, workingPtr);
+	continue;
       }
-      case AIM_CONN_TYPE_RENDEZVOUS_OUT: {
-	/* not possible */
+	  
+      family = aimutil_get16(workingPtr->data);
+      subtype = aimutil_get16(workingPtr->data+2);
+	  
+      if (family == 0x0001) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
+	else if (subtype == 0x0005)
+	  workingPtr->handled = aim_handleredirect_middle(sess, workingPtr);
+	else if (subtype == 0x0007)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
+	else if (subtype == 0x000a)
+	  workingPtr->handled = aim_parse_ratechange_middle(sess, workingPtr);
+	else if (subtype == 0x000f)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x000f, workingPtr);
+	else if (subtype == 0x0010)
+	  workingPtr->handled = aim_parse_evilnotify_middle(sess, workingPtr);
+	else if (subtype == 0x0013)
+	  workingPtr->handled = aim_parsemotd_middle(sess, workingPtr);
+	else if (subtype == 0x0018)
+	  workingPtr->handled = aim_parse_hostversions(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0xffff, workingPtr);
+
+      } else if (family == 0x0002) {
+
+	if (subtype == 0x0001)
+	    workingPtr->handled = aim_parse_locateerr(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0002, 0x0003, workingPtr);
+	else if (subtype == 0x0006)
+	  workingPtr->handled = aim_parse_userinfo_middle(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOC, AIM_CB_LOC_DEFAULT, workingPtr);
+
+      } else if (family == 0x0003) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_parse_buddyrights(sess, workingPtr);
+	else if (subtype == 0x000b)
+	  workingPtr->handled = aim_parse_oncoming_middle(sess, workingPtr);
+	else if (subtype == 0x000c)
+	  workingPtr->handled = aim_parse_offgoing_middle(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_DEFAULT, workingPtr);
+
+      } else if (family == 0x0004) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_msgerror_middle(sess, workingPtr);
+	else if (subtype == 0x0005)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0004, 0x0005, workingPtr);
+	else if (subtype == 0x0006)
+	  workingPtr->handled = aim_parse_outgoing_im_middle(sess, workingPtr);
+	else if (subtype == 0x0007)
+	  workingPtr->handled = aim_parse_incoming_im_middle(sess, workingPtr);
+	else if (subtype == 0x000a)
+	  workingPtr->handled = aim_parse_missedcall(sess, workingPtr);
+	else if (subtype == 0x000c)
+	  workingPtr->handled = aim_parse_msgack_middle(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_MSG, AIM_CB_MSG_DEFAULT, workingPtr);
+
+      } else if (family == 0x0007) {
+
+	if (subtype == 0x0003)
+	  workingPtr->handled = aim_parse_infochange(sess, workingPtr);
+	else if (subtype == 0x0005)
+	  workingPtr->handled = aim_parse_infochange(sess, workingPtr);
+	else if (subtype == 0x0007)
+	  workingPtr->handled = aim_parse_accountconfirm(sess, workingPtr);
 	break;
+
+      } else if (family == 0x0009) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_parse_bosrights(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BOS, AIM_CB_BOS_DEFAULT, workingPtr);
+
+      } else if (family == 0x000a) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_searcherror(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_parse_searchreply(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOK, AIM_CB_LOK_DEFAULT, workingPtr);
+
+      } else if (family == 0x000b) {
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
+	else if (subtype == 0x0002)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000b, 0x0002, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_STS, AIM_CB_STS_DEFAULT, workingPtr);
+
+      } else if (family == 0x000d) {
+
+	if (subtype == 0x0009)
+	  workingPtr->handled = aim_chatnav_parse_info(sess, workingPtr);
+
+      } else if (family == 0x000e) {
+
+	if (subtype == 0x0002)
+	  workingPtr->handled = aim_chat_parse_infoupdate(sess, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_chat_parse_joined(sess, workingPtr);
+	else if (subtype == 0x0004)
+	  workingPtr->handled = aim_chat_parse_leave(sess, workingPtr);
+	else if (subtype == 0x0006)
+	  workingPtr->handled = aim_chat_parse_incoming(sess, workingPtr);
+
+      } else if (family == 0x0013) {
+
+	faimdprintf(sess, 0, "lalala: 0x%04x/0x%04x\n", family, subtype);
+
+      } else if (family == 0x0017) {	/* New login protocol */
+
+	if (subtype == 0x0001)
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0001, workingPtr);
+	else if (subtype == 0x0003)
+	  workingPtr->handled = aim_authparse(sess, workingPtr);
+	else if (subtype == 0x0007)
+	  workingPtr->handled = aim_authkeyparse(sess, workingPtr);
+	else
+	  workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
+
+      } else if (family == AIM_CB_FAM_SPECIAL) {
+
+	workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
+
       }
-      default:
-	faimdprintf(sess, 0, "internal error: unknown connection type (very bad.) (type = %d, fd = %d, commandlen = %02x)\n\n", workingPtr->conn->type, workingPtr->conn->fd, workingPtr->commandlen);
-	workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
-	break;
-      }	
+
+      /* Try it raw and see if we can get it to happen... */
+      if (!workingPtr->handled) /* XXX this is probably bad. */
+	workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
+
     }
   }
 
@@ -1031,6 +891,11 @@
   rxcallback_t userfunc = NULL;
   int ret = 1;
 
+  /* Used only by the older login protocol */
+  /* XXX remove this special case? */
+  if (command->conn->type == AIM_CONN_TYPE_AUTH)
+    return aim_authparse(sess, command);
+
   tlvlist = aim_readtlvchain(command->data, command->commandlen);
 
   if (aim_gettlv(tlvlist, 0x0009, 1))