aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-06 04:13:59 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-06 04:13:59 +0800
commit7301749d713555c513029cab6c957c7ce4f63306 (patch)
tree8696f254e19e2193fe74f91d7f3976db90776364 /mail/mail-config.c
parent5df96e40dc8ec64173e7a008d50bd08a731a3f04 (diff)
downloadgsoc2013-evolution-7301749d713555c513029cab6c957c7ce4f63306.tar.gz
gsoc2013-evolution-7301749d713555c513029cab6c957c7ce4f63306.tar.zst
gsoc2013-evolution-7301749d713555c513029cab6c957c7ce4f63306.zip
Updated to not connect when getting a list of authtypes. (transport_next):
2001-02-05 Jeffrey Stedfast <fejj@ximian.com> * mail-config-druid.c (incoming_next): Updated to not connect when getting a list of authtypes. (transport_next): No longer connects - again, this is useless. Read the apply_changes argument for the reason why. * mail-account-editor.c (apply_changes): Updated. Set the 'connect' argument to FALSE for now, this basically means that the call is worthless tho so it may be best to either get rid of the checks altogether or else make it connect. (source_auth_init): Don't connect here, it's just plain annoying. (transport_construct_authmenu): Same here. * mail-config.c (mail_config_check_service): Now takes a connect argument. svn path=/trunk/; revision=7981
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 269088962f..7eeae83df2 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -788,6 +788,7 @@ mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix)
typedef struct {
char *url;
CamelProviderType type;
+ gboolean connect;
GList **authtypes;
gboolean success;
} check_service_input_t;
@@ -805,17 +806,15 @@ static void
do_check_service (gpointer in_data, gpointer op_data, CamelException *ex)
{
check_service_input_t *input = in_data;
- CamelService *service;
+ CamelService *service = NULL;
if (input->authtypes) {
- service = camel_session_get_service (
- session, input->url, input->type, ex);
+ service = camel_session_get_service (session, input->url, input->type, ex);
if (!service)
return;
- *input->authtypes = camel_service_query_auth_types (service, ex);
- } else {
- service = camel_session_get_service_connected (
- session, input->url, input->type, ex);
+ *input->authtypes = camel_service_query_auth_types (service, input->connect, ex);
+ } else if (input->connect) {
+ service = camel_session_get_service_connected (session, input->url, input->type, ex);
}
if (service)
camel_object_unref (CAMEL_OBJECT (service));
@@ -831,13 +830,32 @@ static const mail_operation_spec op_check_service = {
NULL
};
+
+/**
+ * mail_config_check_service:
+ * @url: service url
+ * @type: provider type
+ * @connect: whether or not the check service should connect
+ * @authtypes: list of auth types gathered by this method
+ *
+ * Checks the service for validity. If @connect is TRUE then a
+ * connection with the server is attempted and if successful will fill
+ * in the @authtypes list. If @connect is FALSE then @authtypes will
+ * be generated without a connection and thus will not necessarily
+ * reflect what the server supports.
+ *
+ * Returns TRUE on success or FALSE on error.
+ *
+ **/
+
gboolean
-mail_config_check_service (CamelURL *url, CamelProviderType type, GList **authtypes)
+mail_config_check_service (CamelURL *url, CamelProviderType type, gboolean connect, GList **authtypes)
{
check_service_input_t input;
input.url = camel_url_to_string (url, TRUE);
input.type = type;
+ input.connect = connect;
input.authtypes = authtypes;
input.success = FALSE;