# HG changeset patch # User Eric Warmenhoven # Date 975384726 0 # Node ID 3063e6743913cac77aa54fbfbda78eab234a8e8f # Parent 201ec77f3a604dceb1855f7c5cf46adb9ebad3d5 [gaim-migrate @ 1163] handle the keepalives better. have ICQ force keepalives for connections, it's a bad hack but it's probably necessary for a UDP protocol. committer: Tailor Script diff -r 201ec77f3a60 -r 3063e6743913 Makefile.am --- a/Makefile.am Tue Nov 28 02:22:42 2000 +0000 +++ b/Makefile.am Tue Nov 28 04:12:06 2000 +0000 @@ -1,5 +1,5 @@ -EXTRA_DIST = gaim.spec.in gaim_applet.gnorba gaim.desktop gaim_applet.desktop gaim.soundlist \ +EXTRA_DIST = gaim.spec.in gaim_applet.gnorba gaim.desktop gaim_applet.desktop \ buddytrans buddytrans2 README.plugins HACKING if GNOMEAPPLET diff -r 201ec77f3a60 -r 3063e6743913 plugins/icq/gaim_icq.c --- a/plugins/icq/gaim_icq.c Tue Nov 28 02:22:42 2000 +0000 +++ b/plugins/icq/gaim_icq.c Tue Nov 28 04:12:06 2000 +0000 @@ -56,6 +56,7 @@ struct icq_data *id = (struct icq_data *)gc->proto_data; debug_printf("%s is now online.\n", gc->username); account_online(gc); + gc->options |= OPT_USR_KEEPALV; serv_finish_login(gc); if (bud_list_cache_exists(gc)) diff -r 201ec77f3a60 -r 3063e6743913 src/multi.c --- a/src/multi.c Tue Nov 28 02:22:42 2000 +0000 +++ b/src/multi.c Tue Nov 28 04:12:06 2000 +0000 @@ -55,7 +55,8 @@ gc->prpl = find_prpl(user->protocol); g_snprintf(gc->username, sizeof(gc->username), "%s", user->username); g_snprintf(gc->password, sizeof(gc->password), "%s", user->password); - gc->keepalive = -1; + gc->options = user->options; + gc->keepalive = 0; gc->inpa = -1; gc->buddy_chats = NULL; gc->groups = NULL; diff -r 201ec77f3a60 -r 3063e6743913 src/multi.h --- a/src/multi.h Tue Nov 28 02:22:42 2000 +0000 +++ b/src/multi.h Tue Nov 28 04:12:06 2000 +0000 @@ -54,10 +54,10 @@ char password[32]; char g_screenname[64]; int options; /* same as aim_user options */ - int keepalive; + guint keepalive; int correction_time; /* stuff needed for per-connection idle times */ - int idle_timer; + guint idle_timer; time_t login_time; time_t lastsent; int is_idle; diff -r 201ec77f3a60 -r 3063e6743913 src/oscar.c --- a/src/oscar.c Tue Nov 28 02:22:42 2000 +0000 +++ b/src/oscar.c Tue Nov 28 04:12:06 2000 +0000 @@ -383,9 +383,6 @@ gc->inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, conn); - gc->options = user->options; - save_prefs(); /* is this necessary anymore? */ - debug_print(_("Password sent, waiting for response\n")); } @@ -1014,9 +1011,6 @@ do_error_dialog(_("Your connection may be lost."), _("AOL error")); - if (gc->keepalive < 0) - update_keepalive(gc, gc->keepalive); - return 1; } diff -r 201ec77f3a60 -r 3063e6743913 src/server.c --- a/src/server.c Tue Nov 28 02:22:42 2000 +0000 +++ b/src/server.c Tue Nov 28 04:12:06 2000 +0000 @@ -67,11 +67,11 @@ if (gc->idle_timer > 0) gtk_timeout_remove(gc->idle_timer); - gc->idle_timer = -1; + gc->idle_timer = 0; if (gc->keepalive > 0) gtk_timeout_remove(gc->keepalive); - gc->keepalive = -1; + gc->keepalive = 0; if (gc->prpl && gc->prpl->close) (*gc->prpl->close)(gc); @@ -111,6 +111,8 @@ time(&gc->login_time); serv_add_buddy(gc, gc->username); + + update_keepalive(gc, gc->options & OPT_USR_KEEPALV); } @@ -704,18 +706,17 @@ void send_keepalive(gpointer d) { struct gaim_connection *gc = (struct gaim_connection *)d; - debug_print("sending oscar NOP\n"); if (gc->prpl && gc->prpl->keepalive) (*gc->prpl->keepalive)(gc); } void update_keepalive(struct gaim_connection *gc, gboolean on) { - if (on && gc->keepalive < 0 && blist) { + if (on && !gc->keepalive && blist) { debug_print("allowing NOP\n"); gc->keepalive = gtk_timeout_add(60000, (GtkFunction)send_keepalive, gc); - } else if (!on && gc->keepalive > -1) { + } else if (!on && gc->keepalive > 0) { debug_print("removing NOP\n"); gtk_timeout_remove(gc->keepalive); - gc->keepalive = -1; + gc->keepalive = 0; } } diff -r 201ec77f3a60 -r 3063e6743913 src/toc.c --- a/src/toc.c Tue Nov 28 02:22:42 2000 +0000 +++ b/src/toc.c Tue Nov 28 04:12:06 2000 +0000 @@ -47,7 +47,7 @@ #include "pixmaps/dt_icon.xpm" #include "pixmaps/free_icon.xpm" -#define REVISION "gaim:$Revision: 1156 $" +#define REVISION "gaim:$Revision: 1163 $" #define TYPE_SIGNON 1 #define TYPE_DATA 2 @@ -311,7 +311,6 @@ * version of the config and then the toc_init_done message. we'll come back to * the callback in a better state if we get CONFIG anyway */ - gc->options = gc->user->options; tdt->state = STATE_ONLINE; account_online(gc); @@ -328,9 +327,6 @@ FILE_SEND_UID, FILE_GET_UID, B_ICON_UID, IMAGE_UID, VOICE_UID); sflap_send(gc, snd, -1, TYPE_DATA); - if (gc->keepalive < 0) - update_keepalive(gc, gc->options & OPT_USR_KEEPALV); - return; }