dont log commands until all checks are passed

This commit is contained in:
joonicks 2025-09-21 16:23:54 +02:00
parent 4b614a4b82
commit c26b51deda

View File

@ -1,7 +1,7 @@
/* /*
EnergyMech, IRC bot software EnergyMech, IRC bot software
Parts Copyright (c) 1997-2009 proton Parts Copyright (c) 1997-2024 proton
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -591,31 +591,6 @@ recheck_alias:
CurrentNick,uaccess,command,(int)acmd[i]); CurrentNick,uaccess,command,(int)acmd[i]);
} }
/*
* list of last LASTCMDSIZE commands
*/
if (from != CoreUser.name)
{
Free(&current->lastcmds[LASTCMDSIZE-1]);
for(j=LASTCMDSIZE-2;j>=0;j--)
current->lastcmds[j+1] = current->lastcmds[j];
if ((pt = STRCHR(from,'@')) == NULL)
pt = from;
set_mallocdoer(on_msg);
current->lastcmds[0] = (char*)Calloc(strlen(pt) + 45);
if (CurrentUser)
{
sprintf(current->lastcmds[0],"[%s] %s\r%s[%-3i]\t(*%s)",
time2medium(now),command,CurrentUser->name,
(CurrentUser->x.x.access),pt);
}
else
{
sprintf(current->lastcmds[0],"[%s] %s\r%s[---]\t(*%s)",
time2medium(now),command,CurrentNick,pt);
}
}
/* /*
* CAXS check: first argument might be a channel * CAXS check: first argument might be a channel
* check user access on target channel * check user access on target channel
@ -647,6 +622,31 @@ recheck_alias:
return; return;
} }
/*
* list of last LASTCMDSIZE commands
*/
if (from != CoreUser.name)
{
Free(&current->lastcmds[LASTCMDSIZE-1]);
for(j=LASTCMDSIZE-2;j>=0;j--)
current->lastcmds[j+1] = current->lastcmds[j];
if ((pt = STRCHR(from,'@')) == NULL)
pt = from;
set_mallocdoer(on_msg);
current->lastcmds[0] = (char*)Calloc(strlen(pt) + 45);
if (CurrentUser)
{
sprintf(current->lastcmds[0],"[%s] %s\r%s[%-3i]\t(*%s)",
time2medium(now),command,CurrentUser->name,
(CurrentUser->x.x.access),pt);
}
else
{
sprintf(current->lastcmds[0],"[%s] %s\r%s[---]\t(*%s)",
time2medium(now),command,CurrentNick,pt);
}
}
/* /*
* CARGS check: at least one argument is required * CARGS check: at least one argument is required
*/ */