#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif

static Hook *PrivMsg;

DLLFUNC char *m_rprivate(aClient *, aClient *, aClient *, char *, int);

ModuleHeader MOD_HEADER(m_rprivate)
  = {
    "m_rprivate v0.1",
    "kayıtsız nickler için PRIVMSG engelleme",
    "Diablo",
    "3.2-b8-1",
    NULL 
    };

DLLFUNC int MOD_INIT(m_rprivate)(ModuleInfo *modinfo)
{
    PrivMsg = HookAddPCharEx(modinfo->handle, HOOKTYPE_USERMSG, m_rprivate);

    return MOD_SUCCESS;
}

DLLFUNC int MOD_LOAD(m_rprivate)(int module_load)
{
    return MOD_SUCCESS;
}

DLLFUNC int MOD_UNLOAD(m_rprivate)(int module_unload)
{
    return MOD_SUCCESS;
}

DLLFUNC char *m_rprivate(aClient *cptr, aClient *sptr, aClient *acptr, char *text, int notice)
{
    if(!IsARegNick(sptr) && !IsULine(acptr) && !IsServer(sptr) && !IsOper(sptr))
    {

        sendto_one(sptr,":%s!GNoticer@%s PRIVMSG %s :Kayit(REGISTER) edebilmek ve sadece size ait olmasini saglamak icin /NickServ REGISTER SIFRENIZ E-MAILINIZ komutunu kullanabilirsiniz .", me.name, me.name, sptr->name);
        sendto_one(sptr,":%s!GNoticer@%s PRIVMSG %s :Detaylı bilgi için #Help Kanalını kullanınız.", me.name, me.name, sptr->name);
        return NULL;
    } else
        return text;
}
