checking supported authentication types



Hi Tinymail developers,

When querying the server for supported authentication types, tinymail
does not make sure that the camel service object is set up correctly.
The attached patch makes this work by calling the prepare_vfunc just
before calling the camel function that queries the server. I am not sure
this is the right place do to it, but it seems to work.

With the attached patch, the warning mentioned in projects.maemo.org bug
#61369 disappears and the server returns the correct methods (which are
logged to the console). The GUI still claims that the operation failed,
though that is probably another problem, unrelated from this.

So is that call OK, should it be moved elsewhere or should the problem
even be solved in another way?

Thanks,
Armin
Index: libtinymail-camel/tny-camel-account.c
===================================================================
--- libtinymail-camel/tny-camel-account.c	(revision 2653)
+++ libtinymail-camel/tny-camel-account.c	(working copy)
@@ -1779,6 +1779,9 @@
 		TNY_GET_SUPPORTED_SECURE_AUTH_STATUS_GET_SECURE_AUTH, 0, 1,
 		"Get secure authentication methods");
 
+	/* Prepare, so service is set for query_auth_types */
+	TNY_CAMEL_ACCOUNT_GET_CLASS(self)->prepare_func(self, FALSE, TRUE);
+
 	authtypes = camel_service_query_auth_types (priv->service, &ex);
 	/* Result reference */
 	result = tny_simple_list_new ();
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2653)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-08-29  Armin Burgmeier  <armin openismus com>
+
+	* libtinymail-camel/tny-camel-account.c
+	(tny_camel_account_get_supported_secure_authentication_async_thread):
+	Call the prepare_func vfunc before asking camel to ask the server for
+	auth types so priv->service is set.
+
 2007-08-29 Dirk-Jan C. Binnema <dirk-jan binnema nokia com>
 
 	* Set the correct X-Priority: header values, and parse the correct


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]