summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2019-05-02 09:19:35 -0400
committerDavid Bremner <david@tethera.net>2019-05-03 06:50:40 -0300
commit35e21bfb6f5fa4a0b61a71860e1f7f04d9e3e274 (patch)
tree168eeff16ceb4c1ac781b7e7a1c9679d4d8a61d8 /util
parentf6da475e35634cd39d765e75442e5b18401b80ea (diff)
gmime-cleanup: remove GMime 2.6 variant codeblocks
signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'util')
-rw-r--r--util/gmime-extra.c93
-rw-r--r--util/gmime-extra.h12
2 files changed, 0 insertions, 105 deletions
diff --git a/util/gmime-extra.c b/util/gmime-extra.c
index bc1e3c4d..4b577a5b 100644
--- a/util/gmime-extra.c
+++ b/util/gmime-extra.c
@@ -31,97 +31,6 @@ g_string_talloc_strdup (void *ctx, char *g_string)
return new_str;
}
-#if (GMIME_MAJOR_VERSION < 3)
-
-const char *
-g_mime_certificate_get_valid_userid (GMimeCertificate *cert)
-{
- /* output user id only if validity is FULL or ULTIMATE. */
- /* note that gmime 2.6 is using the term "trust" here, which
- * is WRONG. It's actually user id "validity". */
- const char *name = g_mime_certificate_get_name (cert);
- if (name == NULL)
- return name;
- GMimeCertificateTrust trust = g_mime_certificate_get_trust (cert);
- if (trust == GMIME_CERTIFICATE_TRUST_FULLY || trust == GMIME_CERTIFICATE_TRUST_ULTIMATE)
- return name;
- return NULL;
-}
-
-char *
-g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type)
-{
- InternetAddressList *list = g_mime_message_get_recipients (message, type);
- return internet_address_list_to_string (list, 0);
-}
-
-inline InternetAddressList *
-g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type)
-{
- return g_mime_message_get_recipients (message, type);
-}
-
-char *
-g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
-{
- char *date = g_mime_message_get_date_as_string (message);
- return g_string_talloc_strdup (ctx, date);
-}
-
-InternetAddressList *
-g_mime_message_get_from (GMimeMessage *message)
-{
- return internet_address_list_parse_string (g_mime_message_get_sender (message));
-}
-
-const char *
-g_mime_message_get_from_string (GMimeMessage *message) {
- return g_mime_message_get_sender (message);
-}
-
-InternetAddressList *
-g_mime_message_get_reply_to_list (GMimeMessage *message)
-{
- const char *reply_to;
-
- reply_to = g_mime_message_get_reply_to (message);
- if (reply_to && *reply_to)
- return internet_address_list_parse_string (reply_to);
- else
- return NULL;
-}
-
-/**
- * return talloc allocated reply-to string
- */
-char *
-g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message)
-{
- return talloc_strdup(ctx, g_mime_message_get_reply_to (message));
-}
-
-gboolean
-g_mime_signature_status_good (GMimeSignatureStatus status) {
- return (status == GMIME_SIGNATURE_STATUS_GOOD);
-}
-
-gboolean
-g_mime_signature_status_bad (GMimeSignatureStatus status) {
- return (status == GMIME_SIGNATURE_STATUS_BAD);
-}
-
-gboolean
-g_mime_signature_status_error (GMimeSignatureError error) {
- return (error != GMIME_SIGNATURE_ERROR_NONE);
-}
-
-gint64
-g_mime_utils_header_decode_date_unix (const char *date) {
- return (gint64) g_mime_utils_header_decode_date (date, NULL);
-}
-
-#else /* GMime >= 3.0 */
-
const char *
g_mime_certificate_get_valid_userid (GMimeCertificate *cert)
{
@@ -223,5 +132,3 @@ g_mime_utils_header_decode_date_unix (const char *date) {
return ret;
}
-
-#endif
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index 5d8c52f7..d539ec3a 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -9,17 +9,6 @@ extern "C" {
GMimeStream *g_mime_stream_stdout_new(void);
-#if (GMIME_MAJOR_VERSION < 3)
-
-#define GMIME_ADDRESS_TYPE_TO GMIME_RECIPIENT_TYPE_TO
-#define GMIME_ADDRESS_TYPE_CC GMIME_RECIPIENT_TYPE_CC
-#define GMIME_ADDRESS_TYPE_BCC GMIME_RECIPIENT_TYPE_BCC
-
-#define g_mime_2_6_unref(obj) g_object_unref (obj)
-#define g_mime_3_unused(arg) arg
-#define g_mime_certificate_get_fpr16(cert) g_mime_certificate_get_key_id (cert)
-#else /* GMime >= 3.0 */
-
#define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
#define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
#define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
@@ -47,7 +36,6 @@ typedef GMimeSignatureStatus GMimeSignatureError;
#define g_mime_2_6_unref(obj) /*ignore*/
#define g_mime_3_unused(arg) unused(arg)
-#endif
/**
* Get last 16 hex digits of fingerprint ("keyid")