[pan: 8/21] X-Face: manual folding for length >72.




commit 552d38380ad2ff09cc3af0690b5589efcbf98429
Author: FoxMcCloud45 <foxmccloud45 hotmail com>
Date:   Tue Jul 6 23:52:31 2021 +0200

    X-Face: manual folding for length >72.

 pan/gui/post-ui.cc | 8 +++++++-
 pan/gui/post-ui.h  | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 8769ec5..c983f21 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -1662,7 +1662,13 @@ PostUI :: new_message_from_ui (Mode mode, bool copy_body)
   if (!profile.xface.empty())
   {
     std::string f;
-    f += " " + profile.xface;
+    f += profile.xface;
+
+    // GMIME_FOLD_INTERVAL - 8: Accounting for 'X-Face: ' beginning of header
+    for(int i = GMIME_FOLD_INTERVAL - 8; i < f.length(); i += GMIME_FOLD_INTERVAL)
+    {
+      f.insert(i, " ");
+    }
 #ifdef HAVE_GMIME_30
     g_mime_object_set_header ((GMimeObject *) msg, "X-Face", f.c_str(), NULL);
 #else
diff --git a/pan/gui/post-ui.h b/pan/gui/post-ui.h
index c2af707..320b4ea 100644
--- a/pan/gui/post-ui.h
+++ b/pan/gui/post-ui.h
@@ -177,6 +177,9 @@ namespace pan
       virtual void on_queue_task_moved (UploadQueue&, Task&, int new_index, int old_index);
 
     private:
+      /* GMIME: X-Face interval between spaces for proper folding. */
+      enum { GMIME_FOLD_INTERVAL = 72 };
+
       void add_actions (GtkWidget* box);
       void apply_profile_to_body ();
       void apply_profile_to_headers ();


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