changeset 32770:a5f50581b7c0

Myspace: Move "inpa" input watcher into protocol_data.
author andrew.victor@mxit.com
date Tue, 18 Oct 2011 21:02:58 +0000
parents d8c652ea476a
children a78523019e7a
files libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/session.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Tue Oct 18 20:58:39 2011 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Tue Oct 18 21:02:58 2011 +0000
@@ -2167,8 +2167,7 @@
 	}
 
 	session->fd = source;
-
-	gc->inpa = purple_input_add(source, PURPLE_INPUT_READ, msim_input_cb, gc);
+	session->inpa = purple_input_add(source, PURPLE_INPUT_READ, msim_input_cb, gc);
 }
 
 /**
@@ -2263,8 +2262,9 @@
 
 	purple_connection_set_protocol_data(gc, NULL);
 
-	if (session->gc->inpa) {
-		purple_input_remove(session->gc->inpa);
+	if (session->inpa) {
+		purple_input_remove(session->inpa);
+		session->inpa = 0;
 	}
 	if (session->fd >= 0) {
 		close(session->fd);
--- a/libpurple/protocols/myspace/session.h	Tue Oct 18 20:58:39 2011 +0000
+++ b/libpurple/protocols/myspace/session.h	Tue Oct 18 21:02:58 2011 +0000
@@ -38,6 +38,7 @@
 	int privacy_mode;                   /**< This is a bitmask */
 	int offline_message_mode;
 	gint fd;                            /**< File descriptor to/from server */
+	guint inpa;							/**< The input watcher */
 
 	/* TODO: Remove. */
 	GHashTable *user_lookup_cb;         /**< Username -> userid lookup callback */