- valid_account_type = FALSE;
-
- /* you cannot change the protocol type of an existing account;
- * so double check we don't even try
- */
- switch (account_data->proto) {
- case MODEST_PROTOCOL_TRANSPORT_SENDMAIL:
- case MODEST_PROTOCOL_TRANSPORT_SMTP:
- if (!TNY_IS_CAMEL_TRANSPORT_ACCOUNT(tny_account))
- g_warning ("%s: expecting transport account", __FUNCTION__);
- else
- valid_account_type = TRUE;
- break;
- case MODEST_PROTOCOL_STORE_POP:
- if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT(tny_account))
- g_warning ("%s: expecting pop account", __FUNCTION__);
- else
- valid_account_type = TRUE;
- break;
- case MODEST_PROTOCOL_STORE_IMAP:
- if (!TNY_IS_CAMEL_IMAP_STORE_ACCOUNT(tny_account))
- g_warning ("%s: expecting imap account", __FUNCTION__);
- else
- valid_account_type = TRUE;
- break;
- case MODEST_PROTOCOL_STORE_MAILDIR:
- case MODEST_PROTOCOL_STORE_MBOX:
- if (!TNY_IS_CAMEL_STORE_ACCOUNT(tny_account))
- g_warning ("%s: expecting store account", __FUNCTION__);
- else
- valid_account_type = TRUE;
- break;
- default:
- g_warning ("invalid account type");
- }