diff --git a/src/ons.c b/src/ons.c index 6432c60..4c0b6db 100644 --- a/src/ons.c +++ b/src/ons.c @@ -1,7 +1,7 @@ /* 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 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]); } - /* - * list of last LASTCMDSIZE commands - */ - if (from != CoreUser.name) - { - Free(¤t->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 * check user access on target channel @@ -647,6 +622,31 @@ recheck_alias: return; } + /* + * list of last LASTCMDSIZE commands + */ + if (from != CoreUser.name) + { + Free(¤t->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 */