pidgin.2.5.8: 6aecd5e7: In addition to the plucks listed below, ...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Thu Jun 25 20:20:45 EDT 2009


-----------------------------------------------------------------
Revision: 6aecd5e7eb4b4ced28c1c4c5e50386030abfe1bd
Ancestor: c959ac21920e301c034d22f23d05015d56542412
Author: rekkanoryo at pidgin.im
Date: 2009-06-26T00:15:30
Branch: im.pidgin.pidgin.2.5.8
URL: http://d.pidgin.im/viewmtn/revision/info/6aecd5e7eb4b4ced28c1c4c5e50386030abfe1bd

Modified files:
        ChangeLog libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/parser.c
        libpurple/protocols/jabber/parser.h
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/myspace/myspace.h
        libpurple/protocols/myspace/zap.c

ChangeLog: 

In addition to the plucks listed below, I also changelogged these items.

*** Plucked rev 7c614b09b72037ebd86c03fbbeac7794a155547b (darkrain42 at pidgin.im):
disapproval of revision 'd34a15898cacf017df9190ca02741880be8dd940'

xmlParseChunk is not reentrant. This /just happened/ to work for '<proceed/>' but not '<proceed></proceed>'. Closes #9271.

*** Plucked rev 8806e5fba5cdb38ef9be6799e7e829dc2a762a69 (markdoliner at pidgin.im):
Stop exiting early from this function.  I don't believe it harms anything
to continue executing even if body is null, and if we exit early then
we don't call purple_connection_set_state(session->gc, PURPLE_CONNECTED)
and the account never gets set to \"connected.\"  This seems to affect
any MySpace account that has an empty buddy list.

I'm pretty sure this used to work fine, so I'm assuming MySpace tweaked
the data sent to the client when the user has an empty buddy list.

*** Plucked rev 08979461f8fd9f122c665f3ee192c20788dd1bca (markdoliner at pidgin.im):
Change the way we parse messages on MySpace a little bit.  This
fixes #8846: people using web myspaceIM can't respond to pidgin myspaceIM

For some reason IMs send using the myspace web site are sent so that
they won't become offline messages if the other person is offline.
I'm not really sure why that decision was made.

So now we treat messages with bm 1 the same as messages with bm 121. This means
we have to combine the function that parses out typing notification with
the function that parses IMs. And we check for typing notifications by
looking for %typing%. Which means if someone sends the IM \"%typing%\" with
no markup then we'll interpret it as a typing notification. And there's
nothing we can do to differentiate between the two. I asked.


-------------- next part --------------
============================================================
--- ChangeLog	2fe6324396dfef98a9f0851cf108868d110eabbc
+++ ChangeLog	413912221d5a2a4b0a63e05c7a716359fdbcc332
@@ -1,11 +1,20 @@ version 2.5.8 (06/26/2009):
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.5.8 (06/26/2009):
-	* Fixed phantom online Yahoo! buddies.  They should now properly disappear
-	  when signing out.
+	MySpace:
+	* Accounts with empty buddy lists are now properly marked as connected.
+	* Fix receiving messages from users of MySpace IM's web client.
+
+	Yahoo:
+	* Fixed phantom online buddies.  They should now properly disappear when
+	  signing out.
 	* Fixed the crashes some users were seeing with cn.scs.msg.yahoo.com in
 	  2.5.7.
+	* Fixed compiling on systems with glib 2.4.x or older.
 
