# HG changeset patch
# Node ID 2e662e5e426d
# Parent  9da3c24cac29
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -473,6 +473,7 @@ version 3.0.0 (??/??/????):
 		* purple_idle_get_ui_ops
 		* purple_idle_set_ui_ops
 		* purple_idle_ui_ops_get_type
+		* purple_input_remove
 		* purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
 		  purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
 		  or #GInetAddress instead.
diff --git a/libpurple/eventloop.h b/libpurple/eventloop.h
--- a/libpurple/eventloop.h
+++ b/libpurple/eventloop.h
@@ -79,16 +79,6 @@ guint purple_input_add(int fd, PurpleInp
                        PurpleInputFunction func, gpointer user_data);
 
 /**
- * purple_input_remove:
- * @handle: The handle of the input handler. Note that this is the return
- *          value from purple_input_add(), <emphasis>not</emphasis> the
- *          file descriptor.
- *
- * Removes an input handler.
- */
-gboolean purple_input_remove(guint handle);
-
-/**
  * purple_input_pipe:
  * @pipefd: Array used to return file descriptors for both ends of pipe.
  *
diff --git a/libpurple/eventloop.c b/libpurple/eventloop.c
--- a/libpurple/eventloop.c
+++ b/libpurple/eventloop.c
@@ -83,12 +83,6 @@ purple_input_add(int source, PurpleInput
 	return closure->result;
 }
 
-gboolean
-purple_input_remove(guint tag)
-{
-	return g_source_remove(tag);
-}
-
 int
 purple_input_pipe(int pipefd[2])
 {
diff --git a/libpurple/protocols/bonjour/mdns_dns_sd.c b/libpurple/protocols/bonjour/mdns_dns_sd.c
--- a/libpurple/protocols/bonjour/mdns_dns_sd.c
+++ b/libpurple/protocols/bonjour/mdns_dns_sd.c
@@ -91,7 +91,7 @@ static gint
 static void
 _cleanup_resolver_data(Win32SvcResolverData *rd) {
 	if (rd->txt_query != NULL) {
-		purple_input_remove(rd->txt_query->input_handler);
+		g_source_remove(rd->txt_query->input_handler);
 		DNSServiceRefDeallocate(rd->txt_query->sdRef);
 		g_free(rd->txt_query);
 	}
@@ -157,7 +157,7 @@ static void DNSSD_API
 			bonjour_buddy_got_buddy_icon(bb, rdata, rdlen);
 
 			/* We've got what we need; stop listening */
-			purple_input_remove(idata->null_query->input_handler);
+			g_source_remove(idata->null_query->input_handler);
 			DNSServiceRefDeallocate(idata->null_query->sdRef);
 			g_free(idata->null_query);
 			idata->null_query = NULL;
@@ -176,7 +176,7 @@ static void DNSSD_API
 	gboolean delete_buddy = FALSE;
 	PurpleBuddy *pb = NULL;
 
-	purple_input_remove(args->resolver_query->input_handler);
+	g_source_remove(args->resolver_query->input_handler);
 	DNSServiceRefDeallocate(args->resolver_query->sdRef);
 	g_free(args->resolver_query);
 	args->resolver_query = NULL;
@@ -269,7 +269,7 @@ static void DNSSD_API
 	Win32BuddyImplData *idata = args->bb->mdns_impl_data;
 
 	/* remove the input fd and destroy the service ref */
-	purple_input_remove(args->resolver_query->input_handler);
+	g_source_remove(args->resolver_query->input_handler);
 	DNSServiceRefDeallocate(args->resolver_query->sdRef);
 
 	if (errorCode != kDNSServiceErr_NoError)
@@ -578,13 +578,13 @@ dns_sd_mdns_stop(BonjourDnsSd *data)
 		return;
 
 	if (idata->presence_query != NULL) {
-		purple_input_remove(idata->presence_query->input_handler);
+		g_source_remove(idata->presence_query->input_handler);
 		DNSServiceRefDeallocate(idata->presence_query->sdRef);
 		g_free(idata->presence_query);
 	}
 
 	if (idata->browser_query != NULL) {
-		purple_input_remove(idata->browser_query->input_handler);
+		g_source_remove(idata->browser_query->input_handler);
 		DNSServiceRefDeallocate(idata->browser_query->sdRef);
 		g_free(idata->browser_query);
 	}
@@ -644,7 +644,7 @@ dns_sd_mdns_delete_buddy(BonjourBuddy *b
 	}
 
 	if (idata->null_query != NULL) {
-		purple_input_remove(idata->null_query->input_handler);
+		g_source_remove(idata->null_query->input_handler);
 		DNSServiceRefDeallocate(idata->null_query->sdRef);
 		g_free(idata->null_query);
 	}
