cpw.qulogic.msnp16: ea447a3b: Support sending different client types i...

qulogic at pidgin.im qulogic at pidgin.im
Tue Dec 15 04:02:16 EST 2009


-----------------------------------------------------------------
Revision: ea447a3b0bf88e871a71c1a9e011267d0d657ba5
Ancestor: 0d4d5bc02772b75cb871fb3fd91502023d9178e2
Author: qulogic at pidgin.im
Date: 2009-12-15T04:32:49
Branch: im.pidgin.cpw.qulogic.msnp16
URL: http://d.pidgin.im/viewmtn/revision/info/ea447a3b0bf88e871a71c1a9e011267d0d657ba5

Modified files:
        libpurple/protocols/msn/notification.c

ChangeLog: 

Support sending different client types in PrivateEndpointData.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	8e634c42d520fddbada5099aac1b6734a07dae20
+++ libpurple/protocols/msn/notification.c	b52231e2b5d104e7863c831c5e4101044cbf6613
@@ -22,6 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include "msn.h"
+#include "core.h"
 #include "notification.h"
 #include "contact.h"
 #include "state.h"
@@ -1847,6 +1848,8 @@ void msn_notification_send_uux_private_e
 	const char *name;
 	xmlnode *epname;
 	xmlnode *idle;
+	GHashTable *ui_info;
+	const gchar *ui_type;
 	xmlnode *client_type;
 	xmlnode *state;
 	char *payload;
@@ -1861,7 +1864,6 @@ void msn_notification_send_uux_private_e
 	idle = xmlnode_new_child(private, "Idle");
 	xmlnode_insert_data(idle, "false", -1);
 
-	/* TODO: support different client types */
 	/* ClientType info (from amsn guys):
 		0: None
 		1: Computer
@@ -1872,7 +1874,22 @@ void msn_notification_send_uux_private_e
 		32: Email member, currently Yahoo!
 	*/
 	client_type = xmlnode_new_child(private, "ClientType");
-	xmlnode_insert_data(client_type, "1", -1);
+	ui_info = purple_core_get_ui_info();
+	ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL;
+	if (ui_type) {
+		if (strcmp(ui_type, "pc") == 0)
+			xmlnode_insert_data(client_type, "1", -1);
+		else if (strcmp(ui_type, "web") == 0)
+			xmlnode_insert_data(client_type, "2", -1);
+		else if (strcmp(ui_type, "phone") == 0)
+			xmlnode_insert_data(client_type, "3", -1);
+		else if (strcmp(ui_type, "handheld") == 0)
+			xmlnode_insert_data(client_type, "3", -1);
+		else
+			xmlnode_insert_data(client_type, "1", -1);
+	}
+	else
+		xmlnode_insert_data(client_type, "1", -1);
 
 	state = xmlnode_new_child(private, "State");
 	xmlnode_insert_data(state, msn_state_get_text(msn_state_from_account(session->account)), -1);


More information about the Commits mailing list