changeset 28249:e4b0bf56667f

Explicitly add a stub for the status mood myspace messages. Closes #9887. Patch from Justin Williams (although Mark's change also fixed it so that these messages won't pop-up as IMs).
author Paul Aurich <paul@darkrain42.org>
date Thu, 13 Aug 2009 15:55:19 +0000
parents e30de9ebfa69
children 55549f101140
files ChangeLog libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h
diffstat 3 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Aug 13 04:05:13 2009 +0000
+++ b/ChangeLog	Thu Aug 13 15:55:19 2009 +0000
@@ -47,6 +47,8 @@
 	* Various memory leaks fixed as reported by Josh Mueller.
 	* Properly handle an IRC buddy appearing in multiple groups.
 	* Escape HTML entities in usernames when written with the HTML logger.
+	* Do not display MySpace status changes as incoming IMs.  (Mark Doliner and
+	  Justin Williams)
 
 	AIM and ICQ:
 	* Preliminary support for a new authentication scheme called
--- a/libpurple/protocols/myspace/myspace.c	Thu Aug 13 04:05:13 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Thu Aug 13 15:55:19 2009 +0000
@@ -1341,6 +1341,27 @@
 	return ret;
 }
 #endif
+/**
+ * Process incoming status mood messages.
+ *
+ * @param session
+ * @param msg Status mood update message. Caller frees.
+ *
+ * @return TRUE if successful.
+ */
+static gboolean
+msim_incoming_status_mood(MsimSession *session, MsimMessage *msg) {
+	/* TODO: I dont know too much about this yet,
+	 * so until I see how the official client handles
+	 * this and decide if libpurple should as well,
+	 * well just say we used it
+	 */
+	gchar *ss;
+	ss = msim_msg_get_string(msg, "msg");
+	purple_debug_info("msim", "Incoming Status Message: %s", ss ? ss : "(NULL)");
+	g_free(ss);
+	return TRUE;
+}
 
 /**
  * Process incoming status messages.
@@ -1692,6 +1713,8 @@
 			return msim_incoming_media(session, msg);
 		case MSIM_BM_UNOFFICIAL_CLIENT:
 			return msim_incoming_unofficial_client(session, msg);
+		case MSIM_BM_STATUS_MOOD:
+			return msim_incoming_status_mood(session, msg);
 		default:
 			/*
 			 * Unknown message type!  We used to call
--- a/libpurple/protocols/myspace/myspace.h	Thu Aug 13 04:05:13 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Thu Aug 13 15:55:19 2009 +0000
@@ -132,6 +132,7 @@
 #define MSIM_BM_ACTION_OR_IM_INSTANT    121
 #define MSIM_BM_MEDIA                   122
 #define MSIM_BM_PROFILE                 124
+#define MSIM_BM_STATUS_MOOD             126
 #define MSIM_BM_UNOFFICIAL_CLIENT       200
 
 /* Authentication algorithm for login2 */