]> jfr.im git - irc/quakenet/newserv.git/commitdiff
lua: Adds a nickpusher.isservice to check whether a user is on a services (+s) server.
authorThomas Sader <redacted>
Thu, 6 Mar 2014 21:15:16 +0000 (22:15 +0100)
committerThomas Sader <redacted>
Thu, 6 Mar 2014 21:15:16 +0000 (22:15 +0100)
lua/lib/quakenet/iterators.lua
lua/luacommands.c

index 6c16aaebda9112fdb46067fce873028a5bc1877b..fa991d2264015665d77b6d5505c695e5d93ebec1 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, servername = 12, servernumeric = 13 }
+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, isservice = 14 }
 chanpusher = { name = 0, totalusers = 1, topic = 2, realusers = 3, timestamp = 4, modes = 5 }
 
 function channelusers_iter(channel, items)
index b7b0083e053bc1b907e2bed5d266326b0a470f0c..1abe905ad375bfb759e31ec89fd86eb5883cae8e 100644 (file)
@@ -957,6 +957,7 @@ static int lua_skill(lua_State *ps) {
 #define PUSHER_ACC_ID 15
 #define PUSHER_SERVER_NAME 16
 #define PUSHER_SERVER_NUMERIC 17
+#define PUSHER_IS_SERVICE 18
 
 void lua_initnickpusher(void) {
   int i = 0;
@@ -978,6 +979,7 @@ void lua_initnickpusher(void) {
   PUSH_NICKPUSHER_CUSTOM(PUSHER_ACC_ID, "accountid");
   PUSH_NICKPUSHER_CUSTOM(PUSHER_SERVER_NAME, "servername");
   PUSH_NICKPUSHER_CUSTOM(PUSHER_SERVER_NUMERIC, "servernumeric");
+  PUSH_NICKPUSHER_CUSTOM(PUSHER_IS_SERVICE, "isservice");
 
   nickpushercount = i;
   nickpusher[i].argtype = 0;
@@ -1102,6 +1104,9 @@ int lua_usepusher(lua_State *l, struct lua_pusher **lp, void *np) {
       case PUSHER_SERVER_NUMERIC:
         lua_pushint(l, homeserver(((nick *)offset)->numeric));
         break;
+      case PUSHER_IS_SERVICE:
+        lua_pushboolean(l, NickOnServiceServer((nick *)offset));
+        break;
     }
 
     i++;