@@ -664,7 +664,7 @@ dns_sd_mdns_retrieve_buddy_icon(BonjourB
 
 	/* Cancel any existing query */
 	if (idata->null_query != NULL) {
-		purple_input_remove(idata->null_query->input_handler);
+		g_source_remove(idata->null_query->input_handler);
 		DNSServiceRefDeallocate(idata->null_query->sdRef);
 		g_free(idata->null_query);
 		idata->null_query = NULL;
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -356,7 +356,7 @@ static void ggp_callback_recv(gpointer _
 			gg_debug_event(ev->type));
 	}
 
-	purple_input_remove(info->inpa);
+	g_source_remove(info->inpa);
 	info->inpa = purple_input_add(info->session->fd,
 		ggp_tcpsocket_inputcond_gg_to_purple(info->session->check),
 		ggp_callback_recv, gc);
@@ -504,7 +504,7 @@ void ggp_async_login_handler(gpointer _g
 	purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n",
 			info->session->check, info->session->state);
 
-	purple_input_remove(info->inpa);
+	g_source_remove(info->inpa);
 	info->inpa = 0;
 
 	/** XXX I think that this shouldn't be done if ev->type is GG_EVENT_CONN_FAILED or GG_EVENT_CONN_SUCCESS -datallah */
@@ -526,7 +526,7 @@ void ggp_async_login_handler(gpointer _g
 					info->session->connect_host);
 				ggp_servconn_add_server(info->session->
 					connect_host);
-				purple_input_remove(info->inpa);
+				g_source_remove(info->inpa);
 				info->inpa = purple_input_add(info->session->fd,
 					PURPLE_INPUT_READ,
 					ggp_callback_recv, gc);
@@ -539,7 +539,7 @@ void ggp_async_login_handler(gpointer _g
 			break;
 		case GG_EVENT_CONN_FAILED:
 			if (info->inpa > 0) {
-				purple_input_remove(info->inpa);
+				g_source_remove(info->inpa);
 				info->inpa = 0;
 			}
 			purple_debug_info("gg", "Connection failure: %d\n",
@@ -934,7 +934,7 @@ static void ggp_close(PurpleConnection *
 		ggp_edisc_cleanup(gc);
 
 		if (info->inpa > 0)
-			purple_input_remove(info->inpa);
+			g_source_remove(info->inpa);
 		g_free(info->imtoken);
 
 		if (info->http) {
diff --git a/libpurple/protocols/gg/libgaduw.c b/libpurple/protocols/gg/libgaduw.c
--- a/libpurple/protocols/gg/libgaduw.c
+++ b/libpurple/protocols/gg/libgaduw.c
@@ -173,7 +173,7 @@ static void ggp_libgaduw_http_handler(gp
 	}
 
 	if (req->h->state != GG_STATE_DONE) {
-		purple_input_remove(req->inpa);
+		g_source_remove(req->inpa);
 		req->inpa = ggp_purplew_http_input_add(req->h,
 			ggp_libgaduw_http_handler, req);
 		return;
@@ -206,7 +206,7 @@ static void ggp_libgaduw_http_finish(ggp
 		ggp_purplew_request_processing_done(req->processing);
 		req->processing = NULL;
 	}
-	purple_input_remove(req->inpa);
+	g_source_remove(req->inpa);
 	req->cb(req->h, success, req->cancelled, req->user_data);
 	req->h->destroy(req->h);
 	g_free(req);
diff --git a/libpurple/protocols/irc/dcc_send.c b/libpurple/protocols/irc/dcc_send.c
--- a/libpurple/protocols/irc/dcc_send.c
+++ b/libpurple/protocols/irc/dcc_send.c
@@ -168,7 +168,7 @@ static void irc_dccsend_send_read(gpoint
 		return;
 	else if (len <= 0) {
 		/* XXX: Shouldn't this be canceling the transfer? */
-		purple_input_remove(xd->inpa);
+		g_source_remove(xd->inpa);
 		xd->inpa = 0;
 		return;
 	}
@@ -198,7 +198,7 @@ static void irc_dccsend_send_read(gpoint
 		}
 
 		if ((goffset)acked >= purple_xfer_get_size(xfer)) {
-			purple_input_remove(xd->inpa);
+			g_source_remove(xd->inpa);
 			xd->inpa = 0;
 			purple_xfer_set_completed(xfer, TRUE);
 			purple_xfer_end(xfer);
@@ -381,7 +381,7 @@ irc_xfer_finalize(GObject *obj) {
 	}
 	g_clear_object(&xfer->service);
 	if(xfer->inpa > 0) {
-		purple_input_remove(xfer->inpa);
+		g_source_remove(xfer->inpa);
 	}
 	g_clear_object(&xfer->conn);
 
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -389,7 +389,7 @@ static void mw_session_io_close(struct m
 
   if (pd->stream) {
     if (pd->inpa) {
-      purple_input_remove(pd->inpa);
+      g_source_remove(pd->inpa);
       pd->inpa = 0;
     }
 
@@ -3634,7 +3634,7 @@ static void mw_protocol_close(PurpleConn
 
   /* stop watching the socket */
   if(pd->inpa) {
-    purple_input_remove(pd->inpa);
+    g_source_remove(pd->inpa);
     pd->inpa = 0;
   }
 
diff --git a/libpurple/protocols/silc/silc.c b/libpurple/protocols/silc/silc.c
--- a/libpurple/protocols/silc/silc.c
+++ b/libpurple/protocols/silc/silc.c
@@ -203,7 +203,7 @@ silcpurple_scheduler(SilcSchedule schedu
 	    silc_dlist_start(sg->tasks);
 	    while ((ptask = silc_dlist_get(sg->tasks)))
 	      if (ptask->fd == fd) {
-		purple_input_remove(ptask->tag);
+		g_source_remove(ptask->tag);
 		break;
 	      }
 
@@ -240,7 +240,7 @@ silcpurple_scheduler(SilcSchedule schedu
 	    silc_dlist_start(sg->tasks);
 	    while ((ptask = silc_dlist_get(sg->tasks)))
 	      if (ptask->fd == fd) {
-		purple_input_remove(ptask->tag);
+		g_source_remove(ptask->tag);
 		silc_dlist_del(sg->tasks, ptask);
 		silc_free(ptask);
 		break;
@@ -736,7 +736,7 @@ silcpurple_close(PurpleConnection *gc)
 
 	silc_dlist_start(sg->tasks);
 	while ((task = silc_dlist_get(sg->tasks))) {
-	  purple_input_remove(task->tag);
+	  g_source_remove(task->tag);
 	  silc_free(task);
 	}
 	silc_dlist_uninit(sg->tasks);
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -1373,7 +1373,7 @@ do_transfer(PurpleXfer *xfer)
 		   if it needs to for some odd reason. */
 		if (s == 0) {
 			if (priv->watcher) {
-				purple_input_remove(priv->watcher);
+				g_source_remove(priv->watcher);
 				purple_xfer_set_watcher(xfer, 0);
 			}
 			return;
@@ -1399,7 +1399,7 @@ do_transfer(PurpleXfer *xfer)
 				 * sets back up this watcher.
 				 */
 				if (priv->watcher != 0) {
-					purple_input_remove(priv->watcher);
+					g_source_remove(priv->watcher);
 					purple_xfer_set_watcher(xfer, 0);
 				}
 
@@ -1492,7 +1492,7 @@ transfer_cb(gpointer data, gint source, 
 		if (0 == (priv->ready & PURPLE_XFER_READY_UI)) {
 			priv->ready |= PURPLE_XFER_READY_PROTOCOL;
 
-			purple_input_remove(priv->watcher);
+			g_source_remove(priv->watcher);
 			purple_xfer_set_watcher(xfer, 0);
 
 			purple_debug_misc("xfer", "Protocol is ready on ft %p, waiting for UI\n", xfer);
@@ -1730,7 +1730,7 @@ purple_xfer_end(PurpleXfer *xfer)
 	}
 
 	if (priv->watcher != 0) {
-		purple_input_remove(priv->watcher);
+		g_source_remove(priv->watcher);
 		purple_xfer_set_watcher(xfer, 0);
 	}
 
@@ -1807,7 +1807,7 @@ purple_xfer_cancel_local(PurpleXfer *xfe
 	}
 
 	if (priv->watcher != 0) {
-		purple_input_remove(priv->watcher);
+		g_source_remove(priv->watcher);
 		purple_xfer_set_watcher(xfer, 0);
 	}
 
@@ -1871,7 +1871,7 @@ purple_xfer_cancel_remote(PurpleXfer *xf
 	}
 
 	if (priv->watcher != 0) {
-		purple_input_remove(priv->watcher);
+		g_source_remove(priv->watcher);
 		purple_xfer_set_watcher(xfer, 0);
 	}
 
