diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2007-01-09 22:10:26 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2007-01-09 22:10:26 +0000 |
commit | 33dd1af8b32ab2804c8259321ae10fb334ddb9cf (patch) | |
tree | c6ab236154e6e82a024bb257b4ce2edc18c4d347 /mail/mutt-devel | |
parent | 135bbb848ec50788a1d3922338328b20fd00de5b (diff) | |
download | ports-33dd1af8b32ab2804c8259321ae10fb334ddb9cf.tar.gz ports-33dd1af8b32ab2804c8259321ae10fb334ddb9cf.zip |
Notes
Diffstat (limited to 'mail/mutt-devel')
-rw-r--r-- | mail/mutt-devel/Makefile | 13 | ||||
-rw-r--r-- | mail/mutt-devel/files/extra-patch-greeting | 141 |
2 files changed, 154 insertions, 0 deletions
diff --git a/mail/mutt-devel/Makefile b/mail/mutt-devel/Makefile index b13862a41b03..bb7846894a56 100644 --- a/mail/mutt-devel/Makefile +++ b/mail/mutt-devel/Makefile @@ -104,6 +104,9 @@ # If you want to enable the assumed_charset option define: # WITH_MUTT_ASSUMED_CHARSET_PATCH # +# If you want to enable the `greeting' option define: +# WITH_MUTT_GREETING_PATCH +# PORTNAME= mutt-devel PORTVERSION= 1.5.13 @@ -203,6 +206,11 @@ IGNORE= cannot install: the WITH_MUTT_SIDEBAR_PATCH and WITH_MUTT_NNTP are not c IGNORE= cannot install: the WITH_MUTT_ASSUMED_CHARSET_PATCH and WITH_MUTT_NNTP are not compatible .endif .endif +.if defined(WITH_MUTT_GREETING_PATCH) +.if defined(WITH_MUTT_NNTP) +IGNORE= cannot install: the WITH_MUTT_GREETING_PATCH and WITH_MUTT_NNTP are not compatible +.endif +.endif .if defined (MUTT_LITE) WITHOUT_MUTT_XML= yes @@ -339,6 +347,11 @@ post-patch:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply .endif +.if defined(WITH_MUTT_GREETING_PATCH) +post-patch:: + @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-greeting +.endif + .if defined(WITHOUT_MUTT_FLOCK) CONFIGURE_ARGS+= --disable-flock .else diff --git a/mail/mutt-devel/files/extra-patch-greeting b/mail/mutt-devel/files/extra-patch-greeting new file mode 100644 index 000000000000..d801c2d5fd31 --- /dev/null +++ b/mail/mutt-devel/files/extra-patch-greeting @@ -0,0 +1,141 @@ +--- globals.h.orig 2006-08-11 12:07:12.000000000 +0300 ++++ globals.h 2006-12-14 12:26:14.000000000 +0200 +@@ -50,6 +50,7 @@ + WHERE char *FolderFormat; + WHERE char *ForwFmt; + WHERE char *Fqdn; ++WHERE char *Greeting; + WHERE char *HdrFmt; + WHERE char *Homedir; + WHERE char *Hostname; +--- hdrline.c.orig 2006-04-28 22:43:51.000000000 +0300 ++++ hdrline.c 2006-12-14 16:47:16.000000000 +0200 +@@ -730,3 +730,61 @@ + + mutt_FormatString (dest, destlen, s, hdr_format_str, (unsigned long) &hfi, flags); + } ++ ++/* %n = recipient name ++ * %u = user (login) name of recipient ++ * %v = first name of recipient */ ++const char * ++greeting_string (char *dest, ++ size_t destlen, ++ char op, ++ const char *src, ++ const char *prefix, ++ const char *ifstring, ++ const char *elsestring, ++ unsigned long data, ++ format_flag flags) ++{ ++ HEADER *hdr = (HEADER *)data; ++ char *p, buf2[SHORT_STRING]; ++ ++ dest[0] = '\0'; ++ switch (op) ++ { ++ case 'n': ++ mutt_format_s (dest, destlen, prefix, mutt_get_name (hdr->env->to)); ++ break; ++ ++ case 'u': ++ if (hdr->env->to) ++ { ++ strfcpy (buf2, mutt_addr_for_display (hdr->env->to), sizeof (buf2)); ++ if ((p = strpbrk (buf2, "%@"))) ++ *p = '\0'; ++ } ++ else ++ buf2[0] = '\0'; ++ mutt_format_s (dest, destlen, prefix, buf2); ++ break; ++ ++ case 'v': ++ if (hdr->env->to) ++ mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->to)); ++ else if (hdr->env->cc) ++ mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->cc)); ++ else ++ *buf2 = '\0'; ++ if ((p = strpbrk (buf2, " %@"))) ++ *p = '\0'; ++ mutt_format_s (dest, destlen, prefix, buf2); ++ break; ++ ++ default: ++ snprintf (dest, destlen, "%%%s%c", prefix, op); ++ break; ++ } ++ if (flags & M_FORMAT_OPTIONAL) ++ mutt_FormatString (dest, destlen, elsestring, greeting_string, data, flags); ++ ++ return(src); ++} +--- init.h.orig 2006-08-11 12:04:04.000000000 +0300 ++++ init.h 2006-12-14 16:49:16.000000000 +0200 +@@ -710,6 +710,22 @@ + ** a regular expression that will match the whole name so mutt will expand + ** "Franklin" to "Franklin, Steve". + */ ++ { "greeting", DT_STR, R_NONE, UL &Greeting, UL "" }, ++ /* ++ ** .pp ++ ** When set, this is the string that will precede every message as a ++ ** greeting phrase to the recipients. ++ ** .pp ++ ** ``Format strings'' are similar to the strings used in the ``C'' ++ ** function printf to format output (see the man page for more detail). ++ ** The following sequences are defined in Mutt: ++ ** .pp ++ ** .dl ++ ** .dt %n .dd recipient name ++ ** .dt %u .dd user (login) name of recipient ++ ** .dt %v .dd first name of recipient ++ ** .de ++ */ + { "hdr_format", DT_SYN, R_NONE, UL "index_format", 0 }, + /* + */ +--- PATCHES.orig 2006-08-11 13:55:43.000000000 +0300 ++++ PATCHES 2006-12-14 15:59:14.000000000 +0200 +@@ -0,0 +1 @@ ++vc.greeting +--- protos.h.orig 2006-07-12 02:32:28.000000000 +0300 ++++ protos.h 2006-12-14 15:43:09.000000000 +0200 +@@ -509,4 +509,5 @@ + void ci_bounce_message (HEADER *, int *); + int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *); + +- ++const char *greeting_string (char *, size_t, char, const char *, const char *, ++ const char *, const char *, unsigned long, format_flag); +--- send.c.orig 2006-03-03 12:12:34.000000000 +0200 ++++ send.c 2006-12-14 15:57:36.000000000 +0200 +@@ -395,6 +395,18 @@ + } + } + ++void mutt_make_greeting (HEADER *hdr, FILE *out, int flags) ++{ ++ char buffer[STRING]; ++ if (Greeting) ++ { ++ mutt_FormatString(buffer, sizeof(buffer), Greeting, greeting_string, ++ (unsigned long) hdr, flags); ++ fputs(buffer, out); ++ fputc ('\n', out); ++ } ++} ++ + void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out) + { + char buffer[STRING]; +@@ -1268,6 +1280,7 @@ + if (option (OPTHDRS)) + process_user_header (msg->env); + ++ mutt_make_greeting(msg, tempfp, flags); + + if (option (OPTSIGONTOP) && (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0)) + append_signature (tempfp); |