diff options
Diffstat (limited to 'source/xap')
-rw-r--r-- | source/xap/pan/0d775547f0e7cf7529538704814469e1db5496f2.patch | 25 | ||||
-rw-r--r-- | source/xap/pan/495bfb2eb9228b5b5cef8b50e11af577e4b473f8.patch | 280 | ||||
-rwxr-xr-x | source/xap/pan/pan.SlackBuild | 6 |
3 files changed, 309 insertions, 2 deletions
diff --git a/source/xap/pan/0d775547f0e7cf7529538704814469e1db5496f2.patch b/source/xap/pan/0d775547f0e7cf7529538704814469e1db5496f2.patch new file mode 100644 index 00000000..80dc0487 --- /dev/null +++ b/source/xap/pan/0d775547f0e7cf7529538704814469e1db5496f2.patch @@ -0,0 +1,25 @@ +From 0d775547f0e7cf7529538704814469e1db5496f2 Mon Sep 17 00:00:00 2001 +From: Detlef Graef <detlef.graef@yahoo.de> +Date: Sun, 5 Jul 2020 08:54:35 +0200 +Subject: [PATCH] Remove empty line from file posting.xml + +--- + pan/data-impl/profiles.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pan/data-impl/profiles.cc b/pan/data-impl/profiles.cc +index e999fda..4053cae 100644 +--- a/pan/data-impl/profiles.cc ++++ b/pan/data-impl/profiles.cc +@@ -240,7 +240,7 @@ ProfilesImpl :: serialize (std::ostream& out) const + } + out << indent(--depth) << "</profile>\n"; + } +- out << indent(--depth) << "</profiles>\n\n"; ++ out << indent(--depth) << "</profiles>\n"; + out << indent(--depth) << "</posting>\n"; + } + +-- +GitLab + diff --git a/source/xap/pan/495bfb2eb9228b5b5cef8b50e11af577e4b473f8.patch b/source/xap/pan/495bfb2eb9228b5b5cef8b50e11af577e4b473f8.patch new file mode 100644 index 00000000..6b876d1e --- /dev/null +++ b/source/xap/pan/495bfb2eb9228b5b5cef8b50e11af577e4b473f8.patch @@ -0,0 +1,280 @@ +From 495bfb2eb9228b5b5cef8b50e11af577e4b473f8 Mon Sep 17 00:00:00 2001 +From: Detlef Graef <detlef.graef@yahoo.de> +Date: Sun, 5 Jul 2020 08:47:54 +0200 +Subject: [PATCH] Fix for GMime3 build (Posting error). Issues #103 and #114 + +--- + pan/gui/post-ui.cc | 176 ++++++++++++++++++++++++++++++++------------- + 1 file changed, 126 insertions(+), 50 deletions(-) + +diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc +index 8769ec5..eb21384 100644 +--- a/pan/gui/post-ui.cc ++++ b/pan/gui/post-ui.cc +@@ -1598,86 +1598,178 @@ namespace + GMimeMessage* + PostUI :: new_message_from_ui (Mode mode, bool copy_body) + { ++#ifdef HAVE_GMIME_30 + + GMimeMessage * msg(0); +- msg = g_mime_message_new (false); ++ msg = g_mime_message_new (true); ++ const char * charset_cstr = _charset.c_str(); + + // headers from the ui: From + const Profile profile (get_current_profile ()); + std::string s; + profile.get_from_header (s); +-#ifdef HAVE_GMIME_30 +- g_mime_message_add_mailbox (msg, GMIME_ADDRESS_TYPE_SENDER, NULL, s.c_str()); ++ g_mime_message_add_mailbox (msg, GMIME_ADDRESS_TYPE_FROM, profile.username.c_str(), profile.address.c_str()); ++ ++ // headers from the ui: Subject ++ const char * cpch (gtk_entry_get_text (GTK_ENTRY(_subject_entry))); ++ if (cpch) { ++ g_mime_message_set_subject (msg, cpch, charset_cstr); ++ } ++ ++ // headers from the ui: To ++ const StringView to (gtk_entry_get_text (GTK_ENTRY(_to_entry))); ++ if (!to.empty()) ++ pan_g_mime_message_add_recipients_from_string (msg, GMIME_ADDRESS_TYPE_TO, to.str); ++ ++ // headers from the ui: Newsgroups ++ const StringView groups (gtk_entry_get_text (GTK_ENTRY(_groups_entry))); ++ if (!groups.empty()) ++ g_mime_object_set_header ((GMimeObject *) msg, "Newsgroups", groups.str, charset_cstr); ++ ++ // headers from the ui: Followup-To ++ const StringView followupto (gtk_entry_get_text (GTK_ENTRY(_followupto_entry))); ++ if (!followupto.empty()) ++ g_mime_object_set_header ((GMimeObject *) msg, "Followup-To", followupto.str, charset_cstr); ++ ++ // headers from the ui: Reply-To ++ const StringView replyto (gtk_entry_get_text (GTK_ENTRY(_replyto_entry))); ++ if (!replyto.empty()) ++ g_mime_object_set_header ((GMimeObject *) msg, "Reply-To", replyto.str, charset_cstr); ++ ++ // headers from posting profile(via prefs): X-Face ++ if (!profile.xface.empty()) ++ { ++ std::string f; ++ f += " " + profile.xface; ++ g_mime_object_set_header ((GMimeObject *) msg, "X-Face", f.c_str(), charset_cstr); ++ } ++ ++ // add the 'hidden headers' (references) ++ const gchar * h_key_str; ++ foreach_const (str2str_t, _hidden_headers, it) ++ if ((mode==DRAFTING) || (it->first.find ("X-Draft-")!=0)) ++ { ++ h_key_str = it->first.c_str(); ++ if ( g_ascii_strncasecmp (h_key_str, "Content", 7) ) ++ { ++ g_mime_object_set_header ((GMimeObject *) msg, it->first.c_str(), it->second.c_str(), charset_cstr); ++ } ++ } ++ ++ // build headers from the 'more headers' entry field ++ std::map<std::string,std::string> headers; ++ GtkTextBuffer * buf (_headers_buf); ++ GtkTextIter start, end; ++ gtk_text_buffer_get_bounds (buf, &start, &end); ++ char * pch = gtk_text_buffer_get_text (buf, &start, &end, false); ++ StringView key, val, v(pch); ++ v.trim (); ++ while (v.pop_token (val, '\n') && val.pop_token(key,':')) { ++ key.trim (); ++ val.eat_chars (1); ++ val.trim (); ++ std::string key_str (key.to_string()); ++ if (extra_header_is_editable (key, val)) ++ g_mime_object_set_header ((GMimeObject *) msg, key.to_string().c_str(), ++ val.to_string().c_str(), charset_cstr); ++ } ++ g_free (pch); ++ ++ // User-Agent ++ if ((mode==POSTING || mode == UPLOADING) && _prefs.get_flag (USER_AGENT_PREFS_KEY, true)) ++ g_mime_object_set_header ((GMimeObject *) msg, "User-Agent", get_user_agent(), charset_cstr); ++ ++ // Message-ID for single text-only posts ++ if (mode==DRAFTING || ((mode==POSTING || mode==UPLOADING) && _prefs.get_flag (MESSAGE_ID_PREFS_KEY, false))) { ++ const std::string message_id = generate_message_id(profile); ++ pan_g_mime_message_set_message_id (msg, message_id.c_str()); ++ } ++ ++ // body & charset ++ { ++ std::string body; ++ if (copy_body) body = get_body(); ++ ++ GMimeStream * stream = g_mime_stream_mem_new_with_buffer (body.c_str(), body.size()); ++ ++ const std::string charset ((mode==POSTING && !_charset.empty()) ? _charset : "UTF-8"); ++ if (charset != "UTF-8") { ++ // add a wrapper to convert from UTF-8 to $charset ++ GMimeStream * tmp = g_mime_stream_filter_new (stream); ++ g_object_unref (stream); ++ GMimeFilter * filter = g_mime_filter_charset_new ("UTF-8", charset.c_str()); ++ g_mime_stream_filter_add (GMIME_STREAM_FILTER(tmp), filter); ++ g_object_unref (filter); ++ stream = tmp; ++ } ++ GMimeDataWrapper * content_object = g_mime_data_wrapper_new_with_stream (stream, GMIME_CONTENT_ENCODING_DEFAULT); ++ g_object_unref (stream); ++ GMimePart * part = g_mime_part_new (); ++ g_mime_part_set_content (part, content_object); ++ ++ pch = g_strdup_printf ("text/plain; charset=%s", charset.c_str()); ++ GMimeContentType * type = g_mime_content_type_parse (NULL, pch); ++ g_free (pch); ++ g_mime_object_set_content_type ((GMimeObject *) part, type); // part owns type now. type isn't refcounted. ++ ++ if (mode != UPLOADING) g_mime_part_set_content_encoding (part, _enc); ++ ++ g_object_unref (content_object); ++ g_mime_message_set_mime_part (msg, GMIME_OBJECT(part)); ++ g_object_unref (part); ++ } ++ ++ return msg; ++ + #else ++ ++ GMimeMessage * msg(0); ++ msg = g_mime_message_new (false); ++ ++ // headers from the ui: From ++ const Profile profile (get_current_profile ()); ++ std::string s; ++ profile.get_from_header (s); + g_mime_message_set_sender (msg, s.c_str()); +-#endif + + // headers from the ui: Subject + const char * cpch (gtk_entry_get_text (GTK_ENTRY(_subject_entry))); + if (cpch) { +-#ifdef HAVE_GMIME_30 +- g_mime_message_set_subject (msg, cpch, NULL); +-#else + g_mime_message_set_subject (msg, cpch); +-#endif + } + + // headers from the ui: To + const StringView to (gtk_entry_get_text (GTK_ENTRY(_to_entry))); + if (!to.empty()) +-#ifdef HAVE_GMIME_30 +- pan_g_mime_message_add_recipients_from_string (msg, GMIME_ADDRESS_TYPE_TO, to.str); +-#else + pan_g_mime_message_add_recipients_from_string (msg, GMIME_RECIPIENT_TYPE_TO, to.str); +-#endif + + // headers from the ui: Newsgroups + const StringView groups (gtk_entry_get_text (GTK_ENTRY(_groups_entry))); + if (!groups.empty()) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, "Newsgroups", groups.str, NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, "Newsgroups", groups.str); +-#endif + + // headers from the ui: Followup-To + const StringView followupto (gtk_entry_get_text (GTK_ENTRY(_followupto_entry))); + if (!followupto.empty()) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, "Followup-To", followupto.str, NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, "Followup-To", followupto.str); +-#endif + + // headers from the ui: Reply-To + const StringView replyto (gtk_entry_get_text (GTK_ENTRY(_replyto_entry))); + if (!replyto.empty()) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, "Reply-To", replyto.str, NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, "Reply-To", replyto.str); +-#endif + + // headers from posting profile(via prefs): X-Face + if (!profile.xface.empty()) + { + std::string f; + f += " " + profile.xface; +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, "X-Face", f.c_str(), NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, "X-Face", f.c_str()); +-#endif + } + + // add the 'hidden headers' + foreach_const (str2str_t, _hidden_headers, it) + if ((mode==DRAFTING) || (it->first.find ("X-Draft-")!=0)) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, it->first.c_str(), it->second.c_str(), NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, it->first.c_str(), it->second.c_str()); +-#endif + + // build headers from the 'more headers' entry field + std::map<std::string,std::string> headers; +@@ -1693,23 +1785,14 @@ PostUI :: new_message_from_ui (Mode mode, bool copy_body) + val.trim (); + std::string key_str (key.to_string()); + if (extra_header_is_editable (key, val)) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, key.to_string().c_str(), +- val.to_string().c_str(), NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, key.to_string().c_str(), + val.to_string().c_str()); +-#endif + } + g_free (pch); + + // User-Agent + if ((mode==POSTING || mode == UPLOADING) && _prefs.get_flag (USER_AGENT_PREFS_KEY, true)) +-#ifdef HAVE_GMIME_30 +- g_mime_object_set_header ((GMimeObject *) msg, "User-Agent", get_user_agent(), NULL); +-#else + g_mime_object_set_header ((GMimeObject *) msg, "User-Agent", get_user_agent()); +-#endif + + // Message-ID for single text-only posts + if (mode==DRAFTING || ((mode==POSTING || mode==UPLOADING) && _prefs.get_flag (MESSAGE_ID_PREFS_KEY, false))) { +@@ -1738,19 +1821,10 @@ PostUI :: new_message_from_ui (Mode mode, bool copy_body) + g_object_unref (stream); + GMimePart * part = g_mime_part_new (); + pch = g_strdup_printf ("text/plain; charset=%s", charset.c_str()); +- +-#ifdef HAVE_GMIME_30 +- GMimeContentType * type = g_mime_content_type_parse (NULL, pch); +-#else + GMimeContentType * type = g_mime_content_type_new_from_string (pch); +-#endif + g_free (pch); + g_mime_object_set_content_type ((GMimeObject *) part, type); // part owns type now. type isn't refcounted. +-#ifdef HAVE_GMIME_30 +- g_mime_part_set_content(part, content_object); +-#else + g_mime_part_set_content_object (part, content_object); +-#endif + if (mode != UPLOADING) g_mime_part_set_content_encoding (part, _enc); + g_object_unref (content_object); + g_mime_message_set_mime_part (msg, GMIME_OBJECT(part)); +@@ -1758,6 +1832,8 @@ PostUI :: new_message_from_ui (Mode mode, bool copy_body) + } + + return msg; ++ ++#endif + } + + void +-- +GitLab + diff --git a/source/xap/pan/pan.SlackBuild b/source/xap/pan/pan.SlackBuild index 683ed8c4..b88524a3 100755 --- a/source/xap/pan/pan.SlackBuild +++ b/source/xap/pan/pan.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=pan VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | cut -d - -f 2 | rev | cut -f 3- -d . | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -75,6 +75,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +zcat $CWD/0d775547f0e7cf7529538704814469e1db5496f2.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/495bfb2eb9228b5b5cef8b50e11af577e4b473f8.patch.gz | patch -p1 --verbose || exit 1 + # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -146,4 +149,3 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz - |