//*********************************************************************
//*             PROGRAM - OnBeforeSendingMessage 2020-08-24           *
//*                        >> Ereignisscript <<                       *
//*                                                                   *
//* Funktionalitaet: [x] neutral                                      *
//*                  [ ] nur Basis_Modul                              *
//*                  [ ] nur Pathfinder                               *
//*                                                                   *
//* Datum     : ueberarbeitet am: 24.08.2020                          *
//* Autor     : Thomas Barghahn                                       *
//*                                                                   *
//*********************************************************************

Program OnBeforeSendingMessage;

Uses textfile, Forms, StdCtrls;
               
    {$I Dialog_Functions.ds}
    {$I _i_OBSendM_UTF7_To_UTF8_Functions.ds}
    {$I _i_OBSendM_Del_Quote_Marks_in_CTHeader.ds}
    {$I _i_OBSendM_Add_KeywordsHeaderInTestGroups.ds}           
    {$I _i_OBSendM_Add_UTF8_Organization_Header.ds}
    {$I _i_OBSendM_Remove_Headers.ds}
    {$I _i_OBSendM_XPost_and_FUp2_Information.ds}    
    {$I _i_OBSendM_Folding_X_FaceHeader.ds}       
    {$I _i_OBSendM_AddFaceHeader.ds}
    {$I _i_OBSendM_Change_Intro_Lines.ds}
    {$I _i_OBSendM_do_FootnoteNew.ds}
    {$I _i_OBSendM_Boxquote.ds}
    {$I _i_OBSendM_UTF7_to_UTF8_Converter.ds}   
             
Function OnBeforeSendingMessage(var Message:TStringlist;
                                    Servername:string;
                                    IsEmail:boolean):boolean;
    
var Error_Func : String;

   Begin
      Result := True;  
      Error_Func := '';    
      Result := Add_UTF8_Org_Header(Result, Message, Error_Func);       
      Result := Remove_Headers (Result, Message, IsEmail, Error_Func);
      Result := Del_Quote_Marks_in_CTH (Result, Message, IsEmail, Error_Func);    
      Result := XPost_and_FUp2_Information (Result, Message, IsEmail, Error_Func);
      Result := Add_KeywordsHeaderInTestGroups(Result, Message, IsEmail, Error_Func);
      Result := AddFaceHeader(Result, Message, Error_Func);    
      Result := Folding_X_FaceHeader (Result, Message, Error_Func);        
      Result := Change_Intro_Lines ( Result, Message, IsEmail, Error_Func); 
      Result := doFootNoteNew ( Result, Message,  Error_Func );
      Result := boxquote ( Result, Message, Error_Func );
      Result := Convert_UTF7_to_UTF8 (Result, Message, Error_Func);
   End;

Begin
End.