diff plugins/icq/gaim_icq.c @ 1531:e06dcc3025a9

[gaim-migrate @ 1541] updates to icqlib; don't pay attention to exception; my patch for handling hangups. other minor details. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 04 Mar 2001 02:26:32 +0000
parents de0b946e86a4
children 352f05feb0d1
line wrap: on
line diff
--- a/plugins/icq/gaim_icq.c	Sun Mar 04 01:00:08 2001 +0000
+++ b/plugins/icq/gaim_icq.c	Sun Mar 04 02:26:32 2001 +0000
@@ -52,11 +52,12 @@
 GList *sockets = NULL;
 struct gaim_sock {
 	int socket;
+	int type;
 	gint inpa;
 };
 
 static void gaim_icq_handler(gpointer data, gint source, GdkInputCondition cond) {
-	if ((cond & GDK_INPUT_READ) || (cond & GDK_INPUT_EXCEPTION))
+	if (cond & GDK_INPUT_READ)
 		icq_HandleReadySocket(source, ICQ_SOCKET_READ);
 	if (cond & GDK_INPUT_WRITE)
 		icq_HandleReadySocket(source, ICQ_SOCKET_WRITE);
@@ -67,24 +68,27 @@
 	if (status) {
 		GdkInputCondition cond;
 		if (type == ICQ_SOCKET_READ)
-			cond = GDK_INPUT_READ | GDK_INPUT_EXCEPTION;
+			cond = GDK_INPUT_READ;
 		else
-			cond = GDK_INPUT_WRITE | GDK_INPUT_EXCEPTION;
+			cond = GDK_INPUT_WRITE;
 		gs = g_new0(struct gaim_sock, 1);
 		gs->socket = socket;
+		gs->type = type;
 		gs->inpa = gdk_input_add(socket, cond, gaim_icq_handler, NULL);
 		sockets = g_list_append(sockets, gs);
+		debug_printf("Adding socket notifier: %d %d (%d)\n", socket, type, gs->inpa);
 	} else {
 		GList *m = sockets;
 		while (m) {
 			gs = m->data;
-			if (gs->socket == socket)
+			if ((gs->socket == socket) && (gs->type == type))
 				break;
 			m = g_list_next(m);
 		}
 		if (m) {
 			gdk_input_remove(gs->inpa);
 			sockets = g_list_remove(sockets, gs);
+			debug_printf("Removing socket notifier: %d %d (%d)\n", socket, type, gs->inpa);
 			g_free(gs);
 		}
 	}