🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by OB1 Sun, 04 Apr 2004 10:56
[Dialog] Custom header script
#145734
Author: OB1
Date: Sun, 04 Apr 2004 10:56
52 lines
2688 bytes
For all those interested, i have made (well sort of) a script to insert any 
custom header in your message.
I use it to insert a 'Distribution:' header into messages to some groups on 
my isp's server that require it.

To be honest: i just adapted the 'remove any header' script by Andreas Loch 
i found in Wiki, to remove the first two characters from any header, 
thereby making it possible to add your header by simply creating a custom 
X-header in Dialog, and removing the 'X-' with the script on sending.

<code>
program OnBeforeSendingMessage;
// This script removes the 'X-' from an X-header, converting it into a 
custom normal header
// Create the X-header in Dialogs Settings - 
Server/Identities/Signatures... menu
const
// set the X-header you want to convert 
    ConvertHeader='X-Distribution';

procedure ConvertXHeader(Message:TStringlist);
var i:integer;
    s:string;
begin
  s:=Message.text;
    while (Message.Strings[i]<>'') and 
(pos(ConvertHeader,Message.Strings[i])=0) do
    begin
      i:=i+1;
      if pos(ConvertHeader,Message.Strings[i])<>0 then
      begin
        delete(s,pos(ConvertHeader,s),2);
      end;
    end;
  message.text:=s;
end;

function OnBeforeSendingMessage(var Message: TStringlist; Servername: 
string; IsEmail: boolean):boolean;
begin
  if IsEmail then exit;
  ConvertXHeader(Message);
  result:=true;
end;

begin
end.

</code>

-- 
OB1
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads