pidgin: 04cdcf9e: Disable sending files to MSN contacts us...

qulogic at pidgin.im qulogic at pidgin.im
Tue Jul 29 03:10:54 EDT 2008


-----------------------------------------------------------------
Revision: 04cdcf9ef209764a0842972992a102d1942b76c9
Ancestor: bd8c029cb2bab77ad4fc6e904e21bbcc9e698fd2
Author: qulogic at pidgin.im
Date: 2008-07-24T04:15:13
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/04cdcf9ef209764a0842972992a102d1942b76c9

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

ChangeLog: 

Disable sending files to MSN contacts using the web messenger. Not sure 
whether Mobile/Direct should be disabled, too?

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	44fe68f25cfd61d2a76b1291fc600fce77d851f8
+++ libpurple/protocols/msn/msn.c	9a1d7ecb83bd71c9a6dfad3fba07cf1d9d7d7d91
@@ -582,15 +582,22 @@ msn_can_receive_file(PurpleConnection *g
 {
 	PurpleAccount *account;
 	char *normal;
+	MsnSession *session;
+	MsnUser *user;
 	gboolean ret;
 
 	account = purple_connection_get_account(gc);
 
 	normal = g_strdup(msn_normalize(account, purple_account_get_username(account)));
-
 	ret = strcmp(normal, msn_normalize(account, who));
+	g_free(normal);
 
-	g_free(normal);
+	if (ret) {
+		session = gc->proto_data;
+		user = msn_userlist_find_user(session->userlist, who);
+		ret = (user->clientid & MSN_CLIENT_CAP_WEBMSGR) == 0;
+		/* Include these too: MSN_CLIENT_CAP_MSNMOBILE|MSN_CLIENT_CAP_MSNDIRECT ? */
+	}
 
 	return ret;
 }


More information about the Commits mailing list