diff libpurple/protocols/msn/msn.c @ 23522:fd124c21ebb7

Properly parse (most of) the MSN GCF command. Provides a <Account>->"View Blocked Text" dialog showing the regular expressions that the MSN servers are currently blocking. For the people who were wondering why their messages were never received.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 15 Jun 2008 06:55:21 +0000
parents 70de4e2246ec
children ad565744246e
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sun Jun 15 06:22:25 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Jun 15 06:55:21 2008 +0000
@@ -394,6 +394,29 @@
 }
 
 static void
+msn_show_blocked_text(PurplePluginAction *action)
+{
+	PurpleConnection *pc = (PurpleConnection *) action->context;
+	MsnSession *session;
+	char *title;
+
+	session = pc->proto_data;
+
+	title = g_strdup_printf(_("Blocked Text for %s"), session->account->username);
+	if (session->blocked_text == NULL) {
+		purple_notify_formatted(pc, title, title, NULL, _("No text is blocked for this account."), NULL, NULL);
+	} else {
+		char *blocked_text;
+		blocked_text = g_strdup_printf(_("MSN servers are currently blocking the following regular expressions:<br/>%s"),
+		                               session->blocked_text);
+		
+		purple_notify_formatted(pc, title, title, NULL, blocked_text, NULL, NULL);
+		g_free(blocked_text);
+	}
+	g_free(title);
+}
+
+static void
 msn_show_hotmail_inbox(PurplePluginAction *action)
 {
 	PurpleConnection *gc;
@@ -809,6 +832,11 @@
 			msn_show_set_mobile_pages);
 	m = g_list_append(m, act);
 
+	m = g_list_append(m, NULL);
+	act = purple_plugin_action_new(_("View Blocked Text..."),
+			msn_show_blocked_text);
+	m = g_list_append(m, act);
+
 	account = purple_connection_get_account(gc);
 	user = msn_normalize(account, purple_account_get_username(account));