comparison 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
comparison
equal deleted inserted replaced
23521:9fdf0accd4aa 23522:fd124c21ebb7
392 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), 392 _("Disallow"), G_CALLBACK(disable_msn_pages_cb),
393 _("Cancel"), NULL); 393 _("Cancel"), NULL);
394 } 394 }
395 395
396 static void 396 static void
397 msn_show_blocked_text(PurplePluginAction *action)
398 {
399 PurpleConnection *pc = (PurpleConnection *) action->context;
400 MsnSession *session;
401 char *title;
402
403 session = pc->proto_data;
404
405 title = g_strdup_printf(_("Blocked Text for %s"), session->account->username);
406 if (session->blocked_text == NULL) {
407 purple_notify_formatted(pc, title, title, NULL, _("No text is blocked for this account."), NULL, NULL);
408 } else {
409 char *blocked_text;
410 blocked_text = g_strdup_printf(_("MSN servers are currently blocking the following regular expressions:<br/>%s"),
411 session->blocked_text);
412
413 purple_notify_formatted(pc, title, title, NULL, blocked_text, NULL, NULL);
414 g_free(blocked_text);
415 }
416 g_free(title);
417 }
418
419 static void
397 msn_show_hotmail_inbox(PurplePluginAction *action) 420 msn_show_hotmail_inbox(PurplePluginAction *action)
398 { 421 {
399 PurpleConnection *gc; 422 PurpleConnection *gc;
400 MsnSession *session; 423 MsnSession *session;
401 424
805 m = g_list_append(m, act); 828 m = g_list_append(m, act);
806 #endif 829 #endif
807 830
808 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."), 831 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."),
809 msn_show_set_mobile_pages); 832 msn_show_set_mobile_pages);
833 m = g_list_append(m, act);
834
835 m = g_list_append(m, NULL);
836 act = purple_plugin_action_new(_("View Blocked Text..."),
837 msn_show_blocked_text);
810 m = g_list_append(m, act); 838 m = g_list_append(m, act);
811 839
812 account = purple_connection_get_account(gc); 840 account = purple_connection_get_account(gc);
813 user = msn_normalize(account, purple_account_get_username(account)); 841 user = msn_normalize(account, purple_account_get_username(account));
814 842