- else
- {
- if (err) {
- if (info->error) {
- g_error_free (info->error);
- info->error = NULL;
- }
-
- info->error = g_error_copy (err);
- }
-
- if (!auth_types) {
- g_warning ("DEBUG: %s: auth_types is NULL.\n", __FUNCTION__);
- }
- else if (tny_list_get_length(auth_types) == 0)
- g_warning ("DEBUG: %s: auth_types is an empty TnyList.\n", __FUNCTION__);
- else {
- ModestPairList *pairs;
- GList *result;
- ModestProtocolRegistry *protocol_registry;
-
- protocol_registry = modest_runtime_get_protocol_registry ();
- pairs = modest_protocol_registry_get_pair_list_by_tag (protocol_registry, MODEST_PROTOCOL_REGISTRY_AUTH_PROTOCOLS);
-
- /* Get the enum value for the strings: */
- result = NULL;
- TnyIterator* iter = tny_list_create_iterator(auth_types);
- while (!tny_iterator_is_done(iter)) {
- TnyPair *pair;
- const gchar *auth_name;
- ModestProtocolType protocol_type;
-
- pair = TNY_PAIR(tny_iterator_get_current(iter));
- auth_name = NULL;
- if (pair) {
- auth_name = tny_pair_get_name(pair);
- g_object_unref (pair);
- pair = NULL;
- }