pidgin: 337eed6a: Use "EmailEnabled" from the MSN profile ...

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


-----------------------------------------------------------------
Revision: 337eed6a3abf681c14acf327e6f8f5cc088cbd4b
Ancestor: 67cd01cdc3deb39a0926d5972ccb8a60681857d2
Author: qulogic at pidgin.im
Date: 2008-07-28T05:10:48
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/337eed6a3abf681c14acf327e6f8f5cc088cbd4b

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

ChangeLog: 

Use "EmailEnabled" from the MSN profile message to determine whether 
the email inbox can be opened.

References #5762.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	43f4c25133b900be6226dcd03ea61dc8dfbc73a9
+++ libpurple/protocols/msn/msn.c	99e56dce8cb2b491566c20b85eb8a555e29be921
@@ -428,6 +428,12 @@ msn_show_hotmail_inbox(PurplePluginActio
 	gc = (PurpleConnection *) action->context;
 	session = gc->proto_data;
 
+	if (!session->passport_info.email_enabled) {
+		purple_notify_error(gc, NULL,
+						  _("This account does not have email enabled."), NULL);
+		return;
+	}
+
 	/** apparently the correct value is 777, use 750 as a failsafe */ 
 	if (time (NULL) - session->passport_info.mail_timestamp >= 750) {
 		MsnTransaction *trans;
@@ -436,16 +442,12 @@ msn_show_hotmail_inbox(PurplePluginActio
 		cmdproc = session->notification->cmdproc;
 
 		trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
-		msn_transaction_set_data(trans, GUINT_TO_POINTER (TRUE));
+		msn_transaction_set_data(trans, GUINT_TO_POINTER(TRUE));
 
 		msn_cmdproc_send_trans(cmdproc, trans);
 
 	} else if (session->passport_info.file != NULL) {
 		purple_notify_uri(gc, session->passport_info.file);
-
-	} else {
-		purple_notify_error(gc, NULL,
-						  _("This Hotmail account may not be active."), NULL);
 	}
 }
 
============================================================
--- libpurple/protocols/msn/notification.c	bf9939fd7dddaf329b05adf6694b46dbf507d449
+++ libpurple/protocols/msn/notification.c	6eec2269e47806d8ed8f38c52787ff8268ac75cd
@@ -1666,6 +1666,9 @@ profile_msg(MsnCmdProc *cmdproc, MsnMess
 	if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL)
 		session->passport_info.sl = atol(value);
 
+	if ((value = msn_message_get_attr(msg, "EmailEnabled")) != NULL)
+		session->passport_info.email_enabled = (gboolean)atol(value);
+
 	/*starting retrieve the contact list*/
 	clLastChange = purple_account_get_string(session->account, "CLLastChange", NULL);
 #ifdef MSN_PARTIAL_LISTS
============================================================
--- libpurple/protocols/msn/session.h	b91539c11dcd3cdfd50f5d7caa3fd7bf5687884f
+++ libpurple/protocols/msn/session.h	21c879b9bd5cf7afcad6b1d18b2bc23a10334bb2
@@ -119,6 +119,7 @@ struct _MsnSession
 		char *client_ip;
 		int client_port;
 		gulong mail_timestamp;
+		gboolean email_enabled;
 	} passport_info;
 
 	GHashTable *soap_table;


More information about the Commits mailing list