Index: ChangeLog
===================================================================
--- ChangeLog	(revision e7bcd1bc547a98ae5b761766ff61a369547a64ad)
+++ ChangeLog	(revision 2674412c0adaeea507e6503a0552d66507ce2604)
@@ -3,4 +3,5 @@
 2.1.1-pre-1
 	Only print forced AIM logout message once.
+	Don't bind F1 to help in edit context
 	
 2.0.14
Index: aim.c
===================================================================
--- aim.c	(revision e7bcd1bc547a98ae5b761766ff61a369547a64ad)
+++ aim.c	(revision 2674412c0adaeea507e6503a0552d66507ce2604)
@@ -63,4 +63,6 @@
 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...);
 static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...);
+static int conninitdone_chatnav  (aim_session_t *, aim_frame_t *, ...);
+static int conninitdone_chat     (aim_session_t *, aim_frame_t *, ...);
 int logout(aim_session_t *sess);
 
@@ -121,13 +123,9 @@
 void owl_aim_init(void)
 {
-  /* aim_session_init(owl_global_get_aimsess(&g), AIM_SESS_FLAGS_NONBLOCKCONNECT, 0); */
-
-  /*
-  aim_session_init(owl_global_get_aimsess(&g), TRUE, 0);
-  aim_setdebuggingcb(owl_global_get_aimsess(&g), faimtest_debugcb);
-  aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL);
-  */
-  /* an experiment to expose idle time */
-  /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */
+  /* this has all been moved to owl_aim_login, but we'll leave the
+   * function here, in case there's stuff we want to init in the
+   * future.  It's still called by Owl.
+   */
+     
 }
 
@@ -217,4 +215,6 @@
 			   owl_global_get_aim_ignorelogin_timer(&g));
 
+  
+  /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */
   /* aim_bos_setidle(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), 5000); */
 }
@@ -285,16 +285,46 @@
   /* there is a max away message lentgh we should check against */
 
-  /*
   aim_bos_setprofile(owl_global_get_aimsess(&g),
 		     owl_global_get_bosconn(&g),
 		     NULL, NULL, 0, "us-ascii", msg, 
 		     strlen(msg), 0);
-  */
   return(0);
 }
 
-void owl_aim_chat_join(char *chatroom, int exchange)
+void owl_aim_chat_join(char *name, int exchange)
 {
   int ret;
+  aim_conn_t *cur;
+  /*
+  OscarData *od = (OscarData *)g->proto_data;
+  char *name, *exchange;
+  */
+
+  owl_function_debugmsg("Attempting to join chatroom %s exchange %i", name, exchange);
+
+  /*
+  name = g_hash_table_lookup(data, "room");
+  exchange = g_hash_table_lookup(data, "exchange");
+  */
+  if ((cur = aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV))) {
+    owl_function_debugmsg("owl_aim_chat_join: chatnav exists, creating room");
+    aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange);
+  } else {
+    /*    struct create_room *cr = g_new0(struct create_room, 1); */
+    owl_function_debugmsg("owl_aim_chat_join: chatnav does not exist, opening chatnav");
+    /*
+    cr->exchange = atoi(exchange);
+    cr->name = g_strdup(name);
+    od->create_rooms = g_slist_append(od->create_rooms, cr);
+    */
+    /* aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV); */
+    aim_reqservice(owl_global_get_aimsess(&g), NULL, AIM_CONN_TYPE_CHATNAV);
+    aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange);
+    ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000);
+
+  }
+  return;
+  /******/
+
 
   /* ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); */
@@ -306,8 +336,7 @@
   aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV);
   ret = aim_chatnav_createroom(owl_global_get_aimsess(&g),
-			       aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), chatroom, exchange);
-   ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000);
-  
-  owl_function_debugmsg("Attempting to join chatroom %s exchange %i", chatroom, exchange);
+			       aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), name, exchange);
+   ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000);
+  
 }
 
