diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-06-14 15:54:08 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-06-14 15:54:08 -0600 |
commit | 4fa8e0bba357cfc2810ebe8c2dff79ae1778ada7 (patch) | |
tree | 9b2a9976c330aed7aa380b4bef45c952e54c3f30 | |
parent | 35aeccf9de673b44bb0f3e2f6d0cb7cbf7a0270e (diff) | |
download | alpine-4fa8e0bba357cfc2810ebe8c2dff79ae1778ada7.tar.xz |
* Creation of Alpine's Privacy Policy. This is presented as a link to an online
document from the Release Notes. Upon user request,
Alpine downloads and displays this document. Links to the privacy policy are
also displayed when a user starts Alpine for the first time, or when a user
starts a new version of Alpine. There is no default exit greeting command for
these screens, and to exit the user must press "E", instead of the old default,
which was the RETURN command. The RETURN command will open the handle on which
the cursor is on, which by default is the Privacy Policy
-rw-r--r-- | alpine/help.c | 57 | ||||
-rw-r--r-- | alpine/keymenu.c | 6 | ||||
-rw-r--r-- | alpine/newuser.c | 4 | ||||
-rw-r--r-- | pith/headers.h | 1 | ||||
-rw-r--r-- | pith/pine.hlp | 107 |
5 files changed, 110 insertions, 65 deletions
diff --git a/alpine/help.c b/alpine/help.c index a3a502a6..6c5f2e70 100644 --- a/alpine/help.c +++ b/alpine/help.c @@ -119,8 +119,8 @@ the first line in the text. int helper_internal(HelpType text, char *frag, char *title, int flags) { - char **shown_text; - int cmd = MC_NONE; + char **shown_text, **external_text = NULL, *help_text = NULL, **rv; + int cmd = MC_NONE, is_external; long offset = 0L; char *error = NULL, tmp_title[MAX_SCREEN_COLS + 1]; STORE_S *store; @@ -132,6 +132,37 @@ helper_internal(HelpType text, char *frag, char *title, int flags) /* assumption here is that HelpType is char ** */ shown_text = text; + is_external = 0; + + if(shown_text && *shown_text && !struncmp(*shown_text, "x-alpine-http:", 14)){ + int status; + help_text = http_get(*shown_text + 14, &status); + if(status != HTTP_OK){ + shown_text = NO_HELP; + if(help_text) fs_give((void **) &help_text); + } + else{ + is_external = 1; + if(help_text == NULL) external_text = NO_HELP; + else{ + char *s, *t; + int nlines; + + for(nlines = 0, s = help_text; s != NULL; nlines++){ + s = strchr(s, '\n'); + if(s != NULL) s++; + } + rv = external_text = fs_get((nlines + 1)*sizeof(char *)); + for(s = help_text; s != NULL; s = t){ + t = strchr(s, '\n'); + if(t != NULL) *t++ = '\0'; + *rv++ = cpystr(s); + } + *rv = NULL; + } + } + + } if(F_ON(F_BLANK_KEYMENU,ps_global)){ FOOTER_ROWS(ps_global) = 3; @@ -149,16 +180,16 @@ helper_internal(HelpType text, char *frag, char *title, int flags) * Turn it into a charstar with digested html */ do{ - init_helper_getc(shown_text); + init_helper_getc(is_external ? external_text : shown_text); init_handles(&handles); memset(&hscroll, 0, sizeof(HELP_SCROLL_S)); - hscroll.help_source = shown_text; + hscroll.help_source = is_external ? external_text : shown_text; if((store = so_get(CharStar, NULL, EDIT_ACCESS)) != NULL){ gf_set_so_writec(&pc, store); gf_filter_init(); - if(!struncmp(shown_text[0], "<html>", 6)) + if(!struncmp(hscroll.help_source[0], "<html>", 6) || is_external) gf_link_filter(gf_html2plain, gf_html2plain_opt("x-alpine-help:", ps_global->ttyo->screen_cols, @@ -205,18 +236,18 @@ helper_internal(HelpType text, char *frag, char *title, int flags) sargs.text.handles = sargs.text.handles->next; if(!(sargs.bar.title = title)){ - if(!struncmp(shown_text[0], "<html>", 6)){ + if(!struncmp(hscroll.help_source[0], "<html>", 6) || is_external){ char *p; int i; /* if we're looking at html, look for a <title> * in the <head>... */ for(i = 1; - shown_text[i] - && struncmp(shown_text[i], "</head>", 7); + hscroll.help_source[0][i] + && struncmp(hscroll.help_source[i], "</head>", 7); i++) - if(!struncmp(shown_text[i], "<title>", 7)){ - strncpy(tmp_20k_buf, &shown_text[i][7], SIZEOF_20KBUF); + if(!struncmp(hscroll.help_source[i], "<title>", 7)){ + strncpy(tmp_20k_buf, &hscroll.help_source[i][7], SIZEOF_20KBUF); tmp_20k_buf[SIZEOF_20KBUF-1] = '\0'; if((p = strchr(tmp_20k_buf, '<')) != NULL) *p = '\0'; @@ -336,6 +367,12 @@ helper_internal(HelpType text, char *frag, char *title, int flags) } while(cmd == MC_RESIZE); + if(external_text != NULL){ + for(rv = external_text; *rv != NULL; *rv++) + fs_give((void **) &*rv); + fs_give((void **) external_text); + } + if(help_text) fs_give((void **) &help_text); return(cmd); } diff --git a/alpine/keymenu.c b/alpine/keymenu.c index 519622a6..69ca92d9 100644 --- a/alpine/keymenu.c +++ b/alpine/keymenu.c @@ -1086,10 +1086,8 @@ INST_KEY_MENU(simple_file_keymenu, simple_file_keys); struct key nuov_keys[] = {HELP_MENU, OTHER_MENU, - {"E",NULL,{MC_EXIT,1,{'e',ctrl('M'),ctrl('J')}},KS_NONE}, - /* TRANSLATORS: Alpine asks the user to be counted when they - first start using alpine. */ - {"Ret","[" N_("Be Counted!") "]",{MC_VIEW_HANDLE,2,{ctrl('M'),ctrl('J')}},KS_NONE}, + {"E",NULL,{MC_EXIT,1,{'e'}},KS_NONE}, + {"V",N_("ViewLink"),{MC_VIEW_HANDLE,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE}, NULL_MENU, NULL_MENU, PREVPAGE_MENU, diff --git a/alpine/newuser.c b/alpine/newuser.c index 2b32b3c0..6a84372a 100644 --- a/alpine/newuser.c +++ b/alpine/newuser.c @@ -126,9 +126,7 @@ new_user_or_version(struct pine *ps) (nuov_keymenu.how_many * 12) * sizeof(struct key)); setbitmap(sargs.keys.bitmap); - km.keys[NUOV_EXIT].label = "[Exit this greeting]"; - km.keys[NUOV_EXIT].bind.nch = 3; - clrbitn(NUOV_VIEW, sargs.keys.bitmap); + km.keys[NUOV_EXIT].label = "Exit this greeting"; if(ps->first_time_user) clrbitn(NUOV_RELNOTES, sargs.keys.bitmap); diff --git a/pith/headers.h b/pith/headers.h index 45dbce96..bd169dd2 100644 --- a/pith/headers.h +++ b/pith/headers.h @@ -31,6 +31,7 @@ #include "../c-client/misc.h" /* for cpystr proto */ #include "../c-client/utf8.h" /* for CHARSET and such*/ #include "../c-client/imap4r1.h" +#include "../c-client/http.h" /* for http support */ /* include osdep protos and def'ns */ #include "osdep/bldpath.h" diff --git a/pith/pine.hlp b/pith/pine.hlp index a5dacaad..58669056 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 447 2020-06-14 02:05:18 +Alpine Commit 448 2020-06-14 15:53:58 ============= h_news ================= <HTML> <HEAD> @@ -170,8 +170,16 @@ variety of Unix® operating systems. A version for Microsoft Windows® is available as is a world wide web based version designed to run under the Apache web server. +<P> +Alpine's privacy policy is a living, online only, document, which can be found at +<A href="h_privacy_policy">http://alpine.x10host.com/privacy.html</A>. +By following the previous link, Alpine +will connect to an external server, and will download it and display +it for you. Please take some time to read it and understand it. +Since the Privacy Policy could be ammended to take into consideration +new additions to Alpine, please check it periodically. - +<P> This is a development version of Alpine. These enhancements are released after the release of version 2.22. Please report any problems you find with this release. @@ -182,6 +190,15 @@ problems you find with this release. <UL> <LI> Implementation of XOAUTH2 authentication support for Outlook. Based on documentation suggested by Andrew C Aitchison. + +<LI> Creation of Alpine's Privacy Policy. This is presented as a link to an online + document from the Release Notes (Link at the top of this document.) Upon user request, + Alpine downloads and displays this document. Links to the privacy policy are + also displayed when a user starts Alpine for the first time, or when a user + starts a new version of Alpine. There is no default exit greeting command for + these screens, and to exit the user must press "E", instead of the old default, + which was the RETURN command. The RETURN command will open the handle on which + the cursor is on, which by default is the Privacy Policy. </UL> <P> @@ -2482,22 +2499,20 @@ this link now to send a message to it:<BR> <H1>Welcome to Alpine ... a Program for Internet News and Email</H1> We hope you will explore Alpine's many capabilities. From the MAIN MENU, select Setup/Config to see many of the options available to you. Also note -that all screens have context-sensitive help text available.<P> -<!--chtml if pinemode="phone_home"--> -SPECIAL REQUEST: -This software was originally created and maintained as a public -service by the University of Washington until 2009; updates are made -available as a public service of the Alpine community. It is always -helpful to have an idea of how many users are using Alpine. Are you -willing to be counted as an Alpine user? Pressing -<A HREF="X-Alpine-Phone-Home:">Return</A> -will send an anonymous (meaning, your real email address will not be revealed) -message to the Alpine developers for purposes of tallying. -<P> -<!--To Exit this screen and continue your Alpine session press "E".--> -<!--chtml else--> -To Exit this screen and continue your Alpine session press "Return". -<!--chtml endif--> +that all screens have context-sensitive help text available. + +<P> +Alpine's privacy policy is a living, online only, document, which can be found at +<A href="h_privacy_policy">http://alpine.x10host.com/privacy.html</A>. +By following the previous link, Alpine +will connect to an external server, and will download it and display +it for you. Please take some time to read it and understand it. +Since the Privacy Policy could be ammended to take into consideration +new additions to Alpine, please check it periodically. You can always +find a link to the Privacy Policy in the <A href="h_news">Release Notes</A>. + +<P> +To Exit this screen and continue your Alpine session press "E". </BODY> </HTML> ===== new_alpine_user_greeting ====== @@ -2516,22 +2531,19 @@ using Alpine. Your Pine configuration file is automatically used for Alpine. The Release Notes may be viewed by pressing "R" now or while in the MAIN MENU. + <P> -<!--chtml if pinemode="phone_home"--> -SPECIAL REQUEST: -This software was originally created and maintained as a public -service by the University of Washington until 2009; updates are made -available as a public service of the Alpine community. It is always -helpful to have an idea of how many users are using Alpine. Are you -willing to be counted as an Alpine user? Pressing -<A HREF="X-Alpine-Phone-Home:">Return</A> -will send an anonymous (meaning, your real email address will not be revealed) -message to the Alpine developers for purposes of tallying. -<P> -<!--To Exit this screen and continue your Alpine session press "E".--> -<!--chtml else--> -To Exit this screen and continue your Alpine session press "Return". -<!--chtml endif--> +Alpine's privacy policy is a living, online only, document, which can be found at +<A href="h_privacy_policy">http://alpine.x10host.com/privacy.html</A>. +By following the previous link, Alpine +will connect to an external server, and will download it and display +it for you. Please take some time to read it and understand it. +Since the Privacy Policy could be ammended to take into consideration +new additions to Alpine, please check it periodically. You can always +find a link to the Privacy Policy in the <A href="h_news">Release Notes</A>. + +<P> +To Exit this screen and continue your Alpine session press "E". </BODY> </HTML> ===== new_version_greeting ====== @@ -2548,21 +2560,18 @@ this version of Alpine before. This version's significant changes are documented in the Release Notes, which may be viewed by pressing "R" now or while in the MAIN MENU. <P> -<!--chtml if pinemode="phone_home"--> -SPECIAL REQUEST: -This software was originally created and maintained as a public -service by the University of Washington until 2009; updates are made -available as a public service of the Alpine community. It is always -helpful to have an idea of how many users are using Alpine. Are you -willing to be counted as an Alpine user? Pressing -<A HREF="X-Alpine-Phone-Home:">Return</A> -will send an anonymous (meaning, your real email address will not be revealed) -message to the Alpine developers for purposes of tallying. -<P> -<!--To Exit this screen and continue your Alpine session press "E".--> -<!--chtml else--> -To Exit this screen and continue your Alpine session press "Return". -<!--chtml endif--> +<P> +Alpine's privacy policy is a living, online only, document, which can be found at +<A href="h_privacy_policy">http://alpine.x10host.com/privacy.html</A>. +By following the previous link, Alpine +will connect to an external server, and will download it and display +it for you. Please take some time to read it and understand it. +Since the Privacy Policy could be ammended to take into consideration +new additions to Alpine, please check it periodically. You can always +find a link to the Privacy Policy in the <A href="h_news">Release Notes</A>. + +<P> +To Exit this screen and continue your Alpine session press "E". </BODY> </HTML> @@ -37954,3 +37963,5 @@ in size will be selected. Examples: 2176, 1.53K (1530), or 3M (3000000). ========== h_preserve_field ========== Use 'p' to toggle between preserving or not preserving the original To: and Cc: fields of the message. Enter ^C to cancel message. +========== h_privacy_policy ========== +x-alpine-http:http://alpine.x10host.com/privacy.html |