changeset 18652:ddb7212a8794

merge of '48f62c11849f8d3ade036cacace03635cf7985ec' and '646137a13a39329e56cf125195eed6f2269ce5f2'
author Ka-Hing Cheung <khc@hxbc.us>
date Fri, 27 Jul 2007 03:47:09 +0000
parents 8f36a83bc1cf (current diff) b981d3c39d0b (diff)
children 9f3c2c5d96b2 69cb4582b513
files
diffstat 2 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c	Fri Jul 27 00:33:21 2007 +0000
+++ b/libpurple/protocols/bonjour/jabber.c	Fri Jul 27 03:47:09 2007 +0000
@@ -350,7 +350,6 @@
 	PurpleAccount *account = pb->account;
 	BonjourBuddy *bb = pb->proto_data;
 	gboolean closed_conversation = FALSE;
-	xmlnode *message_node;
 
 	/* Read the data from the socket */
 	if ((message_length = _read_data(socket, &message)) == -1) {
@@ -374,9 +373,6 @@
 		}
 	}
 
-	/* Parse the message into an XMLnode for analysis */
-	message_node = xmlnode_from_str(message, strlen(message));
-
 	/*
 	 * Check that this is not the end of the conversation.  This is
 	 * using a magic string, but xmlnode won't play nice when just
@@ -396,16 +392,22 @@
 			purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
 			g_free(tmp);
 		}
-	} else if (message_node != NULL) {
-		/* Parse the message to get the data and send to the ui */
-		_jabber_parse_and_write_message_to_ui(message_node, account->gc, pb);
 	} else {
-		/* TODO: Deal with receiving only a partial message */
+		xmlnode *message_node;
+
+		/* Parse the message into an XMLnode for analysis */
+		message_node = xmlnode_from_str(message, strlen(message));
+
+		if (message_node != NULL) {
+			/* Parse the message to get the data and send to the ui */
+			_jabber_parse_and_write_message_to_ui(message_node, account->gc, pb);
+			xmlnode_free(message_node);
+		} else {
+			/* TODO: Deal with receiving only a partial message */
+		}
 	}
 
 	g_free(message);
-	if (message_node != NULL)
-		xmlnode_free(message_node);
 }
 
 struct _stream_start_data {
@@ -638,7 +640,7 @@
 	PurpleBuddy *pb = data;
 	BonjourBuddy *bb = pb->proto_data;
 	int len, ret;
-	char *stream_start = g_strdup_printf(DOCTYPE, purple_account_get_username(pb->account), purple_buddy_get_name(pb));
+	char *stream_start;
 
 	bb->conversation->connect_data = NULL;
 
@@ -659,6 +661,7 @@
 		return;
 	}
 
+	stream_start = g_strdup_printf(DOCTYPE, purple_account_get_username(pb->account), purple_buddy_get_name(pb));
 	len = strlen(stream_start);
 
 	/* Start the stream and send queued messages */
--- a/libpurple/protocols/yahoo/yahoo.c	Fri Jul 27 00:33:21 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Fri Jul 27 03:47:09 2007 +0000
@@ -1917,6 +1917,7 @@
 	char *msg;
 	char *url = NULL;
 	char *fullmsg;
+	PurpleAccount *account = gc->account;
 
 	while (l) {
 		struct yahoo_pair *pair = l->data;
@@ -1949,6 +1950,9 @@
 			return;
 		}
 #endif
+		if (!purple_account_get_remember_password(account))
+			purple_account_set_password(account, NULL);
+
 		msg = g_strdup(_("Incorrect password."));
 		break;
 	case 14: