soc.2010.msn-tlc: 614f7d5b: msn_email_is_valid looks a lot like a ut...
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Fri May 28 18:25:50 EDT 2010
-----------------------------------------------------------------
Revision: 614f7d5b402756cc5bf78d365e9755141a1ddd64
Ancestor: 206ba5c689d9b404a1a2f68b174a8058f90a2cd3
Author: masca at cpw.pidgin.im
Date: 2010-05-28T08:28:37
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/614f7d5b402756cc5bf78d365e9755141a1ddd64
Modified files:
libpurple/protocols/msn/contact.c
libpurple/protocols/msn/msn.c libpurple/protocols/msn/msn.h
libpurple/protocols/msn/msnutils.c
libpurple/protocols/msn/msnutils.h
libpurple/protocols/msn/userlist.c
ChangeLog:
msn_email_is_valid looks a lot like a util function, move it there.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c f4b50f718e065ddad4673fc47f041159007692b9
+++ libpurple/protocols/msn/contact.c 405d0b9781013f20a187c591f6351415a84363ad
@@ -29,6 +29,7 @@
#include "contact.h"
#include "xmlnode.h"
#include "group.h"
+#include "msnutils.h"
#include "soap.h"
#include "nexus.h"
#include "user.h"
============================================================
--- libpurple/protocols/msn/msn.c b64a4f39e8a3a9b57dd12c67f3e5e735a6761f58
+++ libpurple/protocols/msn/msn.c 20d640985cd81995df5c38560ca5601d432104bf
@@ -117,29 +117,6 @@ msn_normalize(const PurpleAccount *accou
return buf;
}
-gboolean
-msn_email_is_valid(const char *passport)
-{
- if (purple_email_is_valid(passport)) {
- /* Special characters aren't allowed in domains, so only go to '@' */
- while (*passport != '@') {
- if (*passport == '/')
- return FALSE;
- else if (*passport == '?')
- return FALSE;
- else if (*passport == '=')
- return FALSE;
- /* MSN also doesn't like colons, but that's checked already */
-
- passport++;
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
static gboolean
msn_send_attention(PurpleConnection *gc, const char *username, guint type)
{
============================================================
--- libpurple/protocols/msn/msn.h 1aaae8c14556838e8c62a3341bcab2918c43e3d9
+++ libpurple/protocols/msn/msn.h 9aad36d778d95170d01d320cf059821637b18ebb
@@ -117,7 +117,6 @@ typedef enum
((MSN_CLIENT_ID_VERSION << 24) | \
(MSN_CLIENT_ID_CAPABILITIES))
-gboolean msn_email_is_valid(const char *passport);
void
msn_set_public_alias(PurpleConnection *gc, const char *alias,
PurpleSetPublicAliasSuccessCallback success_cb,
============================================================
--- libpurple/protocols/msn/msnutils.c aabefe3802bf3544b00fecfb508d1b891c27c201
+++ libpurple/protocols/msn/msnutils.c a9cf9a6180a71f2e32aef3ce9db8375f4b1df9ac
@@ -474,6 +474,29 @@ msn_parse_socket(const char *str, char *
*ret_port = port;
}
+gboolean
+msn_email_is_valid(const char *passport)
+{
+ if (purple_email_is_valid(passport)) {
+ /* Special characters aren't allowed in domains, so only go to '@' */
+ while (*passport != '@') {
+ if (*passport == '/')
+ return FALSE;
+ else if (*passport == '?')
+ return FALSE;
+ else if (*passport == '=')
+ return FALSE;
+ /* MSN also doesn't like colons, but that's checked already */
+
+ passport++;
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/***************************************************************************
* MSN Challenge Computing Function
***************************************************************************/
============================================================
--- libpurple/protocols/msn/msnutils.h 640fd129b3232cc5ffcff1aa2ee7a6a742b09f67
+++ libpurple/protocols/msn/msnutils.h 232933b74215d8024d248ceaf0ec3545ef33f0c7
@@ -64,6 +64,15 @@ void msn_parse_socket(const char *str, c
void msn_parse_socket(const char *str, char **ret_host, int *ret_port);
/**
+ * Verify if the email is a vaild passport.
+ *
+ * @param passport The email
+ *
+ * @return True if it is a valid passport, else FALSE
+ */
+gboolean msn_email_is_valid(const char *passport);
+
+/**
* Handle MSN Challenge Computation
* This algorithm references
* http://imfreedom.org/wiki/index.php/MSN:NS/Challenges
============================================================
--- libpurple/protocols/msn/userlist.c 00bafeb66099795f6118535df8b4df6308d6e606
+++ libpurple/protocols/msn/userlist.c 4cf75f424f859e5f132de2038f6c06ee19b1a445
@@ -26,6 +26,7 @@
#include "request.h"
#include "msn.h"
+#include "msnutils.h"
#include "userlist.h"
#include "contact.h"
More information about the Commits
mailing list