X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c592b2babea4c1a8fb20869b69fb0f6e603f856e..8c684fca9c7dbb4a2601628c744be9236ee68641:/lua/luacommands.c diff --git a/lua/luacommands.c b/lua/luacommands.c index ce00d522..84b6e960 100644 --- a/lua/luacommands.c +++ b/lua/luacommands.c @@ -16,6 +16,7 @@ #include "../localuser/localuserchannel.h" #include "../lib/irc_string.h" #include "../lib/flags.h" +#include "../authext/authext.h" #include "lua.h" #include "luabot.h" @@ -260,7 +261,7 @@ static int lua_gline(lua_State *ps) { snprintf(mask, sizeof(mask), "*@%s", IPtostr(target->p_ipaddr)); } - irc_send("%s GL * +%s %d :%s", mynumeric->content, mask, duration, reason); + irc_send("%s GL * +%s %d %jd :%s", mynumeric->content, mask, duration, (intmax_t)getnettime(), reason); LUA_RETURN(ps, lua_cmsg(LUA_PUKECHAN, "lua-GLINE: %s (%d users, %d seconds -- %s)", mask, usercount, duration, reason)); } @@ -376,24 +377,21 @@ static int lua_botnick(lua_State *ps) { return 1; } -/* O(n) */ static int lua_getuserbyauth(lua_State *l) { - const char *acc; nick *np; - int i, found = 0; + int found = 0; + authname *au; if(!lua_isstring(l, 1)) return 0; - acc = lua_tostring(l, 1); + au = getauthbyname(lua_tostring(l, 1)); + if(!au) + return 0; - for(i=0;inext) { - if(np && np->authname[0] && !ircd_strcmp(np->authname, acc)) { - lua_pushnumeric(l, np->numeric); - found++; - } - } + for(np=au->nicks;np;np=np->nextbyauthname) { + lua_pushnumeric(l, np->numeric); + found++; } return found;