Commits

Palmer, 2E0EOL committed 8fdb88d

Code exported from svn repo @1, proper revision history was never kept

Comments (0)

Files changed (193)

+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#include "overchat_config.h"
+#include <vcl.h>
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#include <windows.h>
+#include <shellapi.h>
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif //HDRSTOP
+
+#include "master.h"
+#include "ShadowUnit.h"
+#include "AboutUnit.h"
+#include "General.h"
+#include "Options.h"
+#include "daybothreads.h"
+#include "blake.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TAboutForm *AboutForm;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: AboutUnit.cpp,v 1.3 2006/03/04 17:47:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+using namespace Oberchatten;
+//---------------------------------------------------------------------------
+__fastcall TAboutForm::TAboutForm(TComponent* Owner)
+        : TForm(Owner),
+          shadow(NULL)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  daybothreads_CreateLock(&this->moveHandlingLock);
+}
+//---------------------------------------------------------------------------
+__fastcall TAboutForm::~TAboutForm()
+{
+  daybothreads_DestroyLock(&this->moveHandlingLock);
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::FormCreate(TObject *Sender)
+{
+  if ( Options.GetOptionBool(Oberchatten::oShadows) )
+    this->shadow = new TShadowForm(this);
+
+  this->VersionLabel->Caption = "OberChatten " +
+    (AnsiString)OBERCHATTEN_VERMAJ + "." +
+    (AnsiString)OBERCHATTEN_VERMIN + "." +
+    (AnsiString)OBERCHATTEN_VERPATCH + " (" +
+    (AnsiString)OVERCHAT_VERMAJ + "." +
+    (AnsiString)OVERCHAT_VERMIN + "." +
+    (AnsiString)OVERCHAT_VERPATCH + ")";
+
+  this->VersionLabel->Caption = this->VersionLabel->Caption +
+    "\n(Restronguet)";
+
+  this->ChoosePicture();
+  this->ClientHeight = this->VisibleImg->Picture->Height + 1 +
+    this->VersionLabel->Height + this->BasePanel->Height;
+
+  this->ClientWidth = this->VisibleImg->Picture->Width;
+  this->OkBtn->Left = (this->BasePanel->Width / 2) -
+    (this->OkBtn->Width / 2);
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::FormShow(TObject *Sender)
+{
+  CentreMyForm(this, Screen);
+  if ( this->shadow ) {
+    this->shadow->Follow();
+    this->shadow->Show();
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::FormDestroy(TObject *Sender)
+{
+  if ( this->shadow ) {
+    delete this->shadow;
+    this->shadow = NULL;
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::OnMove(TWMMove& Message)
+{
+  if ( this->shadow  ) {
+    daybothreads_EnterLock(&this->moveHandlingLock);
+    this->shadow->Follow();
+    daybothreads_LeaveLock(&this->moveHandlingLock);
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::URLClick(TObject *Sender)
+{
+  ShellExecute(
+    Handle,
+    "open",
+    "http://www.overchat.org/",
+    NULL,
+    NULL,
+    SW_SHOWNORMAL
+  );
+}
+//---------------------------------------------------------------------------
+void TAboutForm::ChoosePicture()
+{
+  int r;
+
+  if ( this->OverChatLabel->Tag >= 5 )
+    r = 1;
+  else
+    r = GetRand() % 100;
+
+  if ( r == 1  || r == 2 ) {
+    r = GetRand() % 2;
+    if ( r == 1 ) {
+      if ( this->VisibleImg->Tag != 1 ) {
+        this->VisibleImg->Picture = this->Splash1Img->Picture;
+        this->VisibleImg->Tag = 1;
+      }
+    }
+    else {
+      if ( this->VisibleImg->Tag != 2 ) {
+        this->VisibleImg->Picture = this->Splash2Img->Picture;
+        this->VisibleImg->Tag = 2;
+      }
+    }
+    this->VisibleImg->Stretch = true;
+  }
+  else {
+    if ( this->VisibleImg->Tag != 0 ) {
+      this->VisibleImg->Picture = this->Splash0Img->Picture;
+      this->VisibleImg->Tag = 0;
+      this->VisibleImg->Stretch = false;
+    }
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAboutForm::OverChatLabelClick(TObject *Sender)
+{
+  // A secret easter egg
+  TColor oldColor = this->OverChatLabel->Font->Color;
+  this->OverChatLabel->Font->Color = clRed;
+  this->OverChatLabel->Update();
+  daybothreads_Sleep(1);
+  this->OverChatLabel->Tag++;
+  this->ChoosePicture();
+  this->OverChatLabel->Font->Color = oldColor;
+}
+//---------------------------------------------------------------------------
+

AboutUnit.dfm

Binary file added.
+/*
+$Id: AboutUnit.h,v 0.4 2006/03/04 15:08:00 ddrp Exp $
+
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef AboutUnitH
+#define AboutUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <jpeg.hpp>
+//---------------------------------------------------------------------------
+class TAboutForm : public TForm
+{
+__published:	// IDE-managed Components
+        TImage *VisibleImg;
+        TPanel *BasePanel;
+        TBitBtn *OkBtn;
+        TLabel *VersionLabel;
+        TLabel *OverChatLabel;
+        TLabel *URL;
+        TImage *Splash0Img;
+        TImage *Splash1Img;
+        TImage *Splash2Img;
+        void __fastcall FormCreate(TObject *Sender);
+        void __fastcall FormShow(TObject *Sender);
+        void __fastcall FormDestroy(TObject *Sender);
+        void __fastcall URLClick(TObject *Sender);
+        void __fastcall OverChatLabelClick(TObject *Sender);
+protected:
+        void ChoosePicture();
+private:	// User declarations
+        TShadowForm* shadow;
+        dtlock_t moveHandlingLock;
+        void __fastcall OnMove(TWMMove& Message);
+public:		// User declarations
+        __fastcall TAboutForm(TComponent* Owner);
+        __fastcall ~TAboutForm();
+
+        // Message map table
+        BEGIN_MESSAGE_MAP
+          MESSAGE_HANDLER(WM_MOVE, TWMMove, OnMove)
+        END_MESSAGE_MAP(TForm)
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TAboutForm *AboutForm;
+//---------------------------------------------------------------------------
+#endif

AddChumFormUnit.cpp

+/*
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#include "overchat_config.h" // Master project configuration
+#include <vcl.h>
+#include <limits.h>
+#include <time.h>
+#include <stdio.h>
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif //HDRSTOP
+
+#include "blake.h"
+#include "AddChumFormUnit.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TAddChumForm *AddChumForm;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: AddChumFormUnit.cpp,v 0.1 2003/01/29 00:00:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+//---------------------------------------------------------------------------
+__fastcall TAddChumForm::TAddChumForm(TComponent* Owner)
+        : TForm(Owner)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+}
+//---------------------------------------------------------------------------
+AnsiString TAddChumForm::GetChumNick()
+{
+  return ChumNick->Text;
+}
+//---------------------------------------------------------------------------
+void __fastcall TAddChumForm::ChumNickChange(TObject *Sender)
+{
+  OKBtn->Enabled = !ChumNick->Text.IsEmpty();
+}
+//---------------------------------------------------------------------------
+

AddChumFormUnit.dfm

Binary file added.

AddChumFormUnit.h

+/*
+$Id: AddChumFormUnit.h,v 0.1 2003/01/29 00:00:00 ddrp Exp $
+
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef AddChumFormUnitH
+#define AddChumFormUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+//---------------------------------------------------------------------------
+class TAddChumForm : public TForm
+{
+__published:	// IDE-managed Components
+        TEdit *ChumNick;
+        TLabel *Label1;
+        TLabel *Label2;
+        TButton *CancelBtn;
+        TButton *OKBtn;
+        TButton *SearchBtn;
+        void __fastcall ChumNickChange(TObject *Sender);
+private:	// User declarations
+public:		// User declarations
+        __fastcall TAddChumForm(TComponent* Owner);
+        AnsiString GetChumNick();
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TAddChumForm *AddChumForm;
+//---------------------------------------------------------------------------
+#endif

AwayMessageUnit.cpp

+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifdef HAVE_CONFIG_H
+# include "overchat_config.h"
+#endif //HAVE_CONFIG_H
+
+#include <vcl.h>
+#include <time.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string>
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif //HAVE_LIMITS_H
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif
+
+#include "master.h"
+#include "Events.h"
+#include "AwayMessageUnit.h"
+#include "History.h"
+#include "MsgUnit.h"
+#include "ChatFormUnit.h" // TChatForm
+#include "StatsManagerUnit.h" // TStatsManager
+#include "StatusBarManagerUnit.h" // TStatusBarManager
+#include "MyUserUnit.h" // TMyUSer
+#include "MainFormUnit.h" // TMainForm
+#include "General.h" // For CentreMyForm()
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TAwayMessageDlg *AwayMessageDlg;
+using namespace Oberchatten;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: AwayMessageUnit.cpp,v 0.6 2005/12/05 19:54:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+#define AUTO_AWAY_MINS_DEFAULT (30)
+//---------------------------------------------------------------------------
+__fastcall TAwayMessageDlg::TAwayMessageDlg(TComponent* Owner)
+        : TForm(Owner),
+          away(false),
+          autoAwayMins(AUTO_AWAY_MINS_DEFAULT)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif //OVERCHAT_RCS_STAMPS
+  time(&this->lastActionTime); // Update idle information
+}
+//---------------------------------------------------------------------------
+void __fastcall TAwayMessageDlg::FormShow(TObject *Sender)
+{
+  this->Button1->Left = (this->Panel1->Width/2) - (this->Button1->Width/2);
+  //this->Button1->Top = (this->Panel1->Height/2) - (this->Button1->Height/2);
+
+  CentreMyForm(this, MainForm);
+}
+//---------------------------------------------------------------------------
+void __fastcall TAwayMessageDlg::Button1Click(TObject *Sender)
+{
+  if ( this->away )
+    this->Close();
+  else
+    this->Away();
+}
+//---------------------------------------------------------------------------
+bool TAwayMessageDlg::IsAway()
+{
+  return this->away;
+}
+//---------------------------------------------------------------------------
+AnsiString& TAwayMessageDlg::GetAwayMessage(AnsiString& Msg)
+{
+  Msg = "[Auto Response] >";
+  Msg += this->AwayMessage->Text + "<";
+  return Msg;
+}
+//---------------------------------------------------------------------------
+void __fastcall TAwayMessageDlg::FormClose(TObject *Sender,
+      TCloseAction &Action)
+{
+  this->Back(); // Assume user has returned
+}
+//---------------------------------------------------------------------------
+void TAwayMessageDlg::Away()
+{
+  if ( !away ) {
+    this->away = !this->away; // Marked as away
+    this->Button1->Caption = "Come back";
+    Caption = "Away";
+    this->AwayMessage->Enabled = false;
+    this->AwayMessage->Color = clBtnFace;
+
+    MainForm->MnuOberchattenAwayNow->Enabled = false;
+    MainForm->MnuOberchattenAwayReturn->Enabled = true;
+  }
+}
+//---------------------------------------------------------------------------
+void TAwayMessageDlg::Back()
+{
+  if ( this->away ) {
+    this->away = !this->away; // Mark as present
+    this->Button1->Caption = "Go away";
+    this->Caption = "Set away message";
+    this->AwayMessage->Enabled = true;
+    this->AwayMessage->Color = clWindow;
+
+    MainForm->MnuOberchattenAwayNow->Enabled = true;
+    MainForm->MnuOberchattenAwayReturn->Enabled = false;
+  }
+  this->UpdateLastActionTime();
+}
+//---------------------------------------------------------------------------
+void __fastcall TAwayMessageDlg::MinsEditChange(TObject *Sender)
+{
+  unsigned int autoAwayMins;
+
+  this->UpdateLastActionTime(); // Make sure we don't immediately go away
+  autoAwayMins = atoi(this->MinsEdit->Text.c_str());
+  if ( autoAwayMins ) // Zero is invalid
+    this->autoAwayMins = autoAwayMins;
+  else
+    this->autoAwayMins = AUTO_AWAY_MINS_DEFAULT;
+
+  if ( this->autoAwayMins == 1 )
+    this->MinsLabel->Caption = "minute";
+  else
+    this->MinsLabel->Caption = "minutes";
+}
+//---------------------------------------------------------------------------
+time_t TAwayMessageDlg::GetLastActionTime(
+  time_t *PLastActionTime
+)
+{
+  if ( PLastActionTime )
+    memcpy(
+      PLastActionTime,
+      &this->lastActionTime,
+      sizeof(this->lastActionTime)
+    );
+
+  return this->lastActionTime;
+}
+//---------------------------------------------------------------------------
+void TAwayMessageDlg::SetLastActionTime(
+  const time_t *PLastActionTime
+)
+{
+  if ( PLastActionTime ) {
+    memcpy(
+      &this->lastActionTime,
+      PLastActionTime,
+      sizeof(this->lastActionTime)
+    );
+  }
+}
+//---------------------------------------------------------------------------
+void TAwayMessageDlg::UpdateLastActionTime()
+{
+  time_t currentTime;
+
+  time(&currentTime);
+  this->SetLastActionTime(&currentTime);
+}
+//---------------------------------------------------------------------------
+void TAwayMessageDlg::CheckAutoAway()
+{
+  time_t currentTime;
+
+  if ( this->AutoChk->Checked ) {
+    time(&currentTime);
+    if (
+      (currentTime - this->lastActionTime) >=
+      (time_t)((this->autoAwayMins * 60))
+    ) {
+      this->Away();
+    }
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAwayMessageDlg::MinsEditKeyPress(
+  TObject *Sender,
+  char &Key
+)
+{
+  if ( !isdigit(Key) && ( Key != '\b') )
+    Key = '\0';
+}
+//---------------------------------------------------------------------------
+

AwayMessageUnit.dfm

Binary file added.

AwayMessageUnit.h

+/*
+$Id: AwayMessageUnit.h,v 0.3 2005/12/04 23:03:00 ddrp Exp $
+
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef AwayMessageUnitH
+#define AwayMessageUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TAwayMessageDlg : public TForm
+{
+__published:	// IDE-managed Components
+        TPanel *Panel1;
+        TButton *Button1;
+        TMemo *AwayMessage;
+        TCheckBox *AutoChk;
+        TEdit *MinsEdit;
+        TLabel *MinsLabel;
+        void __fastcall FormShow(TObject *Sender);
+        void __fastcall Button1Click(TObject *Sender);
+        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+        void __fastcall MinsEditChange(TObject *Sender);
+        void __fastcall MinsEditKeyPress(TObject *Sender, char &Key);
+private:	// User declarations
+        bool away;
+protected:
+        time_t lastActionTime;
+        unsigned int autoAwayMins;
+public:		// User declarations
+        __fastcall TAwayMessageDlg(TComponent* Owner);
+        bool IsAway();
+        AnsiString& GetAwayMessage(AnsiString& Msg);
+        void Away();
+        void Back();
+        time_t GetLastActionTime(
+          time_t *PLastActionTime
+        );
+        void SetLastActionTime(
+          const time_t *PLastActionTime
+        );
+        void UpdateLastActionTime();
+        void CheckAutoAway();
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TAwayMessageDlg *AwayMessageDlg;
+//---------------------------------------------------------------------------
+#endif
+Filed by: David Duncan Ross Palmer
+Version: 0.4.7-20060212 (post release)
+Severity: Minor nusiance
+Fault: Assertion failed: PEv->eventData.DataArrived.Socket == GlobalNetBuffer.GetSocket()
+File: h:\work\overchat\clients\oberchatten\ServerCallbacks.cpp
+Line: 223
+How to repeat: Sign on to multiple servers and sign off in serial
+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#include "overchat_config.h"
+#include <vcl.h>
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#pragma hdrstop
+
+#include "blake.h"
+#include "General.h"
+#include "ChatFormUnit.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TChatForm *ChatForm;
+using namespace Oberchatten;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: ChatFormUnit.cpp,v 0.3 2005/04/27 19:40:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+//---------------------------------------------------------------------------
+__fastcall TChatForm::TChatForm(TComponent* Owner)
+        : TForm(Owner),
+          Exchange(allRooms),
+          pendingDelete(false)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+}
+//---------------------------------------------------------------------------
+void TChatForm::RefreshTitle()
+{
+  Caption = "Group chat in \"" + ChatName + "\" on exchange " +
+    ExchangeToString(Exchange);
+}
+//---------------------------------------------------------------------------
+void TChatForm::SetChatParameters(AnsiString& NewName, enum blakeExchange ExchangeNum)
+{
+  ChatName = NewName;
+  Exchange = ExchangeNum;
+  RefreshTitle();
+}
+//---------------------------------------------------------------------------
+AnsiString& TChatForm::GetChatName()
+{
+  return ChatName;
+}
+//---------------------------------------------------------------------------
+enum blakeExchange TChatForm::GetChatExchange()
+{
+  return Exchange;
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatForm::CloseBtnClick(TObject *Sender)
+{
+  pendingDelete = true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatForm::TatchBtnClick(TObject *Sender)
+{
+  /* Toggle from style */
+  if ( FormStyle == fsMDIChild )
+    FormStyle = fsNormal;
+  else {
+    // I have to save size information unfortunately because C++Builder is mad and defaults
+    // them once I go back to an MDI child.  Also hide and show to prevent is flashing up as it
+    // changes dimensions from the defaults.
+    int h = Height;
+    int w = Width;
+    Hide();
+    FormStyle = fsMDIChild;
+    Height = h;
+    Width = w;
+    Show();
+  }
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatForm::FormResize(TObject *Sender)
+{
+  Panel2->Height = ClientHeight;
+  Panel2->Left = ClientWidth - (Panel2->Width+1);
+
+  Panel1->Width = ClientWidth - Panel2->Width - 12;
+  Panel1->Top = ClientHeight - (Panel1->Height+1);
+
+  MessageEdit->Top = Panel1->Top - MessageEdit->Height -1;
+  MessageEdit->Left = 8;
+  MessageEdit->Width = (ClientWidth - Panel2->Width) - 12;
+
+  ChatMemo->Height = (ClientHeight - (MessageEdit->Height + Panel1->Height + 8));
+  ChatMemo->Width = (ClientWidth - (Panel2->Width+8));
+
+  Adverts->Height = Adverts->Picture->Height;
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatForm::SaveBtnClick(TObject *Sender)
+{
+  if ( SaveDialog->Execute() )
+    ChatMemo->Lines->SaveToFile(SaveDialog->FileName);
+}
+//---------------------------------------------------------------------------
+
+

ChatFormUnit.dfm

Binary file added.
+/*
+$Id: ChatFormUnit.h,v 0.1 2003/01/29 00:00:00 ddrp Exp $
+
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef ChatFormUnitH
+#define ChatFormUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <CheckLst.hpp>
+#include <jpeg.hpp>
+#include <Dialogs.hpp>
+//---------------------------------------------------------------------------
+class TChatForm : public TForm
+{
+__published:	// IDE-managed Components
+        TMemo *ChatMemo;
+        TMemo *MessageEdit;
+        TPanel *Panel1;
+        TSpeedButton *CloseBtn;
+        TSpeedButton *BlockBtn;
+        TSpeedButton *WhoisBtn;
+        TSpeedButton *MsgBtn;
+        TSpeedButton *IgnoreBtn;
+        TPanel *Panel2;
+        TImage *Adverts;
+        TCheckListBox *MembersListBox;
+        TSpeedButton *KickBtn;
+        TSpeedButton *KillBtn;
+        TSpeedButton *BanBtn;
+        TSpeedButton *TatchBtn;
+        TSpeedButton *SaveBtn;
+        TSpeedButton *LogBtn;
+        TSaveDialog *SaveDialog;
+        TSpeedButton *GlineBtn;
+        void __fastcall CloseBtnClick(TObject *Sender);
+        void __fastcall TatchBtnClick(TObject *Sender);
+        void __fastcall FormResize(TObject *Sender);
+        void __fastcall SaveBtnClick(TObject *Sender);
+private:	// User declarations
+        AnsiString ChatName;
+        bool pendingDelete;
+        enum blakeExchange Exchange;
+        void RefreshTitle();
+public:		// User declarations
+        __fastcall TChatForm(TComponent* Owner);
+        void SetChatParameters(AnsiString& NewName, enum blakeExchange ExchangeNum);
+        AnsiString& GetChatName();
+        enum blakeExchange GetChatExchange();
+        bool inline IsPendingDelete()
+          { return pendingDelete; }
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TChatForm *ChatForm;
+//---------------------------------------------------------------------------
+#endif
+/*
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#include "overchat_config.h"
+#include <vcl.h>
+#include <limits.h>
+#include <time.h>
+#include <stdio.h>
+#pragma hdrstop
+
+#include "blake.h"
+#include "ChatNameUnit.h"
+#include "General.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TChatNameForm *ChatNameForm;
+using namespace Oberchatten;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: ChatNameUnit.cpp,v 0.3 2005/04/27 19:44:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+//---------------------------------------------------------------------------
+__fastcall TChatNameForm::TChatNameForm(TComponent* Owner)
+        : TForm(Owner)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatNameForm::FormCreate(TObject *Sender)
+{
+  int exch;
+
+  for ( exch = (int)guestRooms; exch <= (int)adultRooms; exch++ ) {
+    ExchangeCombo->Items->Add(
+      ExchangeToString((enum blakeExchange)exch)
+    );
+  }
+
+  ExchangeCombo->ItemIndex = (int)generalRooms-1;
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatNameForm::JoinBtnClick(TObject *Sender)
+{
+  if ( !IsValueInItems(ChatCombo->Items, ChatCombo->Text) )
+    ChatCombo->Items->Add(ChatCombo->Text);
+}
+//---------------------------------------------------------------------------
+void __fastcall TChatNameForm::ChatComboChange(TObject *Sender)
+{
+  JoinBtn->Enabled = !ChatCombo->Text.IsEmpty();
+}
+//---------------------------------------------------------------------------
+
+

ChatNameUnit.dfm

Binary file added.
+/*
+$Id: ChatNameUnit.h,v 0.1 2003/01/29 00:00:00 ddrp Exp $
+
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef ChatNameUnitH
+#define ChatNameUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+//---------------------------------------------------------------------------
+class TChatNameForm : public TForm
+{
+__published:	// IDE-managed Components
+        TLabel *Label1;
+        TComboBox *ChatCombo;
+        TComboBox *ExchangeCombo;
+        TLabel *Label2;
+        TBitBtn *JoinBtn;
+        TBitBtn *CancelBtn;
+        void __fastcall FormCreate(TObject *Sender);
+        void __fastcall JoinBtnClick(TObject *Sender);
+        void __fastcall ChatComboChange(TObject *Sender);
+private:	// User declarations
+public:		// User declarations
+        __fastcall TChatNameForm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TChatNameForm *ChatNameForm;
+//---------------------------------------------------------------------------
+#endif

DebugPasswordBoxUnit.cpp

+/*
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "DebugPasswordBoxUnit.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TDebugPasswordBox *DebugPasswordBox;
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: DebugPasswordBoxUnit.cpp,v 0.1 2003/01/29 00:00:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+//---------------------------------------------------------------------------
+__fastcall TDebugPasswordBox::TDebugPasswordBox(TComponent* Owner)
+        : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+AnsiString TDebugPasswordBox::GetPassword()
+{
+  return PasswordEdit->Text;
+}
+//---------------------------------------------------------------------------

DebugPasswordBoxUnit.dfm

Binary file added.

DebugPasswordBoxUnit.h

+/*
+$Id: DebugPasswordBoxUnit.h,v 0.1 2003/01/29 00:00:00 ddrp Exp $
+
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifndef DebugPasswordBoxUnitH
+#define DebugPasswordBoxUnitH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+//---------------------------------------------------------------------------
+class TDebugPasswordBox : public TForm
+{
+__published:	// IDE-managed Components
+        TLabel *Label1;
+        TLabel *Label2;
+        TEdit *PasswordEdit;
+        TBitBtn *BitBtn1;
+        TBitBtn *BitBtn2;
+private:	// User declarations
+public:		// User declarations
+        __fastcall TDebugPasswordBox(TComponent* Owner);
+        AnsiString GetPassword();
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TDebugPasswordBox *DebugPasswordBox;
+//---------------------------------------------------------------------------
+#endif
+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifdef HAVE_CONFIG_H
+# include "overchat_config.h"
+#endif //HAVE_CONFIG_H
+
+#include <assert.h>
+#include <vcl.h>
+#include <time.h>
+#include <stdio.h>
+#include <string>
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif //HAVE_LIMITS_H
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif //HDRSTOP
+
+#include "blake.h"
+#include "Events.h"
+#include "History.h"
+#include "MsgUnit.h"
+#include "Options.h"
+#include "ChatFormUnit.h" // TChatForm
+#include "StatsManagerUnit.h" // TStatsManager
+#include "StatusBarManagerUnit.h" // TStatusBarManager
+#include "MyUserUnit.h" // TMyUSer
+#include "MainFormUnit.h"
+#include "ServerCallbacks.h" // For DataWriter()
+//---------------------------------------------------------------------------
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: Events.cpp,v 0.4 2006/03/02 16:43:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+// Firstly, define how a handler is stored
+struct handler {
+  void(*Address)(OVERCHAT_EVENT* PEv); // It's address
+  enum clientEvents NotifyInfo; // Events which the handlers wasn't to be notified of
+};
+
+// Now define a linked list to keep the handlers stored in
+static blake_link_ptrs Handlers;
+
+// Now for the event queue
+static blakeFastQueue eventQueue;
+static void GetNextEvent(OVERCHAT_EVENT* PEv);
+static void ProcessEvent(OVERCHAT_EVENT* PEv);
+//---------------------------------------------------------------------------
+void OverChatEventsInitialise()
+{
+  enum blakeError err;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  Handlers.size = sizeof(Handlers);
+  blake_InitLinkPtrs(&Handlers, sizeof(struct handler)); // Init list of handlers
+  err = blake_InitFastQueue(&eventQueue, EVENT_QUEUE_SIZE - 1, sizeof(OVERCHAT_EVENT));
+  if ( err != blakeSuccess ) MainForm->BlakeError(__FILE__, __LINE__, err);
+}
+//---------------------------------------------------------------------------
+void OverChatEventsCleanup()
+{
+  enum blakeError err;
+
+  if ( Handlers.DelAll ) // Handlers list initalised?
+    Handlers.DelAll(&Handlers);
+
+  err = blake_DestroyFastQueue(&eventQueue);
+  if ( err != blakeSuccess ) MainForm->BlakeError(__FILE__, __LINE__, err);
+}
+//---------------------------------------------------------------------------
+void FlushOverChatEventQueue()
+{
+  enum blakeError err;
+
+  do {
+    err = blake_PopFastQueue(&eventQueue);
+  } while ( err == blakeSuccess );
+}
+//---------------------------------------------------------------------------
+void PostOverChatEvent(OVERCHAT_EVENT* PEv)
+{
+  if ( PEv ) {
+    if ( (PEv->Code != eventNone) && (PEv->Code != eventAll) ) {
+      enum blakeError err = blake_PushFastQueue(&eventQueue, PEv);
+      if ( err != blakeSuccess )
+        MainForm->BlakeError(__FILE__, __LINE__, err);
+    }
+  }
+}
+//---------------------------------------------------------------------------
+void ProcessOverChatEvents()
+{
+  OVERCHAT_EVENT event;
+
+  GetNextEvent(&event);
+  if ( event.Code != eventNone )
+    ProcessEvent(&event);
+
+  blake_PendingLoop(false); // Network catalyst
+  DataWriter();
+}
+//---------------------------------------------------------------------------
+bool InstallOverChatEventHandler(
+  enum clientEvents EventType,
+  void(*Handler)(OVERCHAT_EVENT* PEv)
+)
+{
+  struct handler newHandler;
+  bool ret = false;
+
+  if ( Handler ) {
+    newHandler.Address = Handler;
+    newHandler.NotifyInfo = EventType;
+
+    ret = ( Handlers.AddToTail(&Handlers, &newHandler) == blakeSuccess );
+  }
+  return ret;
+}
+//---------------------------------------------------------------------------
+bool UninstallOverChatEventHandler(
+  void(*Handler)(OVERCHAT_EVENT* PEv)
+)
+{
+  bool success = false;
+
+  if ( Handler ) {
+    unsigned int i, c;
+
+    c = Handlers.Count(&Handlers);
+    for ( i = 0U; i < c; i++ ) {
+      struct handler currentHandler;
+
+      Handlers.Get(&Handlers, i, &currentHandler);
+      if ( currentHandler.Address == Handler ) { /* This is the user handler we want to remove? */
+        Handlers.DelByPos(&Handlers, i);
+        success = true;
+        break;
+      }
+    }
+  }
+
+  return success;
+}
+//---------------------------------------------------------------------------
+void UninstallAllOverChatEventHandlers()
+{
+  Handlers.DelAll(&Handlers);
+}
+//---------------------------------------------------------------------------
+void InitOverChatEvent(OVERCHAT_EVENT* PEv)
+{
+  if ( PEv )
+    memset(PEv, 0, sizeof(OVERCHAT_EVENT));
+}
+//---------------------------------------------------------------------------
+static void GetNextEvent(OVERCHAT_EVENT* PEv)
+{
+  enum blakeError err = blake_TopFastQueue(&eventQueue, PEv, sizeof(OVERCHAT_EVENT));
+  if ( err == blakeSuccess )
+    err = blake_PopFastQueue(&eventQueue);
+
+  if ( err == blakeQueueEmpty ) {
+    InitOverChatEvent(PEv);
+    PEv->Code = eventNone;
+  }
+  else {
+    if ( err != blakeSuccess )
+      MainForm->BlakeError(__FILE__, __LINE__, err);
+  }
+  return;
+}
+//---------------------------------------------------------------------------
+static void ProcessEvent(OVERCHAT_EVENT* PEv)
+{
+  unsigned int i, c;
+  assert(PEv);
+
+  c = Handlers.Count(&Handlers);
+  for ( i = 0U; i < c; i++ ) {
+    struct handler currentHandler;
+
+    Handlers.Get(&Handlers, i, &currentHandler);
+    if ( currentHandler.NotifyInfo == PEv->Code || currentHandler.NotifyInfo == eventAll )
+      currentHandler.Address(PEv);
+  }
+}
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+
+/*
+$Id: Events.h,v 0.3 2006/03/02 10:08:00 ddrp Exp $
+
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  You'll need this header if you want to post any global events which
+  need to be handled in this client.
+*/
+
+#ifndef INC_EVENTS_H
+#define INC_EVENTS_H
+//---------------------------------------------------------------------------
+#define EVENT_QUEUE_SIZE (128)
+
+enum clientEvents {
+  eventNone,           /* There are no events waiting */
+  eventAll,            /* Handler will be notified of all events */
+  eventDataArrived,    /* Data arrived on a socket */
+  eventMsg,            /* A private message has arrived */
+  eventMsg2,           /* A sub-protocol command has arrived */
+  eventWhoisInfo,      /* Information about another user has arrived */
+  eventVersioned,      /* Server version information has arrived */
+  eventIsOnlineReply,  /* A simple boolean reply from the server */
+  eventGotError,       /* We have received an error packet from the server */
+  eventSuper           /* Response from server as to our current clearance */
+};
+
+typedef struct S_OVERCHAT_EVENT {
+  enum clientEvents Code;
+  union {
+    struct {
+      int Socket;
+      size_t Amount;
+    } DataArrived;
+
+    struct {
+      char From[OVERCHAT_NICK_LIMIT+1];
+      time_t When;
+      enum blakeCipherID CipherID;
+      blake_word8_t Flags1;
+      char* DynamicMessage;
+    } Msg;
+
+    struct {
+      blake_word8_t Reserved0, Reserved1, Reserved2;
+      char* DynamicCommand;
+    } Msg2;
+
+    struct {
+      struct blakeWhoisInfo wii;
+    } WhoisInfo;
+
+    struct {
+      struct blakeVersioned vd;
+    } Versioned;
+
+    struct {
+      struct blakeIsOnlineReply ior;
+    } IsOnlineReply;
+
+    struct {
+      struct blakeSuper spr;
+    } Super;
+
+    struct {
+      struct blakeGotError ge;
+    } GotError;
+
+    /* Add new events here */
+  } eventData;
+} OVERCHAT_EVENT;
+
+void OverChatEventsInitialise();
+void OverChatEventsCleanup();
+void FlushOverChatEventQueue();
+void PostOverChatEvent(
+  OVERCHAT_EVENT *PEv
+);
+void ProcessOverChatEvents();
+bool InstallOverChatEventHandler(
+  enum clientEvents EventType,
+  void(*Handler)(OVERCHAT_EVENT *PEv)
+);
+bool UninstallOverChatEventHandler(
+  void(*Handler)(OVERCHAT_EVENT *PEv)
+);
+void UninstallAllOverChatEventHandlers();
+void InitOverChatEvent(
+  OVERCHAT_EVENT *PEv
+);
+//---------------------------------------------------------------------------
+#endif /*!INC_EVENTS_H*/
+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#ifdef HAVE_CONFIG_H
+# include "overchat_config.h"
+#endif //HAVE_CONFIG_H
+
+#include <vcl.h>
+#include <Clipbrd.hpp> // Clipboard()
+#include <time.h>
+#include <stdio.h>
+#include <assert.h>
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif //HAVE_LIMITS_H
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif //HAVE_STDLIB_H
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif //HDRSTOP
+
+#include "blake.h"
+#include "General.h"
+//---------------------------------------------------------------------------
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: General.cpp,v 0.7 2006/03/04 17:30:00 ddrp Stab $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+using namespace Oberchatten;
+static dtlock_t timeLock;
+//---------------------------------------------------------------------------
+bool Oberchatten::General_Init()
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  daybothreads_CreateLock(&timeLock);
+  return true;
+}
+//---------------------------------------------------------------------------
+void Oberchatten::General_Cleanup()
+{
+  daybothreads_DestroyLock(&timeLock);
+}
+//---------------------------------------------------------------------------
+const AnsiString& Oberchatten::ExchangeToString(
+  enum blakeExchange Exchange
+)
+{
+  static const AnsiString strings[] = {
+    "All",
+    "Guest",
+    "General",
+    "Operated",
+    "Administrative",
+    "Debug",
+    "Adult"
+  };
+
+  static const AnsiString Default("UNKNOWN");
+
+  if ( (int)Exchange < sizeof(strings)/sizeof(strings[0]) )
+    return strings[(int)Exchange];
+
+  return Default;
+}
+//---------------------------------------------------------------------------
+bool Oberchatten::IsValueInItems(
+  TStrings *Items,
+  AnsiString &Critereon
+)
+{
+  int i;
+
+  for ( i = 0; i < Items->Count; i++ ) {
+    if ( Items->Strings[i] == Critereon )
+      return true;
+  }
+  return false;
+}
+//---------------------------------------------------------------------------
+bool Oberchatten::ClipboardHasText()
+{
+  TClipboard* clipboard = Clipboard(); // Get global clipboard wrapper
+  bool hasText = false;
+
+  if ( clipboard->HasFormat(CF_TEXT) ) { // Is in text mode?
+    int textHandle;
+    char* textPtr;
+
+    clipboard->Open(); // Lock clipboard for our use
+    try {
+      textHandle = clipboard->GetAsHandle(CF_TEXT);
+      textPtr = (char*)GlobalLock((HGLOBAL)textHandle);
+      if ( textPtr ) {
+        if ( strlen(textPtr) )
+          hasText = true;
+      }
+      GlobalUnlock((HGLOBAL)textHandle);
+    }
+    catch (...) {
+      clipboard->Close();
+      throw;
+    }
+    clipboard->Close();
+  }
+  return hasText;
+}
+//---------------------------------------------------------------------------
+void Oberchatten::CentreMyForm(
+  TForm *Form,
+  TComponent *Owner
+)
+{
+  TForm* component_form = dynamic_cast<TForm*>(Owner);
+  if ( component_form )
+    CentreMyForm(Form, component_form);
+}
+//---------------------------------------------------------------------------
+void Oberchatten::CentreMyForm(
+  TForm *Form,
+  TForm *Owner
+)
+{
+  Form->Top = Owner->Top + ((Owner->Height/2) - (Form->Height/2));
+  Form->Left = Owner->Left + ((Owner->Width/2) - (Form->Width/2));
+}
+//---------------------------------------------------------------------------
+void Oberchatten::CentreMyForm(
+  TForm *Form,
+  TScreen *Owner
+)
+{
+  Form->Top = (Owner->Height/2) - (Form->Height/2);
+  Form->Left = (Owner->Width/2) - (Form->Width/2);
+}
+//---------------------------------------------------------------------------
+char *Oberchatten::ctime_r(
+  const time_t *clock,
+  char *buf
+)
+{
+  if ( clock && buf ) {
+    char* staticBuffer;
+
+    daybothreads_EnterLock(&timeLock);
+    staticBuffer = ctime(clock); /* Call the legacy RTL function */
+    memcpy(buf, staticBuffer, 26); /* Copy the fixed static buffer */
+    daybothreads_LeaveLock(&timeLock);
+
+    return buf;
+  }
+  return NULL;
+}
+//---------------------------------------------------------------------------
+bool Oberchatten::IsNickInItems(
+  TStrings *List,
+  AnsiString &Nick
+)
+{
+  if ( List ) {
+    unsigned int i, c;
+
+    c = List->Count;
+    for ( i = 0U; i < c; i++ ) {
+      bool comp = blake_NickCompare(
+        List->Strings[i].c_str(),
+        Nick.c_str()
+      );
+      if ( comp )
+        return true;
+    }
+  }
+  return false;
+}
+//---------------------------------------------------------------------------
+void Oberchatten::AlterListBoxSel(
+  TListBox *ListBox,
+  enum listBoxSelMode Mode
+)
+{
+  if ( ListBox ) {
+    unsigned int i, c;
+
+    c = ListBox->Items->Count;
+    for ( i = 0U; i < c; i++ ) {
+      switch ( Mode ) {
+        case lbsAll : {
+          ListBox->Selected[i] = true;
+          break;
+        }
+        case lbsNone : {
+          ListBox->Selected[i] = false;
+          break;
+        }
+        case lbsInvert : {
+          ListBox->Selected[i] = !ListBox->Selected[i];
+          break;
+        }
+        default : {
+          assert(0);
+        }
+      }
+    }
+  }
+  return;
+}
+//---------------------------------------------------------------------------
+int Oberchatten::GetRand()
+{
+  static done; // Most appropriate here, not as class member
+
+  if ( !done ) {
+    srand(time(NULL));
+    done = !done;
+  }
+  return rand();
+}
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+
+/*
+$Id: General.h,v 0.6 2006/03/04 00:20:00 ddrp Stab $
+
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+#ifndef INC_GENERAL_H
+#define INC_GENERAL_H
+//---------------------------------------------------------------------------
+
+#define OBERCHATTEN_VERMAJ   (0)
+#define OBERCHATTEN_VERMIN   (4)
+#define OBERCHATTEN_VERPATCH (8)
+
+namespace Oberchatten {
+  enum listBoxSelMode {
+    lbsAll,
+    lbsNone,
+    lbsInvert
+  };
+
+  bool General_Init();
+  void General_Cleanup();
+
+  const AnsiString& ExchangeToString(
+    enum blakeExchange Exchange
+  );
+
+  bool IsValueInItems(
+    TStrings *Items,
+    AnsiString& Critereon
+  );
+
+  // Tests if clipboard has any text
+  bool ClipboardHasText();
+
+  void CentreMyForm(
+    TForm *Form,
+    TComponent *Owner
+  );
+
+  void CentreMyForm(
+    TForm *Form,
+    TForm *Owner
+  );
+
+  void CentreMyForm(
+    TForm *Form,
+    TScreen *Owner
+  );
+
+  char *ctime_r(
+    const time_t *clock,
+    char *buf                                          // buf must be 26 bytes+
+  );
+
+  bool IsNickInItems(
+    TStrings *List,
+    AnsiString &Nick
+  );
+
+  void AlterListBoxSel(
+    TListBox *ListBox,
+    enum listBoxSelMode Mode
+  );
+
+  int GetRand(void);
+
+} // End of namespace Oberchatten
+//---------------------------------------------------------------------------
+#endif //!INC_GENERAL_H
+/*
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+//---------------------------------------------------------------------------
+#define GLOBALS_COMPILING
+#include "overchat_config.h" // Master project configuration
+#include <vcl.h>
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif //HDRSTOP
+
+#include "Globals.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+extern char global_rcsid[] = "$Id: Globals.cpp,v 0.1 2003/01/29 00:00:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+TNetBuffer GlobalNetBuffer;
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+/*
+$Id: Globals.h,v 0.1 2003/01/29 00:00:00 ddrp Exp $
+
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF