pidgin: b8b574c4: Add a function for parsing a network:use...

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:34 EST 2012


----------------------------------------------------------------------
Revision: b8b574c4d6f6c05105b372191ca5259b4ae0ad41
Parent:   c209610aea6c76c779b42150d1a3b2c677da33ec
Author:   qulogic at pidgin.im
Date:     02/02/12 20:14:41
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b8b574c4d6f6c05105b372191ca5259b4ae0ad41

Changelog: 

Add a function for parsing a network:username for MSNP18.

Changes against parent c209610aea6c76c779b42150d1a3b2c677da33ec

  patched  libpurple/protocols/msn/msnutils.c
  patched  libpurple/protocols/msn/msnutils.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msnutils.c	d930db8b663626b67201f669623431b6756f0c42
+++ libpurple/protocols/msn/msnutils.c	a50eee65336eb7bf849196ac32f9c892099e18f5
@@ -490,6 +490,21 @@ msn_parse_socket(const char *str, char *
 	*ret_port = port;
 }
 
+void
+msn_parse_user(const char *str, char **ret_user, int *ret_network)
+{
+	char **tokens;
+
+	tokens = g_strsplit(str, ":", 2);
+
+	*ret_network = atoi(tokens[0]);
+	*ret_user = tokens[1];
+
+	g_free(tokens[0]);
+	/* tokens[1] is returned */
+	g_free(tokens);
+}
+
 gboolean
 msn_email_is_valid(const char *passport)
 {
============================================================
--- libpurple/protocols/msn/msnutils.h	9722d3b7268666bc496e626d06cf10faa29f1548
+++ libpurple/protocols/msn/msnutils.h	eaf4392070d1bc1d9f759c6f64cc43da9a21374c
@@ -76,6 +76,15 @@ void msn_parse_socket(const char *str, c
 void msn_parse_socket(const char *str, char **ret_host, int *ret_port);
 
 /**
+ * Parses a user name
+ *
+ * @param str         A network:username string.
+ * @param ret_user    Return of the user's passport.
+ * @param ret_network Return of the user's network.
+ */
+void msn_parse_user(const char *str, char **ret_user, int *ret_network);
+
+/**
  * Verify if the email is a vaild passport.
  *
  * @param passport 	The email


More information about the Commits mailing list