[balsa/wip/gmime3: 126/197] Restore using gmime 3.0 API



commit 531f02abf9c1bdfbcd18f68ab8f1040bb5ee3f46
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Oct 18 19:51:24 2017 -0400

    Restore using gmime 3.0 API

 libbalsa/send.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/libbalsa/send.c b/libbalsa/send.c
index 7a86076..f272611 100644
--- a/libbalsa/send.c
+++ b/libbalsa/send.c
@@ -1182,22 +1182,6 @@ parse_content_type(const char *content_type)
     return ret;
 }
 
-/* get_tz_offset() returns tz offset in RFC 5322 format ([-]hhmm) */
-static gint
-get_tz_offset(time_t t)
-{
-       GTimeZone *local_tz;
-       gint interval;
-       gint32 offset;
-       gint hours;
-
-       local_tz = g_time_zone_new_local();
-       interval = g_time_zone_find_interval(local_tz, G_TIME_TYPE_UNIVERSAL, t);
-       offset = g_time_zone_get_offset(local_tz, interval);
-       g_time_zone_unref(local_tz);
-       hours = offset / 3600;
-       return (hours * 100) + ((offset - (hours * 3600)) / 60);
-}
 
 static LibBalsaMsgCreateResult
 libbalsa_message_create_mime_message(LibBalsaMessage *message,
@@ -1464,8 +1448,10 @@ libbalsa_message_create_mime_message(LibBalsaMessage *message,
     {
         GDateTime *datetime;
 
-    g_mime_message_set_date(mime_message, message->headers->date,
-                            get_tz_offset(message->headers->date));
+        datetime = g_date_time_new_from_unix_local(message->headers->date);
+        g_mime_message_set_date(mime_message, datetime);
+        g_date_time_unref(datetime);
+    }
 
     if ((ia_list = message->headers->to_list)) {
         InternetAddressList *recipients =


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