From: Andrea Zagli Date: Thu, 1 Oct 2015 09:32:14 +0000 (+0200) Subject: Adjustments for new evolution-data-server (3.18). X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=07cbf73365620280ae4ab04c63ae62692872b9b2;p=solipa%2Flibsolipa Adjustments for new evolution-data-server (3.18). --- diff --git a/configure.ac b/configure.ac index aaa7771..1229c90 100644 --- a/configure.ac +++ b/configure.ac @@ -38,23 +38,33 @@ PKG_CHECK_MODULES(SOLIPA, [libgdaex >= 0.5.0 AC_SUBST(SOLIPA_CFLAGS) AC_SUBST(SOLIPA_LIBS) -PKG_CHECK_MODULES(CAMEL, camel-1.2 >= 3.8, [camel38_found=yes], [camel38_found=no]) - camel3_found=no -if test x$camel38_found = xno; then - PKG_CHECK_MODULES(CAMEL, camel-provider-1.2 >= 3, [camel3_found=yes], [camel3_found=no]) - - if test x$camel3_found = xno; then - PKG_CHECK_MODULES(CAMEL, camel-provider-1.2 >= 2.32) - fi - CAMEL_PKGCONFIG="camel-provider-1.2" -else - CAMEL_PKGCONFIG="camel-1.2" +camel38_found=no +camel318_found=no + +PKG_CHECK_MODULES(CAMEL, camel-1.2 >= 3.18, [camel318_found=yes], [camel318_found=no]) + +if test x$camel318_found = xno; then + PKG_CHECK_MODULES(CAMEL, camel-1.2 >= 3.8, [camel38_found=yes], [camel38_found=no]) + + if test x$camel38_found = xno; then + PKG_CHECK_MODULES(CAMEL, camel-provider-1.2 >= 3, [camel3_found=yes], [camel3_found=no]) + + if test x$camel3_found = xno; then + PKG_CHECK_MODULES(CAMEL, camel-provider-1.2 >= 2.32) + fi + + CAMEL_PKGCONFIG="camel-provider-1.2" + else + CAMEL_PKGCONFIG="camel-1.2" + fi fi AC_SUBST(CAMEL_CFLAGS) AC_SUBST(CAMEL_LIBS) +AC_SUBST(CAMEL318_FOUND) +AM_CONDITIONAL(HAVE_CAMEL318, test $camel318_found = yes) AC_SUBST(CAMEL38_FOUND) AM_CONDITIONAL(HAVE_CAMEL38, test $camel38_found = yes) AC_SUBST(CAMEL3_FOUND) diff --git a/src/Makefile.am b/src/Makefile.am index 6421d3f..b6c5c93 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,14 +11,18 @@ LIBS = $(SOLIPA_LIBS) \ $(CAMEL_LIBS) \ $(WIN32_LIBS) -if HAVE_CAMEL38 -CAMEL3=-DCAMEL3=\"yes\" -DCAMEL38=\"yes\" +if HAVE_CAMEL318 + CAMEL3=-DCAMEL3=\"yes\" -DCAMEL318=\"yes\" else -if HAVE_CAMEL3 -CAMEL3=-DCAMEL3=\"yes\" -else -CAMEL3= -endif + if HAVE_CAMEL38 + CAMEL3=-DCAMEL3=\"yes\" -DCAMEL38=\"yes\" + else + if HAVE_CAMEL3 + CAMEL3=-DCAMEL3=\"yes\" + else + CAMEL3= + endif + endif endif AM_CPPFLAGS = $(SOLIPA_CFLAGS) \ diff --git a/src/mail.c b/src/mail.c index e298367..72f56c0 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 Andrea Zagli + * Copyright (C) 2010-2015 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -543,7 +543,7 @@ solipa_mail_set_security_method (SolipaMail *mail, CamelNetworkSecurityMethod me priv->security_method = method; } -void +void solipa_mail_set_username_password (SolipaMail *mail, const gchar *username, const gchar *password) { SolipaMailPrivate *priv; @@ -713,7 +713,9 @@ solipa_mail_send (SolipaMail *mail, const gchar *url) } error = NULL; -#ifdef CAMEL38 +#ifdef CAMEL318 + ret = camel_service_connect_sync (trans, NULL, &error); +#elif defined CAMEL38 ret = camel_service_connect_sync (trans, NULL, &error); #elif defined CAMEL3 ret = camel_service_connect_sync (trans, &error); @@ -757,12 +759,25 @@ solipa_mail_send (SolipaMail *mail, const gchar *url) } #ifdef CAMEL3 +#ifdef CAMEL318 + gboolean out_sent_message_saved; + + out_sent_message_saved = FALSE; + ret = camel_transport_send_to_sync (CAMEL_TRANSPORT (trans), + msg, + CAMEL_ADDRESS (camel_mime_message_get_from (msg)), + CAMEL_ADDRESS (to), + &out_sent_message_saved, + NULL, + &error); +#else ret = camel_transport_send_to_sync (CAMEL_TRANSPORT (trans), msg, CAMEL_ADDRESS (camel_mime_message_get_from (msg)), CAMEL_ADDRESS (to), NULL, &error); +#endif #else ret = camel_transport_send_to (CAMEL_TRANSPORT (trans), msg, diff --git a/src/solipa.h b/src/solipa.h index 4692bf8..13122f0 100644 --- a/src/solipa.h +++ b/src/solipa.h @@ -26,6 +26,8 @@ #include +#include + G_BEGIN_DECLS