changeset 17371:948373cbba1c

Add TODO in order to fix msim_tooltip_text. Add TODO to fix bug #193. Call purple_input_remove() in msim_close(), in an attempt to fix bug #193 (does not help).
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 11 Jun 2007 06:17:16 +0000
parents 7a0061f4845d
children d9aaccef8721
files libpurple/protocols/myspace/myspace.c
diffstat 1 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Thu Jun 07 04:56:01 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Mon Jun 11 06:17:16 2007 +0000
@@ -757,6 +757,7 @@
 	g_hash_table_destroy(body);
 }
 
+#ifdef _MSIM_UID2USERNAME_WORKS
 /* Lookup a username by userid, from buddy list. 
  *
  * @param wanted_uid
@@ -845,6 +846,8 @@
 	return NULL;
 }
 
+#endif
+
 /** Preprocess incoming messages, resolving as needed, calling msim_process() when ready to process.
  *
  * TODO: if no uid to resolve, process immediately. if uid, check if know username,
@@ -1000,8 +1003,15 @@
         body = msim_parse_body(body_str);
 		g_free(body_str);
 
+
 		/* TODO: implement a better hash-like interface, and use it. */
         username = g_hash_table_lookup(body, "UserName");
+
+		/* TODO: Save user info reply for msim_tooltip_text. */
+		/* TODO: get rid of user_lookup_cache, and find another way to 
+		 * pass the relevant information to msim_tooltip_text. */
+		/* g_hash_table_insert(session->user_lookup_cache, username, body); */
+
         if (username)
         {
 			PurpleBuddy *buddy;
@@ -1421,7 +1431,8 @@
     session = gc->proto_data;
 
     g_return_if_fail(cond == PURPLE_INPUT_READ);
-    g_return_if_fail(MSIM_SESSION_VALID(session));
+	/* TODO: fix bug #193, crash when re-login */
+	g_return_if_fail(MSIM_SESSION_VALID(session));
 
     /* Only can handle so much data at once... 
      * If this happens, try recompiling with a higher MSIM_READ_BUF_SIZE.
@@ -1625,11 +1636,19 @@
  */
 void msim_close(PurpleConnection *gc)
 {
-    g_return_if_fail(gc != NULL);
+	MsimSession *session;
 
 	purple_debug_info("msim", "msim_close: destroying session\n");
-    
-    msim_session_destroy(gc->proto_data);
+
+	session = (MsimSession *)gc->proto_data;
+
+    g_return_if_fail(gc != NULL);
+	g_return_if_fail(session != NULL);
+	g_return_if_fail(MSIM_SESSION_VALID(session));
+
+   
+    purple_input_remove(session->fd);
+    msim_session_destroy(session);
 }