libpurple/protocols/myspace/myspace.c

branch
soc.2007.msimprpl
changeset 17958
9f809365230b
parent 17957
bc5874ed7a09
child 17959
cfbe7f9e5200
--- 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);
 }
 
 

mercurial