changeset 15029:9e720be7d8b9

[gaim-migrate @ 17811] I wanted to make networkmanager detection of disconnected networks just send keepalives as not to kill the connection if it doesn't have to committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 22 Nov 2006 18:40:11 +0000
parents 0570155bed53
children b4346a8b446f
files gtk/gtkconn.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkconn.c	Wed Nov 22 18:16:51 2006 +0000
+++ b/gtk/gtkconn.c	Wed Nov 22 18:40:11 2006 +0000
@@ -214,14 +214,25 @@
 {
 	GList *l = gaim_accounts_get_all_active();
 	GaimGtkBuddyList *gtkblist = gaim_gtk_blist_get_default_gtk_blist();
-
+	GaimPluginProtocolInfo *prpl_info = NULL;
+	GaimConnection *gc = NULL;
+	
 	if(gtkblist)
 		gtk_gaim_status_box_set_network_available(GTK_GAIM_STATUS_BOX(gtkblist->statusbox), FALSE);
 
 	while (l) {
 		GaimAccount *a = (GaimAccount*)l->data;
-		if (!gaim_account_is_disconnected(a))
-			gaim_account_disconnect(a);
+		if (!gaim_account_is_disconnected(a)) {
+			gc = gaim_account_get_connection(a);
+			if (gc && gc->prpl) 
+				prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
+			if (prpl_info) {
+				if (prpl_info->keepalive)
+					prpl_info->keepalive(gc);
+				else
+					gaim_account_disconnect(a);
+			}
+		}
 		l = l->next;
 	}
 }