@@ -555,4 +584,9 @@
 
   /*
+  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR,     gaim_connerr, 0);
+  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chatnav, 0);
+  */
+
+  /*
   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_ERROR,              faimtest_ssi_parseerr, 0);
   aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_RIGHTSINFO,         faimtest_ssi_parserights, 0);
@@ -675,4 +709,6 @@
   va_list ap;
   struct aim_redirect_data *redir;
+
+  owl_function_debugmsg("faimtest_handledirect:");
   
   va_start(ap, fr);
@@ -683,4 +719,6 @@
   } else if (redir->group == 0x0007) {  /* Authorizer */
     aim_conn_t *tstconn;
+
+    owl_function_debugmsg("faimtest_handledirect: autorizer");
     
     tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, redir->ip);
@@ -699,6 +737,8 @@
     }
   } else if (redir->group == 0x000d) {  /* ChatNav */
+    owl_function_debugmsg("faimtest_handledirect: chatnav");
     chatnav_redirect(sess, redir);
   } else if (redir->group == 0x000e) { /* Chat */
+    owl_function_debugmsg("faimtest_handledirect: chat");
     chat_redirect(sess, redir);
   } else {
@@ -2139,24 +2179,36 @@
 static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...)
 {
-
-  owl_function_debugmsg("in faimtest_conninitdone_chat");
+  owl_function_debugmsg("faimtest_conninitdone_chat:");
+
+  aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0);
+  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0);
+  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0);
+  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0);
+  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0);
   
   aim_clientready(sess, fr->conn);
   
-  if (fr->conn->type == AIM_CONN_TYPE_CHATNAV) {
-    /* printf("chatnav ready\n"); */
-    aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, faimtest_parse_genericerr, 0);
-    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, faimtest_chatnav_info, 0);
-    aim_chatnav_reqrights(sess, fr->conn);
-  } else if (fr->conn->type == AIM_CONN_TYPE_CHAT) {
-    /* printf("chat ready\n"); */
-    owl_function_debugmsg("Chat ready");
-    aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0);
-    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0);
-    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0);
-    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0);
-    aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0);
-  }
-  return 1;
+  owl_function_debugmsg("Chat ready");
+
+  /*
+    chatcon = find_oscar_chat_by_conn(gc, fr->conn);
+    chatcon->id = id;
+    chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show);
+  */
+  return(1);
+}
+
+static int conninitdone_chatnav(aim_session_t *sess, aim_frame_t *fr, ...)
+{
+  owl_function_debugmsg("faimtest_conninitdone_chatnav:");
+
+  aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, gaim_parse_genericerr, 0);
+  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
+
+  aim_clientready(sess, fr->conn);
+
+  aim_chatnav_reqrights(sess, fr->conn);
+
+  return(1);
 }
 
Index: commands.c
===================================================================
--- commands.c	(revision 88ca489f140c969c2a763d029331d3067c9c3d99)
+++ commands.c	(revision 2674412c0adaeea507e6503a0552d66507ce2604)
@@ -252,10 +252,8 @@
 	      "only available protocol is 'aim', specified as the first argument.\n"),
 
-#if 0
   OWLCMD_ARGS("join", owl_command_join, OWL_CTX_INTERACTIVE,
 	      "join a chat group",
 	      "join aim <groupname> [exchange]",
 	      "Join the AIM chatroom with 'groupname'.\n"),
-#endif
 
   OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
Index: keys.c
===================================================================
--- keys.c	(revision cf83b7a15ef998b48ca0aa69dae69a963b365dc1)
+++ keys.c	(revision 2674412c0adaeea507e6503a0552d66507ce2604)
@@ -33,7 +33,9 @@
        owl_keys_editwin_default, NULL, owl_keys_editwin_postalways);
   owl_keymap_set_submap(km_editwin, km_global);
+  /*
   BIND_CMD("F1",          "help",            "");
   BIND_CMD("HELP",        "help",            "");
   BIND_CMD("M-[ 2 8 ~",   "help",            "");
+  */
 
   BIND_CMD("C-c",         "edit:cancel", "");
