+
+static gboolean
+_invalid_attachment_for_purge (ModestWindow *win, ModestDimmingRule *rule)
+{
+ gboolean result = FALSE;
+
+ if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
+ TnyMsg *msg;
+ TnyFolder *folder;
+ TnyAccount *account;
+
+ msg = modest_msg_view_window_get_message (MODEST_MSG_VIEW_WINDOW (win));
+ folder = tny_msg_get_folder (msg);
+ g_object_unref (msg);
+ account = modest_tny_folder_get_account (folder);
+ g_object_unref (folder);
+ if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (account))) {
+ } else {
+ const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (account));
+ /* If it's POP then dim */
+ if (modest_protocol_info_get_transport_store_protocol (proto_str) ==
+ MODEST_PROTOCOL_STORE_POP) {
+ GList *attachments;
+ gint n_selected;
+ result = TRUE;
+ attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
+ n_selected = g_list_length (attachments);
+ g_list_free (attachments);
+
+ modest_dimming_rule_set_notification (
+ rule,
+ ngettext ("mail_ib_unable_to_pure_attach_pop_mail_singular",
+ "mail_ib_unable_to_pure_attach_pop_mail_plural", n_selected));
+ }
+ }
+ }
+
+ return result;
+}
+