]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lua/luacommands.c
LUA: Add servername and servernumeric nickpushers.
[irc/quakenet/newserv.git] / lua / luacommands.c
index 20a96c9e5265a81d5c99d63c95bf511f7ebaaac7..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++;
@@ -1120,3 +1130,4 @@ void lua_initchanpusher(void) {
   chanpushercount = i;
   chanpusher[i].argtype = 0;
 }
+