]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Fix defines.
authorChris Porter <redacted>
Sat, 20 May 2006 22:19:00 +0000 (23:19 +0100)
committerChris Porter <redacted>
Sat, 20 May 2006 22:19:00 +0000 (23:19 +0100)
lua/lua.h
lua/lualocal.c

index 299b5d6c9319a1e571273c5fbfe440ba139442da..0ae89af43f2fd4d7b4dbb114e186998ccb3d1af5 100644 (file)
--- a/lua/lua.h
+++ b/lua/lua.h
 #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
 
@@ -43,7 +39,7 @@
 #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 ")"
index ca1e71b2f18100d77baab019799d009dd129d7f1..026ca759bd9e7c90883c7d9415515c47383e89ef 100644 (file)
@@ -217,6 +217,33 @@ static int lua_localjoin(lua_State *ps) {
   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;
@@ -273,6 +300,7 @@ void lua_registerlocalcommands(lua_State *l) {
   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);
 }