Article View: news.software.readers
Article #63216Re: [slrn] invisible headers
From: Chaabane
Date: Thu, 13 Jul 2000 00:00
Date: Thu, 13 Jul 2000 00:00
225 lines
6909 bytes
6909 bytes
Dans news.software.readers, Chaabane �crivait :
>I posted this question some time ago and someone gave me a patch to
>exclude some headers with the "visible_headers" variable.
By the way, here is the patch :
diff -Naru slrn/src/art.c slrn/src-patch/art.c
--- slrn/src/art.c Thu Jul 15 09:27:27 1999
+++ slrn/src-patch/art.c Thu Jul 29 09:05:42 1999
@@ -127,6 +127,10 @@
int Slrn_Simulate_Graphic_Chars = 0;
int Slrn_Del_Article_Upon_Read = 1;
+/* ----begin---- New variable */
+int Slrn_Has_Tin_Like_Quotes = 0;
+/* ----end---- */
+
char *Slrn_Current_Group_Name;
Slrn_Header_Type *Slrn_First_Header;
Slrn_Header_Type *Slrn_Current_Header;
@@ -566,6 +570,18 @@
hide_header = 0;
break;
}
+/* ----begin---- Skip headers */
+ chv = (0x20 | v->header[1]);
+
+ if ((v->header[0]=='!') && (chv == ch)
+ && (0 == slrn_case_strncmp ((unsigned char *)l->buf,
+ (unsigned char *)v->header+1,
+ (v->len)-1)))
+ {
+ hide_header = 1;
+ break;
+ }
+/* ----end----- */
v = v->next;
}
@@ -2863,9 +2879,28 @@
while (l != NULL)
{
+
+/* ----begin---- New quote format */
+if (Slrn_Has_Tin_Like_Quotes) {
+ char QuoteFormat[2][10] = {"%s%s\n","%s %s\n"};
+ int Quote=1;
+
+ if (l->flags && QUOTE_LINE) Quote=0;
+
+ fprintf (fp, QuoteFormat[Quote],
+ ((Slrn_Quote_String == NULL) ? ">" : Slrn_Quote_String),
+ l->buf);
+}
+else {
+/* ----end---- */
+
fprintf (fp, "%s%s\n",
((Slrn_Quote_String == NULL) ? ">" : Slrn_Quote_String),
l->buf);
+/* ----begin---- New quote format */
+}
+/* ----end---- */
+
l = l->next;
}
slrn_add_signature (fp);
@@ -3053,6 +3088,14 @@
perform_cc = -1;
}
}
+/* ----begin---- FUT warning */
+ if (NULL != newsgroups) {
+ char alert[256] = {0};
+ sprintf(alert,"%s `%s' ","Followup-to:",newsgroups);
+ if (!slrn_get_yesno (0,alert)) newsgroups = NULL;
+ }
+/* ---end--- */
+
}
/* Some mailing lists have a Mail-Followup-To header. But do this if there
@@ -3255,7 +3298,20 @@
&& (l->flags & SIGNATURE_LINE))
break;
+/* ----begin---- New quote format */
+if (Slrn_Has_Tin_Like_Quotes) {
+ char QuoteFormat[2][10] = {"%s%s\n","%s %s\n"};
+ int Quote=1;
+
+ if (l->flags && QUOTE_LINE) Quote=0;
+ fprintf (fp, QuoteFormat[Quote], quote_str, l->buf);
+}
+else {
+/* ----end---- */
fprintf (fp, "%s%s\n", quote_str, l->buf);
+/* ----begin---- New quote format */
+}
+/* ----end---- */
l = l->next;
}
diff -Naru slrn/src/art.h slrn/src-patch/art.h
--- slrn/src/art.h Thu Jul 15 09:27:28 1999
+++ slrn/src-patch/art.h Thu Jul 29 09:05:56 1999
@@ -64,6 +64,9 @@
extern int Slrn_Followup_Strip_Sig;
#endif /* NOT SLRNPULL_CODE */
+/* ----begin---- New variable */
+extern int Slrn_Has_Tin_Like_Quotes;
+/* ----end---- */
typedef struct Slrn_Header_Type
{
diff -Naru slrn/src/mime.c slrn/src-patch/mime.c
--- slrn/src/mime.c Thu Jul 15 09:27:25 1999
+++ slrn/src-patch/mime.c Thu Jul 29 09:00:24 1999
@@ -451,7 +451,88 @@
static void decode_mime_base64 (void)
{
+ Slrn_Article_Line_Type *line = Slrn_Article_Lines, *body, *b;
+ unsigned long Article_Size = 0;
+ char *Article_Body,*Article_B64,*Article_Begin,*String_Begin;
+
+ while (((body = line) != NULL) && (line->flags & HEADER_LINE)) {
+ line = line->next;
+ }
+
+ b = body = body->next;
+ while (b != NULL) {
+ Article_Size+=strlen(b->buf);
+ b = b->next;
+ }
+ Article_Size++;
+
+ if ((Article_Body = slrn_malloc(Article_Size,1,1))==NULL)
+ {
Slrn_Mime_Needs_Metamail = 1;
+ return;
+ }
+
+ if ((Article_B64 = slrn_malloc(Article_Size,1,1))==NULL)
+ {
+ Slrn_Mime_Needs_Metamail = 1;
+ slrn_free(Article_Body);
+ return;
+ }
+
+ b = body;
+ while (b != NULL) {
+ strcat(Article_B64,b->buf);
+ b = b->next;
+ }
+
+ decode_base64(Article_Body,Article_B64,Article_B64+Article_Size);
+
+ Article_Size = strlen(Article_Body);
+ Article_Begin = Article_Body;
+ String_Begin = Article_B64;
+
+ while (Article_Begin-Article_Body < Article_Size) {
+
+ while ('\n' != (*String_Begin = *Article_Begin++)) {
+ if (*String_Begin == 0) break;
+ String_Begin++;
+ }
+ *String_Begin = 0;
+
+ String_Begin = Article_B64;
+ while (*String_Begin != 0) {
+ if ((*String_Begin == 0x0a)||(*String_Begin == 0x0d)) { *String_Begin = 0; }
+ *String_Begin++;
+ }
+
+ if (NULL==(body->buf=slrn_realloc(body->buf,strlen(Article_B64)+1,1))) {
+ slrn_free(Article_Body);
+ slrn_free(Article_B64);
+ Slrn_Mime_Needs_Metamail = 1;
+ return;
+ }
+
+ strcpy(body->buf,Article_B64);
+
+ if (NULL==body->next)
+ if (
+ (NULL==(body->next=(Slrn_Article_Line_Type *) slrn_malloc(sizeof(Slrn_Article_Line_Type),1, 1))) ||
+ (NULL==(body->next->buf = slrn_malloc (1, 1, 1)))
+ ) {
+ slrn_free(Article_Body);
+ slrn_free(Article_B64);
+ Slrn_Mime_Needs_Metamail = 1;
+ return;
+ } else {
+ body->next->next=NULL;
+ body->next->prev=body;
+ }
+ body=body->next;
+ String_Begin = Article_B64;
+ }
+
+ slrn_free(Article_Body);
+ slrn_free(Article_B64);
}
/* This function checks if the last character on curr_line is an = and
diff -Naru slrn/src/startup.c slrn/src-patch/startup.c
--- slrn/src/startup.c Thu Jul 15 09:27:28 1999
+++ slrn/src-patch/startup.c Thu Jul 29 09:06:13 1999
@@ -427,6 +427,10 @@
#else
{"spool_check_up_on_nov", NULL},
#endif
+/* ----begin---- New variable*/
+ {"tin_like_quotes", &Slrn_Has_Tin_Like_Quotes},
+/* ----end---- */
+
{NULL, NULL}
};
Technical Details
Message-ID:
<slrn8mrspt.5ul.chaabane@youkaidi.irisa.fr>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn8mrsln.5ul.chaabane@youkaidi.irisa.fr>Show Full Headers
Complete Article Headers
Message-ID: <slrn8mrspt.5ul.chaabane@youkaidi.irisa.fr> Subject: Re: [slrn] invisible headers Date: Thu, 13 Jul 2000 00:00:00 +0000 From: chaabane@chez.com (Chaabane) References: <slrn8mrsln.5ul.chaabane@youkaidi.irisa.fr> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 645970995 Distribution: world Content-Transfer-Encoding: 8bit X-Disclaimer: Les opinions exprimees ici le sont a titre personnel. Mail-Copies-To: never X-Mail-Copies-To: never Content-Type: text/plain; charset=iso-8859-1 X-Courtesy-Copy: no X-Complaints-To: usenet@irisa.fr X-Trace: news.irisa.fr 963507005 7444 131.254.43.9 (13 Jul 2000 16:50:05 GMT) Organization: ACSEMR User-Agent: slrn/0.9.6.2 (SunOS) Mime-Version: 1.0 NNTP-Posting-Date: 13 Jul 2000 16:50:05 GMT Newsgroups: news.software.readers