Mercurial > pidgin.yaz
diff src/toc.c @ 300:b32c83750104
[gaim-migrate @ 310]
Pressing enter to send in buddy chats works again, and the CONFIG stuff works
a little bit better, I hope.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 01 Jun 2000 03:06:27 +0000 |
parents | a88b889b692b |
children | f905caee43ca |
line wrap: on
line diff
--- a/src/toc.c Thu Jun 01 01:43:01 2000 +0000 +++ b/src/toc.c Thu Jun 01 03:06:27 2000 +0000 @@ -138,24 +138,24 @@ g_snprintf(buf, sizeof(buf), "Retrieving config..."); set_login_progress(5, buf); - if ((config=toc_wait_config()) == NULL) { - hide_login_progress("No Configuration"); - set_state(STATE_OFFLINE); - return -1; + config = toc_wait_config(); - } - - #ifdef USE_APPLET make_buddy(); if (general_options & OPT_GEN_APP_BUDDY_SHOW) { gnome_buddy_show(); - parse_toc_buddy_list(config, 0); + if (config != NULL) + parse_toc_buddy_list(config, 0); + else + do_import(0, 0); createOnlinePopup(); set_applet_draw_open(); } else { gnome_buddy_hide(); - parse_toc_buddy_list(config, 0); + if (config != NULL) + parse_toc_buddy_list(config, 0); + else + do_import(0, 0); set_applet_draw_closed(); } @@ -165,7 +165,10 @@ #else gtk_widget_hide(mainwindow); show_buddy_list(); - parse_toc_buddy_list(config, 0); + if (config != NULL) + parse_toc_buddy_list(config, 0); + else + do_import(0, 0); refresh_buddy_window(); #endif @@ -438,6 +441,8 @@ serv_got_update(c, logged, evil, signon, time_idle, type); + } else if (!strcasecmp(c, "CONFIG")) { + /* do we want to load the buddy list again here? */ } else if (!strcasecmp(c, "ERROR")) { c = strtok(NULL,":"); show_error_dialog(c); @@ -789,25 +794,27 @@ /* Waits for configuration packet, returning the contents of the packet */ static char buf[BUF_LEN]; int res; - res = wait_reply(buf, sizeof(buf)); + res = wait_reply(buf, sizeof(buf)); if (res < 0) return NULL; -/* Apparently, the toc_config is optional. *VERY* Optional - if (state != STATE_CONFIG) { - sprintf(debug_buff , "State should be %d, but is %d instead\n",STATE_CONFIG, state); - debug_print(debug_buff); - - return NULL; - } +/* Apparently, the toc_config is optional. *VERY* Optional */ + if (state != STATE_CONFIG) { + res = 0; + } else { + res = 1; + } /* At this point, it's time to setup automatic handling of incoming packets */ - state = STATE_ONLINE; + state = STATE_ONLINE; #ifdef _WIN32 - win32_r = gtk_timeout_add(1000, (GtkFunction)win32_read, NULL); + win32_r = gtk_timeout_add(1000, (GtkFunction)win32_read, NULL); #else - inpa = gdk_input_add(toc_fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, toc_callback, NULL); + inpa = gdk_input_add(toc_fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, toc_callback, NULL); #endif - return buf; + if (res) + return buf; + else + return NULL; } #endif /* USE_OSCAR */