+	XMPP:
+	* Fix an incompatibility betweeen Prosody and libpurple clients.
+
 version 2.5.7 (06/20/2009):
 	* Yahoo Protocol 16 support, including new HTTPS login method; this should
 	  fix a number of login problems that have recently cropped up.  (Sulabh
============================================================
--- libpurple/protocols/jabber/jabber.c	f35377fffa8deeeeb78be055e3b634cac8285f66
+++ libpurple/protocols/jabber/jabber.c	e9ff2f00730d59f3c03469fd78b36d923b72a1e5
@@ -77,10 +77,6 @@ static void jabber_stream_init(JabberStr
 						  "xmlns:stream='http://etherx.jabber.org/streams' "
 						  "version='1.0'>",
 						  js->user->domain);
-	if (js->reinit)
-		/* Close down the current stream to keep the XML parser happy */
-		jabber_parser_close_stream(js);
-
 	/* setup the parser fresh for each stream */
 	jabber_parser_setup(js);
 	jabber_send_raw(js, open_stream, -1);
@@ -645,9 +641,6 @@ static void tls_init(JabberStream *js)
 
 static void tls_init(JabberStream *js)
 {
-	/* Close down the current stream to keep the XML parser happy */
-	jabber_parser_close_stream(js);
-
 	purple_input_remove(js->gc->inpa);
 	js->gc->inpa = 0;
 	js->gsc = purple_ssl_connect_with_host_fd(js->gc->account, js->fd,
============================================================
--- libpurple/protocols/jabber/parser.c	b04e8d86669d4d2be9fb2cda4186dd6bb87b6563
+++ libpurple/protocols/jabber/parser.c	0de8ff31a0168689a59ca4969f6be4184fc4e0f4
@@ -205,12 +205,6 @@ jabber_parser_setup(JabberStream *js)
 	jabber_parser_free(js);
 }
 
-void
-jabber_parser_close_stream(JabberStream *js)
-{
-	xmlParseChunk(js->context, "</stream:stream>", 16 /* length */, 0);
-}
-
 void jabber_parser_free(JabberStream *js) {
 	if (js->context) {
 		xmlParseChunk(js->context, NULL,0,1);
============================================================
--- libpurple/protocols/jabber/parser.h	f23d0e2a0aebd094f70f73aa4fb80ca5274646ae
+++ libpurple/protocols/jabber/parser.h	bbc239a21eaa581c3c7c3f5a0546b085b4699532
@@ -25,7 +25,6 @@ void jabber_parser_setup(JabberStream *j
 #include "jabber.h"
 
 void jabber_parser_setup(JabberStream *js);
-void jabber_parser_close_stream(JabberStream *js);
 void jabber_parser_free(JabberStream *js);
 void jabber_parser_process(JabberStream *js, const char *buf, int len);
 
============================================================
--- libpurple/protocols/myspace/myspace.c	60c329056587d03ad0036cf8159c6dce3eff4f3b
+++ libpurple/protocols/myspace/myspace.c	860782170f97696ccdb2932bdb23df37796d3d9f
@@ -1111,10 +1111,6 @@ msim_got_contact_list(MsimSession *sessi
 	guint buddy_count;
 
 	body = msim_msg_get_dictionary(reply, "body");
-	if (!body) {
-		/* No friends. Not an error. */
-		return;
-	}
 
 	buddy_count = 0;
 
@@ -1470,28 +1466,22 @@ static gboolean
  * @return TRUE if successful.
  */
 static gboolean
-msim_incoming_im(MsimSession *session, MsimMessage *msg)
+msim_incoming_im(MsimSession *session, MsimMessage *msg, const gchar *username)
 {
-	gchar *username, *msg_msim_markup, *msg_purple_markup;
+	gchar *msg_msim_markup, *msg_purple_markup;
 	gchar *userid;
 	time_t time_received;
 	PurpleConversation *conv;
 
-	g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
-	g_return_val_if_fail(msg != NULL, FALSE);
-
-	username = msim_msg_get_string(msg, "_username");
 	/* I know this isn't really a string... but we need it to be one for
 	 * purple_find_conversation_with_account(). */
 	userid = msim_msg_get_string(msg, "f");
-	g_return_val_if_fail(username != NULL, FALSE);
 
 	purple_debug_info("msim_incoming_im", "UserID is %s", userid);
 
 	if (msim_is_userid(username)) {
 		purple_debug_info("msim", "Ignoring message from spambot (%s) on account %s\n",
 				username, purple_account_get_username(session->account));
-		g_free(username);
 		return FALSE;
 	}
 
@@ -1516,14 +1506,13 @@ msim_incoming_im(MsimSession *session, M
 
 	serv_got_im(session->gc, username, msg_purple_markup, PURPLE_MESSAGE_RECV, time_received);
 
-	g_free(username);
 	g_free(msg_purple_markup);
 
 	return TRUE;
 }
 
 /**
- * Handle an incoming action message.
+ * Handle an incoming action message or an IM.
  *
  * @param session
  * @param msg
@@ -1531,7 +1520,7 @@ static gboolean
  * @return TRUE if successful.
  */
 static gboolean
-msim_incoming_action(MsimSession *session, MsimMessage *msg)
+msim_incoming_action_or_im(MsimSession *session, MsimMessage *msg)
 {
 	gchar *msg_text, *username;
 	gboolean rc;
@@ -1545,7 +1534,8 @@ msim_incoming_action(MsimSession *sessio
 	username = msim_msg_get_string(msg, "_username");
 	g_return_val_if_fail(username != NULL, FALSE);
 
-	purple_debug_info("msim", "msim_incoming_action: action <%s> from <%s>\n",
+	purple_debug_info("msim",
+			"msim_incoming_action_or_im: action <%s> from <%s>\n",
 			msg_text, username);
 
 	if (g_str_equal(msg_text, "%typing%")) {
@@ -1559,13 +1549,16 @@ msim_incoming_action(MsimSession *sessio
 	} else if (strstr(msg_text, "!!!GroupCount=")) {
 		/* TODO: support group chats. I think the number in msg_text has
 		 * something to do with the 'gid' field. */
-		purple_debug_info("msim", "msim_incoming_action: TODO: implement #4691, group chats: %s\n", msg_text);
+		purple_debug_info("msim",
+				"msim_incoming_action_or_im: "
+				"TODO: implement #4691, group chats: %s\n", msg_text);
 
 		rc = TRUE;
 	} else if (strstr(msg_text, "!!!Offline=")) {
 		/* TODO: support group chats. This one might mean a user
 		 * went offline or exited the chat. */
-		purple_debug_info("msim", "msim_incoming_action: TODO: implement #4691, group chats: %s\n", msg_text);
+		purple_debug_info("msim", "msim_incoming_action_or_im: "
+				"TODO: implement #4691, group chats: %s\n", msg_text);
 
 		rc = TRUE;
 	} else if (msim_msg_get_integer(msg, "aid") != 0) {
@@ -1576,9 +1569,7 @@ msim_incoming_action(MsimSession *sessio
 
 		rc = TRUE;
 	} else {
-		msim_unrecognized(session, msg,
-				"got to msim_incoming_action but unrecognized value for 'msg'");
-		rc = FALSE;
+		rc = msim_incoming_im(session, msg, username);
 	}
 
 	g_free(msg_text);
@@ -1663,10 +1654,9 @@ msim_incoming_bm(MsimSession *session, M
 	switch (bm) {
 		case MSIM_BM_STATUS:
 			return msim_incoming_status(session, msg);
-		case MSIM_BM_INSTANT:
-			return msim_incoming_im(session, msg);
-		case MSIM_BM_ACTION:
-			return msim_incoming_action(session, msg);
+		case MSIM_BM_INSTANT_ACTION_OR_IM:
+		case MSIM_BM_DELAYABLE_ACTION_OR_IM:
+			return msim_incoming_action_or_im(session, msg);
 		case MSIM_BM_MEDIA:
 			return msim_incoming_media(session, msg);
 		case MSIM_BM_UNOFFICIAL_CLIENT:
@@ -1674,7 +1664,8 @@ msim_incoming_bm(MsimSession *session, M
 		default:
 			/* Not really an IM, but show it for informational
 			 * purposes during development. */
-			return msim_incoming_im(session, msg);
+			/* TODO: This is probably wrong */
+			return msim_incoming_action_or_im(session, msg);
 	}
 }
 
@@ -2287,7 +2278,7 @@ msim_send_im(PurpleConnection *gc, const
 
 	message_msim = html_to_msim_markup(session, message);
 
-	if (msim_send_bm(session, who, message_msim, MSIM_BM_INSTANT)) {
+	if (msim_send_bm(session, who, message_msim, MSIM_BM_DELAYABLE_ACTION_OR_IM)) {
 		/* Return 1 to have Purple show this IM as being sent, 0 to not. I always
 		 * return 1 even if the message could not be sent, since I don't know if
 		 * it has failed yet--because the IM is only sent after the userid is
@@ -2340,7 +2331,7 @@ msim_send_typing(PurpleConnection *gc, c
 	}
 
 	purple_debug_info("msim", "msim_send_typing(%s): %d (%s)\n", name, state, typing_str);
-	msim_send_bm(session, name, typing_str, MSIM_BM_ACTION);
+	msim_send_bm(session, name, typing_str, MSIM_BM_INSTANT_ACTION_OR_IM);
 	return 0;
 }
 
============================================================
--- libpurple/protocols/myspace/myspace.h	e294fc90345e61c08b02436888b9907794cc0605
+++ libpurple/protocols/myspace/myspace.h	f5d70f6419e122ee2c24cee6e8a12db4efb1e971
@@ -127,12 +127,12 @@
 #define MSIM_FINAL_STRING           "\\final\\" /**< Message end marker */
 
 /* Messages */
-#define MSIM_BM_INSTANT             1
-#define MSIM_BM_STATUS              100
-#define MSIM_BM_ACTION              121
-#define MSIM_BM_MEDIA               122
-#define MSIM_BM_PROFILE             124
-#define MSIM_BM_UNOFFICIAL_CLIENT   200
+#define MSIM_BM_DELAYABLE_ACTION_OR_IM  1
+#define MSIM_BM_STATUS                  100
+#define MSIM_BM_INSTANT_ACTION_OR_IM    121
+#define MSIM_BM_MEDIA                   122
+#define MSIM_BM_PROFILE                 124
+#define MSIM_BM_UNOFFICIAL_CLIENT       200
 
 /* Authentication algorithm for login2 */
 #define MSIM_AUTH_ALGORITHM         196610
============================================================
--- libpurple/protocols/myspace/zap.c	96acfd1e8e6c4a8e1cae6936b6b8e171e086f54a
+++ libpurple/protocols/myspace/zap.c	b88792bbfab44966b3688461d5edea2ac5086001
@@ -109,7 +109,7 @@ msim_send_zap(MsimSession *session, cons
 	/* Construct and send the actual zap command. */
 	zap_string = g_strdup_printf("!!!ZAP_SEND!!!=RTE_BTN_ZAPS_%d", code);
 
-	if (!msim_send_bm(session, username, zap_string, MSIM_BM_ACTION)) {
+	if (!msim_send_bm(session, username, zap_string, MSIM_BM_INSTANT_ACTION_OR_IM)) {
 		purple_debug_info("msim_send_zap",
 				"msim_send_bm failed: zapping %s with %s\n",
 				username, zap_string);


More information about the Commits mailing list