/***************************************************************************
 *                                                                         *
 *   WLMSG.CPP                                                            *
 *                                                                         *
 *   Message Options Class.                                                *
 *                                                  - N.Hammond 4/00       *
 *                                                                         *
 ***************************************************************************/

#include "gcomm.h"
#include "majorbbs.h"
#include "gcspsrv.h"
#include "infwlah.h"
#include "wlmsg.h"

#define FILREV "$Revision: 1 $"

CHAR *AgentKey;
CHAR *actvcode;
CHAR *msgtopic[10];
CHAR *msgtext[10];
GBOOL logiton;
CHAR *logfile;
INT   timeslice;                     // timeslice for generating resp
extern "C" INT inf_registered(CHAR *module, CHAR *code);
INT registered_version=0;     /* =1 if activation code correct */

HMCVFILE wlMsgFile;
bool messagesInited=FALSE;           // have message options been initialized

MARKSOURCE(wlMsg);

wlMsg::wlMsg()                     // default constructor
{
     INT i,msg;
     if (messagesInited) {
          return;
     }
     wlMsgFile=opnmsg("INFWLAH.MCV");
     setmbk(wlMsgFile);
     AgentKey="";
     //actvcode = stgopt(ACTVCODE);
     logiton=ynopt(LOGIT);
     logfile=stgopt(LOGFILE);
     timeslice=(USHORT)::numopt(TIMSLC,1,1000);
//     registered_version=inf_registered("INFWL",actvcode);
//     if (!registered_version) {
//        shocst("Tell-a-friend DEMO","UNREGISTERED");
//     }
//     else
        shocst("Webcast List Server loaded","");

     rstmbk();
     messagesInited=TRUE;
}

wlMsg::~wlMsg()                    // destructor
{
     INT i;
     if (AgentKey != NULL) {
         free(AgentKey);
     }
     clsmsg(wlMsgFile);
     messagesInited=FALSE;
}
