#undef LUA_DEBUGSOCKET
#define LUA_PROFILE
-#ifdef LUA_JITLIBNAME
-
#define LUA_USEJIT
-#endif
-
#define LUA_DEBUGSOCKET_ADDRESS "127.0.0.1"
#define LUA_DEBUGSOCKET_PORT 7733
#include <luajit.h>
#define LUA_AUXVERSION " + " LUAJIT_VERSION
#else
-#define LUA_AUXVERSION
+#define LUA_AUXVERSION ""
#endif
#define LUA_FULLVERSION "Lua engine v" LUA_BOTVERSION " (" LUA_VERSION LUA_AUXVERSION ")"
LUA_RETURN(ps, LUA_OK);
}
+static int lua_localpart(lua_State *ps) {
+ nick *source;
+ channel *target;
+ char *chan;
+
+ if(!lua_islong(ps, 1) || !lua_isstring(ps, 2))
+ LUA_RETURN(ps, LUA_FAIL);
+
+ source = getnickbynumeric(lua_tolong(ps, 1));
+ if(!source)
+ LUA_RETURN(ps, LUA_FAIL);
+
+ chan = (char *)lua_tostring(ps, 2);
+
+ if(!lua_lineok(chan))
+ LUA_RETURN(ps, LUA_FAIL);
+
+ target = findchannel(chan);
+ if(target) {
+ localpartchannel(source, target);
+ } else {
+ LUA_RETURN(ps, LUA_FAIL);
+ }
+
+ LUA_RETURN(ps, LUA_OK);
+}
+
static int lua_localchanmsg(lua_State *ps) {
char *msg;
nick *source;
lua_register(l, "irc_localregisteruser", lua_registerlocaluser);
lua_register(l, "irc_localderegisteruser", lua_deregisterlocaluser);
lua_register(l, "irc_localjoin", lua_localjoin);
+ lua_register(l, "irc_localpart", lua_localpart);
lua_register(l, "irc_localchanmsg", lua_localchanmsg);
lua_register(l, "irc_localnotice", lua_localnotice);
}