]> jfr.im git - irc/quakenet/newserv.git/commitdiff
LUA: Add servername and servernumeric nickpushers.
authorChris Porter <redacted>
Thu, 7 Jun 2012 23:17:36 +0000 (00:17 +0100)
committerChris Porter <redacted>
Thu, 7 Jun 2012 23:17:36 +0000 (00:17 +0100)
lua/lib/quakenet/iterators.lua
lua/lua.h
lua/luacommands.c

index d8fc4c6edcd24d7ee4f9f10fcd01fa8f0d3e5ca5..6c16aaebda9112fdb46067fce873028a5bc1877b 100644 (file)
@@ -1,4 +1,4 @@
-nickpusher = { nick = 0, ident = 1, hostname = 2, realname = 3, authname = 4, ipaddress = 5, numeric = 6, timestamp = 7, accountts = 8, umodes = 9, country = 10, accountid = 11 }
+nickpusher = { nick = 0, ident = 1, hostname = 2, realname = 3, authname = 4, ipaddress = 5, numeric = 6, timestamp = 7, accountts = 8, umodes = 9, country = 10, accountid = 11, servername = 12, servernumeric = 13 }
 chanpusher = { name = 0, totalusers = 1, topic = 2, realusers = 3, timestamp = 4, modes = 5 }
 
 function channelusers_iter(channel, items)
index a3e2103a52ade632be54863e91b06eeb91d3d0a6..3eec9e4a9baad560bb73a816fb4a026e4db3303a 100644 (file)
--- a/lua/lua.h
+++ b/lua/lua.h
@@ -31,7 +31,7 @@
 
 /*** defines ************************************/
 
-#define LUA_BOTVERSION "1.93"
+#define LUA_BOTVERSION "1.94"
 #define LUA_CHANFIXBOT "N2"
 #define LUA_OPERCHAN "#twilightzone"
 
index 3b36755225ef59a651c71850501ba94743bc8f8e..e961a9982855ca914f8727dd628de5d61181ed9f 100644 (file)
@@ -959,6 +959,8 @@ static int lua_skill(lua_State *ps) {
 #define PUSHER_TIMESTAMP 13
 #define PUSHER_STRING_INDIRECT 14
 #define PUSHER_ACC_ID 15
+#define PUSHER_SERVER_NAME 16
+#define PUSHER_SERVER_NUMERIC 17
 
 void lua_initnickpusher(void) {
   int i = 0;
@@ -978,6 +980,8 @@ void lua_initnickpusher(void) {
   PUSH_NICKPUSHER(PUSHER_UMODES, umodes);
   PUSH_NICKPUSHER_CUSTOM(PUSHER_COUNTRY, "country");
   PUSH_NICKPUSHER_CUSTOM(PUSHER_ACC_ID, "accountid");
+  PUSH_NICKPUSHER_CUSTOM(PUSHER_SERVER_NAME, "servername");
+  PUSH_NICKPUSHER_CUSTOM(PUSHER_SERVER_NUMERIC, "servernumeric");
 
   nickpushercount = i;
   nickpusher[i].argtype = 0;
@@ -1096,6 +1100,12 @@ int lua_usepusher(lua_State *l, struct lua_pusher **lp, void *np) {
           lua_pushint(l, (long)((nick *)offset)->exts[geoipext]);
         }
         break;
+      case PUSHER_SERVER_NAME:
+        lua_pushstring(l, serverlist[homeserver(((nick *)offset)->numeric)].name->content);
+        break;
+      case PUSHER_SERVER_NUMERIC:
+        lua_pushint(l, homeserver(((nick *)offset)->numeric));
+        break;
     }
 
     i++;