summaryrefslogtreecommitdiff
path: root/pith/mailview.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2018-02-26 01:38:18 -0700
committerEduardo Chappa <chappa@washington.edu>2018-02-26 01:38:18 -0700
commit349642a84039a4b026513c32a3b4f8594acd50df (patch)
tree9b9cbf9f46b1450811697c2487dd3320fe4830c6 /pith/mailview.c
parenteefc696ec87ae287803aa68032649e5a7a9b89d0 (diff)
downloadalpine-349642a84039a4b026513c32a3b4f8594acd50df.tar.xz
* New version 2.21.999
* rewrite of some code in pith/ical.c to make sure function prototypes are correct. * Add a separator line to the calendar entry in case, the calendar is sent as the main body of the message.
Diffstat (limited to 'pith/mailview.c')
-rw-r--r--pith/mailview.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/pith/mailview.c b/pith/mailview.c
index dc9b29b6..3fe1dd81 100644
--- a/pith/mailview.c
+++ b/pith/mailview.c
@@ -5,7 +5,7 @@ static char rcsid[] = "$Id: mailview.c 1266 2009-07-14 18:39:12Z hubert@u.washin
/*
* ========================================================================
* Copyright 2006-2009 University of Washington
- * Copyright 2013-2017 Eduardo Chappa
+ * Copyright 2013-2018 Eduardo Chappa
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -244,6 +244,21 @@ format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int
hwid = MAX(avail, 0);
padwid = 0;
+ if(ps_global->atmts[1].description == NULL){
+// && (!ps_global->atmts[0].body
+// || (ps_global->atmts[0].body->type == TYPETEXT))){
+ avail = width - m1 -2;
+
+ dwid = MAX(MIN(40, avail), 0);
+
+ snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%*.*s%s", m1, m1, "",
+ repeat_char(dwid, '-'));
+
+ if(!gf_puts(tmp_20k_buf, pc) || !gf_puts(NEWLINE, pc))
+ return;
+ }
+
+
if(cflags & FC_SUMMARY){
i = utf8_width(_("Calendar Entry:"));
partwid = MIN(i, hwid);
@@ -280,6 +295,7 @@ format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int
s2 = MAX(MIN(1, avail), 0);
avail -= s2;
+
if(cflags & FC_SUMMARY)
utf8_snprintf(padding, sizeof(padding), "%*.*s%*.*w%*.*s",
s1, s1, "", dwid, dwid, "", s2, s2, "");
@@ -463,6 +479,7 @@ format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int
snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%*.*s%s", m1, m1, "",
repeat_char(dwid, '-'));
+
gf_puts(tmp_20k_buf, pc);
}