diff libpurple/protocols/msn/user.c @ 20447:18ecdee88ed0

Add Pending list to recognized lists during contact list parsing Don't try pushing Reverse or Pending lists to notification server Improvements to detecting Yahoo users so Passports with @yahoo.com addresses will work better. Fixes #1331
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 28 May 2007 16:12:25 +0000
parents 203b45c4c8a0
children eb93710aec4d
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c	Mon May 28 02:20:41 2007 +0000
+++ b/libpurple/protocols/msn/user.c	Mon May 28 16:12:25 2007 +0000
@@ -340,13 +340,25 @@
 	return PURPLE_BUDDY_IS_ONLINE(buddy);
 }
 
-/*check to see if user is yahoo user?
- * TODO: we need to identify it via contact  parse
- */
 gboolean
 msn_user_is_yahoo(PurpleAccount *account, const char *name)
 {
-	return (strstr(name,"yahoo") != NULL);
+	MsnSession *session = NULL;
+	MsnUser *user;
+	PurpleConnection *gc;
+
+	gc = purple_account_get_connection(account);
+	if (gc != NULL)
+		session = gc->proto_data;
+
+	if ((session != NULL) && (session->protocol_ver == WLM_PROT_VER))
+		return FALSE;
+
+	if ((session != NULL) && (user = msn_userlist_find_user(session->userlist, name)) != NULL)
+	{
+		return (user->type == MSN_USER_TYPE_YAHOO);
+	}
+	return (strstr(name,"@yahoo.") != NULL);
 }
 
 void