+void lua_onvoice(int hooknum, void *arg) {
+ void **arglist = (void **)arg;
+ chanindex *ci = ((channel *)arglist[0])->index;
+ nick *np = arglist[1];
+ nick *target = arglist[2];
+
+ if(!target)
+ return;
+
+ if(np) {
+ lua_avpcall(hooknum == HOOK_CHANNEL_VOICED?"irc_onvoice":"irc_ondevoice", "Sll", ci->name, np->numeric, target->numeric);
+ } else {
+ lua_avpcall(hooknum == HOOK_CHANNEL_VOICED?"irc_onvoice":"irc_ondevoice", "S0l", ci->name, target->numeric);
+ }
+}
+