[go: up one dir, main page]

File: xcomment.sl

package info (click to toggle)
slrn 1.0.0~pre18-1.3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,396 kB
  • sloc: ansic: 39,706; sh: 3,665; perl: 467; makefile: 289; sed: 24
file content (27 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% This example shows how followup_hook may be used to generate the
% X-Comment-To field associated with fido.* newsgroups.

% This variable will hold the followup_custom_headers as defined in the
% .slrnrc file.
variable Default_Followup_Headers;

Default_Followup_Headers = get_variable_value ("followup_custom_headers");
define followup_hook ()
{
   variable h;
   variable from;

   h = Default_Followup_Headers;
   
   if (0 == strncmp (current_newsgroup, "fido.", 5))
     {
	from = extract_displayed_article_header ("Reply-To");
	!if (strlen (from))
	  from = extract_displayed_article_header ("From");

	% It is a fido newsgroup.  Generate X-Comment-To: header
	h = sprintf ("%s\nX-Comment-To: %s", h, from);
     }

   set_string_variable ("followup_custom_headers", h);
}