]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
SolipaMail: aggiustamento di ::get_as_string per camel >= 3.8.
authorAndrea Zagli <azagli@libero.it>
Sun, 12 Oct 2014 09:14:09 +0000 (11:14 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 12 Oct 2014 09:14:09 +0000 (11:14 +0200)
src/mail.c

index d409e7c1c100b1f70b4272e591ca92e66533801b..1d8e787c83823f51bb2e1d00f10542f34a38c610 100644 (file)
@@ -470,8 +470,15 @@ solipa_mail_get_as_string (SolipaMail *mail)
                        return NULL;
                }
 
-#ifndef CAMEL3
+#ifdef CAMEL3
        error = NULL;
+       if (!g_seekable_seek (G_SEEKABLE (mem), 0, G_SEEK_SET, NULL, &error))
+               {
+                       g_warning ("Unable to reset the camel mem stream: %s.",
+                                  error != NULL && error->message != NULL ? error->message : "no details");
+                       return NULL;
+               }
+#else
        if (camel_stream_reset (mem, &error) < 0)
                {
                        g_warning ("Unable to reset the camel mem stream: %s.",