im.pidgin.pidgin: 55c9e6a9c4728a7d3394eb9f5c6042bc0657e72d

datallah at pidgin.im datallah at pidgin.im
Sat Oct 13 13:05:35 EDT 2007


-----------------------------------------------------------------
Revision: 55c9e6a9c4728a7d3394eb9f5c6042bc0657e72d
Ancestor: ca09db83bd2ae802d4a6d7078a1efdfe9a896cb5
Author: datallah at pidgin.im
Date: 2007-10-13T16:36:06
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/simple/simple.c

ChangeLog: 

Patch from Will Hawkins for some cleanup of the SIMPLE notify message processing.  This should hopefully fix some cases when a user signs off but we don't notice. Fixes #3507.

-------------- next part --------------
============================================================
--- libpurple/protocols/simple/simple.c	5d7f9c3db78f3c1fe3f63ccf85e22df06c82b82b
+++ libpurple/protocols/simple/simple.c	2051c619d9b03815a99dca8d02d460cd9147bada
@@ -1073,7 +1073,7 @@ static void process_incoming_notify(stru
 static void process_incoming_notify(struct simple_account_data *sip, struct sipmsg *msg) {
 	gchar *from;
 	gchar *fromhdr;
-	gchar *tmp2;
+	gchar *basicstatus_data;
 	xmlnode *pidf;
 	xmlnode *basicstatus = NULL, *tuple, *status;
 	gboolean isonline = FALSE;
@@ -1086,8 +1086,9 @@ static void process_incoming_notify(stru
 
 	if(!pidf) {
 		purple_debug_info("simple", "process_incoming_notify: no parseable pidf\n");
-		g_free(from);
+		purple_prpl_got_user_status(sip->account, from, "offline", NULL);
 		send_sip_response(sip->gc, msg, 200, "OK", NULL);
+		g_free(from);
 		return;
 	}
 
@@ -1102,27 +1103,28 @@ static void process_incoming_notify(stru
 		return;
 	}
 
-	tmp2 = xmlnode_get_data(basicstatus);
+	basicstatus_data = xmlnode_get_data(basicstatus);
 
-	if(!tmp2) {
+	if(!basicstatus_data) {
 		purple_debug_info("simple", "process_incoming_notify: no basic data found\n");
 		xmlnode_free(pidf);
 		g_free(from);
 		return;
 	}
 
-	if(strstr(tmp2, "open")) {
+	if(strstr(basicstatus_data, "open"))
 		isonline = TRUE;
-	}
 
-	g_free(tmp2);
 
-	if(isonline) purple_prpl_got_user_status(sip->account, from, "available", NULL);
-	else purple_prpl_got_user_status(sip->account, from, "offline", NULL);
+	if(isonline) 
+		purple_prpl_got_user_status(sip->account, from, "available", NULL);
+	else 
+		purple_prpl_got_user_status(sip->account, from, "offline", NULL);
 
 	xmlnode_free(pidf);
-
 	g_free(from);
+	g_free(basicstatus_data);
+
 	send_sip_response(sip->gc, msg, 200, "OK", NULL);
 }
 


More information about the Commits mailing list