]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
Adjustments for new evolution-data-server (3.18).
authorAndrea Zagli <andrea.zagli@email.it>
Thu, 1 Oct 2015 09:32:14 +0000 (11:32 +0200)
committerAndrea Zagli <andrea.zagli@email.it>
Thu, 1 Oct 2015 09:32:14 +0000 (11:32 +0200)
configure.ac
src/Makefile.am
src/mail.c
src/solipa.h

index aaa777136dca10895b5caec355d66a4314e01569..1229c90a806917718995f5f9afb8b97ea3e23170 100644 (file)
@@ -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)
index 6421d3fe3db8f3bd1c3558005488a7af6cfe8315..b6c5c93106ec00a6a72fee9e57687332bbbbbed4 100644 (file)
@@ -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) \
index e298367b7fd802045289d5d8f5e480ef8ec3cc89..72f56c0f9266701ed350421493074c804f9cb7d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2014 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2015 Andrea Zagli <azagli@libero.it>
  *
  * 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,
index 4692bf812b0a896e9740d9fafa15d840cdfe7abc..13122f016849506d1e929cbe994b61b036e4037c 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <camel/camel.h>
 
+#include <libgdaex/gdaex.h>
+
 
 G_BEGIN_DECLS