# HG changeset patch
# User Paul Aurich <paul@darkrain42.org>
# Date 1250178919 0
# Node ID e4b0bf56667ffb9761f9a280b675d103755be6c2
# Parent  e30de9ebfa69098178ccb1694b2c472621f7f61a
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).

diff -r e30de9ebfa69 -r e4b0bf56667f ChangeLog
--- 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
diff -r e30de9ebfa69 -r e4b0bf56667f libpurple/protocols/myspace/myspace.c
--- 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
diff -r e30de9ebfa69 -r e4b0bf56667f libpurple/protocols/myspace/myspace.h
--- 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 */