]>
jfr.im git - irc/quakenet/newserv.git/blob - lua/luacommands.c
1 /* Copyright (C) Chris Porter 2005-2006 */
2 /* ALL RIGHTS RESERVED. */
3 /* Don't put this into the SVN repo. */
7 - Write a nick printf type thing for pcalled functions.
8 - Make commands register as apposed to blinding calling.
9 - Use numerics instead of huge structures, and add lookup functions.
12 #include "../channel/channel.h"
13 #include "../control/control.h"
14 #include "../nick/nick.h"
15 #include "../localuser/localuser.h"
16 #include "../localuser/localuserchannel.h"
17 #include "../lib/irc_string.h"
27 static int lua_smsg(lua_State
*ps
);
28 static int lua_skill(lua_State
*ps
);
30 typedef struct lua_pusher
{
33 const char *structname
;
36 struct lua_pusher nickpusher
[MAX_PUSHER
];
37 struct lua_pusher chanpusher
[MAX_PUSHER
];
39 void lua_setuppusher(struct lua_pusher
*pusherlist
, lua_State
*l
, int index
, struct lua_pusher
**lp
, int max
);
41 void lua_initnickpusher(void);
42 INLINE
int lua_usepusher(lua_State
*l
, struct lua_pusher
**lp
, void *np
);
44 void lua_initchanpusher(void);
45 INLINE
int lua_usechanpusher(lua_State
*l
, struct lua_pusher
**lp
, nick
*np
);
47 #define lua_setupnickpusher(L2, I2, P2, M2) lua_setuppusher(&nickpusher[0], L2, I2, P2, M2)
48 #define lua_setupchanpusher(L2, I2, P2, M2) lua_setuppusher(&chanpusher[0], L2, I2, P2, M2)
50 int lua_cmsg(char *channell
, char *message
, ...) {
55 va_start(va
, message
);
56 vsnprintf(buf
, sizeof(buf
), message
, va
);
59 cp
= findchannel(channell
);
66 lua_channelmessage(cp
, "%s", buf
);
71 static int lua_chanmsg(lua_State
*ps
) {
72 if(!lua_isstring(ps
, 1))
73 LUA_RETURN(ps
, LUA_FAIL
);
75 LUA_RETURN(ps
, lua_cmsg(LUA_PUKECHAN
, "lua: %s", lua_tostring(ps
, 1)));
78 static int lua_ctcp(lua_State
*ps
) {
82 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
83 LUA_RETURN(ps
, LUA_FAIL
);
85 n
= lua_tostring(ps
, 1);
86 msg
= lua_tostring(ps
, 2);
88 np
= getnickbynick(n
);
89 if(!np
|| !lua_lineok(msg
))
90 LUA_RETURN(ps
, LUA_FAIL
);
92 lua_message(np
, "\001%s\001", msg
);
94 LUA_RETURN(ps
, lua_cmsg(LUA_PUKECHAN
, "lua-ctcp: %s (%s)", np
->nick
, msg
));
97 static int lua_noticecmd(lua_State
*ps
) {
101 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
102 LUA_RETURN(ps
, LUA_FAIL
);
104 n
= lua_tostring(ps
, 1);
105 msg
= lua_tostring(ps
, 2);
107 np
= getnickbynick(n
);
108 if(!np
|| !lua_lineok(msg
))
109 LUA_RETURN(ps
, LUA_FAIL
);
111 lua_notice(np
, "%s", msg
);
113 LUA_RETURN(ps
, LUA_OK
);
116 static int lua_kill(lua_State
*ps
) {
120 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
121 LUA_RETURN(ps
, LUA_FAIL
);
123 n
= lua_tostring(ps
, 1);
124 msg
= lua_tostring(ps
, 2);
126 np
= getnickbynick(n
);
128 LUA_RETURN(ps
, LUA_FAIL
);
130 if(IsOper(np
) || IsService(np
) || IsXOper(np
))
131 LUA_RETURN(ps
, LUA_FAIL
);
134 LUA_RETURN(ps
, LUA_FAIL
);
136 killuser(lua_nick
, np
, "%s", msg
);
138 LUA_RETURN(ps
, lua_cmsg(LUA_PUKECHAN
, "lua-KILL: %s (%s)", np
->nick
, msg
));
141 static int lua_kick(lua_State
*ps
) {
142 const char *n
, *msg
, *chan
;
147 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2) || !lua_isstring(ps
, 3))
148 LUA_RETURN(ps
, LUA_FAIL
);
150 chan
= lua_tostring(ps
, 1);
151 n
= lua_tostring(ps
, 2);
152 msg
= lua_tostring(ps
, 3);
154 if(lua_isboolean(ps
, 4) && !lua_toboolean(ps
, 4))
157 np
= getnickbynick(n
);
159 LUA_RETURN(ps
, LUA_FAIL
);
161 if(dochecks
&& (IsOper(np
) || IsXOper(np
) || IsService(np
)))
162 LUA_RETURN(ps
, LUA_FAIL
);
164 cp
= findchannel((char *)chan
);
166 LUA_RETURN(ps
, LUA_FAIL
);
169 LUA_RETURN(ps
, LUA_FAIL
);
171 localkickuser(lua_nick
, cp
, np
, msg
);
173 LUA_RETURN(ps
, LUA_OK
);
176 static int lua_invite(lua_State
*ps
) {
180 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
181 LUA_RETURN(ps
, LUA_FAIL
);
183 np
= getnickbynick((char *)lua_tostring(ps
, 1));
185 LUA_RETURN(ps
, LUA_FAIL
);
187 cp
= findchannel((char *)lua_tostring(ps
, 2));
189 LUA_RETURN(ps
, LUA_FAIL
);
191 localinvite(lua_nick
, cp
, np
);
193 LUA_RETURN(ps
, LUA_OK
);
196 static int lua_gline(lua_State
*ps
) {
200 int duration
, usercount
= 0;
203 if(!lua_isstring(ps
, 1) || !lua_isint(ps
, 2) || !lua_isstring(ps
, 3))
204 LUA_RETURN(ps
, LUA_FAIL
);
206 duration
= lua_toint(ps
, 2);
207 if((duration
< 1) || (duration
> 7 * 86400))
208 LUA_RETURN(ps
, LUA_FAIL
);
210 reason
= lua_tostring(ps
, 3);
211 if(!lua_lineok(reason
) || !reason
)
212 LUA_RETURN(ps
, LUA_FAIL
);
214 target
= getnickbynick(lua_tostring(ps
, 1));
215 if(!target
|| (IsOper(target
) || IsXOper(target
) || IsService(target
)))
216 LUA_RETURN(ps
, LUA_FAIL
);
220 LUA_RETURN(ps
, LUA_FAIL
);
222 usercount
= hp
->clonecount
;
223 if(usercount
> 10) { /* (decent) trusted host */
229 for (j
=0;j
<NICKHASHSIZE
;j
++)
230 for (np
=nicktable
[j
];np
;np
=np
->next
)
231 if (np
&& (np
->host
== hp
) && (!ircd_strcmp(np
->ident
, target
->ident
)))
235 LUA_RETURN(ps
, LUA_FAIL
);
237 snprintf(mask
, sizeof(mask
), "*%s@%s", target
->ident
, IPtostr(target
->ipaddress
));
239 snprintf(mask
, sizeof(mask
), "*@%s", IPtostr(target
->ipaddress
));
242 irc_send("%s GL * +%s %d :%s", mynumeric
->content
, mask
, duration
, reason
);
243 LUA_RETURN(ps
, lua_cmsg(LUA_PUKECHAN
, "lua-GLINE: %s (%d users, %d seconds -- %s)", mask
, usercount
, duration
, reason
));
246 static int lua_getchaninfo(lua_State
*ps
) {
249 if(!lua_isstring(ps
, 1))
252 cp
= findchannel((char *)lua_tostring(ps
, 1));
256 LUA_PUSHCHAN(ps
, cp
);
261 static int lua_opchan(lua_State
*ps
) {
265 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
266 LUA_RETURN(ps
, LUA_FAIL
);
268 cp
= findchannel((char *)lua_tostring(ps
, 1));
270 LUA_RETURN(ps
, LUA_FAIL
);
272 np
= getnickbynick((char *)lua_tostring(ps
, 2));
274 LUA_RETURN(ps
, LUA_FAIL
);
276 localsetmodes(lua_nick
, cp
, np
, MC_OP
);
277 LUA_RETURN(ps
, LUA_OK
);
280 static int lua_deopchan(lua_State
*ps
) {
284 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
285 LUA_RETURN(ps
, LUA_FAIL
);
287 cp
= findchannel((char *)lua_tostring(ps
, 1));
289 LUA_RETURN(ps
, LUA_FAIL
);
291 np
= getnickbynick((char *)lua_tostring(ps
, 2));
293 LUA_RETURN(ps
, LUA_FAIL
);
295 localsetmodes(lua_nick
, cp
, np
, MC_DEOP
);
296 LUA_RETURN(ps
, LUA_OK
);
299 static int lua_voicechan(lua_State
*ps
) {
303 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
304 LUA_RETURN(ps
, LUA_FAIL
);
306 cp
= findchannel((char *)lua_tostring(ps
, 1));
308 LUA_RETURN(ps
, LUA_FAIL
);
310 np
= getnickbynick((char *)lua_tostring(ps
, 2));
312 LUA_RETURN(ps
, LUA_FAIL
);
314 localsetmodes(lua_nick
, cp
, np
, MC_VOICE
);
315 LUA_RETURN(ps
, LUA_OK
);
318 static int lua_counthost(lua_State
*ps
) {
322 if(!lua_islong(ps
, 1))
325 numeric
= lua_tolong(ps
, 1);
327 np
= getnickbynumeric(numeric
);
331 lua_pushint(ps
, np
->host
->clonecount
);
335 static int lua_versioninfo(lua_State
*ps
) {
336 lua_pushstring(ps
, LUA_VERSION
);
337 lua_pushstring(ps
, LUA_BOTVERSION
);
338 lua_pushstring(ps
, __DATE__
);
339 lua_pushstring(ps
, __TIME__
);
341 lua_pushstring(ps
, LUA_AUXVERSION
);
346 static int lua_basepath(lua_State
*ps
) {
347 lua_pushfstring(ps
, "%s/", cpath
->content
);
353 static int lua_getuserbyauth(lua_State
*l
) {
358 if(!lua_isstring(l
, 1))
361 acc
= lua_tostring(l
, 1);
363 for(i
=0;i
<NICKHASHSIZE
;i
++) {
364 for(np
=nicktable
[i
];np
;np
=np
->next
) {
365 if(np
&& np
->authname
&& !ircd_strcmp(np
->authname
, acc
)) {
375 static int lua_getnickchans(lua_State
*l
) {
380 if(!lua_islong(l
, 1))
383 np
= getnickbynumeric(lua_tolong(l
, 1));
387 channels
= (channel
**)np
->channels
->content
;
388 for(i
=0;i
<np
->channels
->cursi
;i
++)
389 lua_pushstring(l
, channels
[i
]->index
->name
->content
);
391 return np
->channels
->cursi
;
394 static int lua_getnickchanindex(lua_State
*l
) {
398 if(!lua_islong(l
, 1) || !lua_isint(l
, 2))
401 np
= getnickbynumeric(lua_tolong(l
, 1));
405 offset
= lua_toint(l
, 2);
406 if((offset
< 0) || (offset
>= np
->channels
->cursi
))
409 lua_pushstring(l
, ((channel
**)np
->channels
->content
)[offset
]->index
->name
->content
);
417 struct lua_pusher
*nickhashpusher
[MAX_PUSHER
];
419 static int lua_getnextnick(lua_State
*l
) {
420 if(!lasthashnick
&& (hashindex
!= -1))
426 if(hashindex
>= NICKHASHSIZE
)
428 lasthashnick
= nicktable
[hashindex
];
430 lasthashnick
= lasthashnick
->next
;
432 } while(!lasthashnick
);
434 return lua_usepusher(l
, nickhashpusher
, lasthashnick
);
437 static int lua_getfirstnick(lua_State
*l
) {
441 lua_setupnickpusher(l
, 1, nickhashpusher
, MAX_PUSHER
);
443 return lua_getnextnick(l
);
447 chanindex
*lasthashchan
;
449 struct lua_pusher
*chanhashpusher
[MAX_PUSHER
];
451 static int lua_getnextchan(lua_State
*l
) {
452 if(!lasthashchan
&& (chanhashindex
!= -1))
458 if(chanhashindex
>= CHANNELHASHSIZE
)
460 lasthashchan
= chantable
[chanhashindex
];
462 lasthashchan
= lasthashchan
->next
;
464 } while(!lasthashchan
|| !lasthashchan
->channel
);
466 return lua_usepusher(l
, chanhashpusher
, lasthashchan
);
469 static int lua_getfirstchan(lua_State
*l
) {
473 lua_setupchanpusher(l
, 1, chanhashpusher
, MAX_PUSHER
);
475 return lua_getnextchan(l
);
478 static int lua_getnickchancount(lua_State
*l
) {
481 if(!lua_islong(l
, 1))
484 np
= getnickbynumeric(lua_tolong(l
, 1));
488 lua_pushint(l
, np
->channels
->cursi
);
493 static int lua_gethostusers(lua_State
*l
) {
497 if(!lua_islong(l
, 1))
500 np
= getnickbynumeric(lua_tolong(l
, 1));
501 if(!np
|| !np
->host
|| !np
->host
->nicks
)
504 np
= np
->host
->nicks
;
505 count
= np
->host
->clonecount
;
515 static int lua_getnickcountry(lua_State
*l
) {
519 ext
= findnickext("geoip");
523 if(!lua_islong(l
, 1))
526 np
= getnickbynumeric(lua_tolong(l
, 1));
530 lua_pushint(l
, (int)np
->exts
[ext
]);
534 static int lua_chanfix(lua_State
*ps
) {
538 if(!lua_isstring(ps
, 1))
539 LUA_RETURN(ps
, LUA_FAIL
);
541 cp
= findchannel((char *)lua_tostring(ps
, 1));
543 LUA_RETURN(ps
, LUA_FAIL
);
545 np
= getnickbynick(LUA_CHANFIXBOT
);
547 LUA_RETURN(ps
, LUA_FAIL
);
549 lua_message(np
, "chanfix %s", cp
->index
->name
->content
);
551 LUA_RETURN(ps
, LUA_OK
);
554 static int lua_clearmode(lua_State
*ps
) {
561 if(!lua_isstring(ps
, 1))
562 LUA_RETURN(ps
, LUA_FAIL
);
564 cp
= findchannel((char *)lua_tostring(ps
, 1));
566 LUA_RETURN(ps
, LUA_FAIL
);
568 localsetmodeinit(&changes
, cp
, lua_nick
);
570 localdosetmode_key(&changes
, NULL
, MCB_DEL
);
571 localdosetmode_simple(&changes
, 0, CHANMODE_INVITEONLY
| CHANMODE_LIMIT
);
574 localdosetmode_ban(&changes
, bantostring(cp
->bans
), MCB_DEL
);
576 for(i
=0,lp
=cp
->users
->content
;i
<cp
->users
->hashsize
;i
++,lp
++)
577 if((*lp
!= nouser
) && (*lp
& CUMODE_OP
)) {
578 np
= getnickbynumeric(*lp
);
579 if(np
&& !IsService(np
))
580 localdosetmode_nick(&changes
, np
, MC_DEOP
);
583 localsetmodeflush(&changes
, 1);
585 LUA_RETURN(ps
, LUA_OK
);
588 static int lua_ban(lua_State
*ps
) {
594 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
595 LUA_RETURN(ps
, LUA_FAIL
);
597 if(lua_isboolean(ps
, 3) && lua_toboolean(ps
, 3))
600 cp
= findchannel((char *)lua_tostring(ps
, 1));
602 LUA_RETURN(ps
, LUA_FAIL
);
604 mask
= lua_tostring(ps
, 2);
605 if(!mask
|| !mask
[0] || !lua_lineok(mask
))
606 LUA_RETURN(ps
, LUA_FAIL
);
608 localsetmodeinit(&changes
, cp
, lua_nick
);
609 localdosetmode_ban(&changes
, mask
, dir
);
610 localsetmodeflush(&changes
, 1);
612 LUA_RETURN(ps
, LUA_OK
);
615 static int lua_topic(lua_State
*ps
) {
619 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
620 LUA_RETURN(ps
, LUA_FAIL
);
622 cp
= findchannel((char *)lua_tostring(ps
, 1));
624 LUA_RETURN(ps
, LUA_FAIL
);
626 topic
= (char *)lua_tostring(ps
, 2);
627 if(!topic
|| !lua_lineok(topic
))
628 LUA_RETURN(ps
, LUA_FAIL
);
630 localsettopic(lua_nick
, cp
, topic
);
632 LUA_RETURN(ps
, LUA_OK
);
635 static int lua_getuserchanmodes(lua_State
*l
) {
640 if(!lua_islong(l
, 1) || !lua_isstring(l
, 2))
643 np
= getnickbynumeric(lua_tolong(l
, 1));
647 cp
= findchannel((char *)lua_tostring(l
, 2));
651 lp
= getnumerichandlefromchanhash(cp
->users
, np
->numeric
);
655 LUA_PUSHNICKCHANMODES(l
, lp
);
659 static int lua_getnickbynick(lua_State
*l
) {
662 if(!lua_isstring(l
, 1))
665 np
= getnickbynick(lua_tostring(l
, 1));
673 static int lua_getnickbynumeric(lua_State
*l
) {
676 if(!lua_islong(l
, 1))
679 np
= getnickbynumeric(lua_tolong(l
, 1));
687 void lua_registercommands(lua_State
*l
) {
688 lua_register(l
, "irc_smsg", lua_smsg
);
689 lua_register(l
, "irc_skill", lua_skill
);
691 lua_register(l
, "chanmsg", lua_chanmsg
);
692 lua_register(l
, "versioninfo", lua_versioninfo
);
693 lua_register(l
, "basepath", lua_basepath
);
695 lua_register(l
, "irc_report", lua_chanmsg
);
696 lua_register(l
, "irc_ctcp", lua_ctcp
);
697 lua_register(l
, "irc_kill", lua_kill
);
698 lua_register(l
, "irc_kick", lua_kick
);
699 lua_register(l
, "irc_invite", lua_invite
);
700 lua_register(l
, "irc_gline", lua_gline
);
701 lua_register(l
, "irc_getchaninfo", lua_getchaninfo
);
702 lua_register(l
, "irc_counthost", lua_counthost
);
703 lua_register(l
, "irc_getuserbyauth", lua_getuserbyauth
);
704 lua_register(l
, "irc_notice", lua_noticecmd
);
705 lua_register(l
, "irc_opchan", lua_opchan
);
706 lua_register(l
, "irc_voicechan", lua_voicechan
);
707 lua_register(l
, "irc_chanfix", lua_chanfix
);
708 lua_register(l
, "irc_clearmode", lua_clearmode
);
709 lua_register(l
, "irc_ban", lua_ban
);
710 lua_register(l
, "irc_deopchan", lua_deopchan
);
711 lua_register(l
, "irc_topic", lua_topic
);
713 lua_register(l
, "irc_getnickbynick", lua_getnickbynick
);
714 lua_register(l
, "irc_getnickbynumeric", lua_getnickbynumeric
);
715 lua_register(l
, "irc_getfirstnick", lua_getfirstnick
);
716 lua_register(l
, "irc_getnextnick", lua_getnextnick
);
718 lua_register(l
, "irc_getnickchans", lua_getnickchans
);
719 lua_register(l
, "irc_getnickchanindex", lua_getnickchanindex
);
720 lua_register(l
, "irc_getnickchancount", lua_getnickchancount
);
722 lua_register(l
, "irc_getuserchanmodes", lua_getuserchanmodes
);
725 lua_register(l
, "irc_gethostusers", lua_gethostusers
);
726 lua_register(l
, "irc_getnickcountry", lua_getnickcountry
);
728 lua_register(l
, "irc_getfirstchan", lua_getfirstchan
);
729 lua_register(l
, "irc_getnextchan", lua_getnextchan
);
734 static int lua_smsg(lua_State
*ps
) {
735 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
736 LUA_RETURN(ps
, LUA_FAIL
);
738 LUA_RETURN(ps
, lua_cmsg((char *)lua_tostring(ps
, 2), "%s", lua_tostring(ps
, 1)));
741 static int lua_skill(lua_State
*ps
) {
745 if(!lua_isstring(ps
, 1) || !lua_isstring(ps
, 2))
746 LUA_RETURN(ps
, LUA_FAIL
);
748 n
= lua_tostring(ps
, 1);
749 msg
= lua_tostring(ps
, 2);
751 np
= getnickbynick(n
);
753 LUA_RETURN(ps
, LUA_FAIL
);
755 if(IsOper(np
) || IsService(np
) || IsXOper(np
))
756 LUA_RETURN(ps
, LUA_FAIL
);
759 LUA_RETURN(ps
, LUA_FAIL
);
761 killuser(lua_nick
, np
, "%s", msg
);
763 LUA_RETURN(ps
, LUA_OK
);
766 #define PUSHER_STRING 1
767 #define PUSHER_REALNAME 2
769 #define PUSHER_LONG 4
770 #define PUSHER_HOSTNAME 5
771 #define PUSHER_SSTRING 6
772 #define PUSHER_TOTALUSERS 7
773 #define PUSHER_TOPIC 8
775 void lua_initnickpusher(void) {
778 #define PUSH_NICKPUSHER(F2, O2) nickpusher[i].argtype = F2; nickpusher[i].structname = #O2; nickpusher[i].offset = offsetof(nick, O2); i++;
780 PUSH_NICKPUSHER(PUSHER_STRING
, nick
);
781 PUSH_NICKPUSHER(PUSHER_STRING
, ident
);
782 PUSH_NICKPUSHER(PUSHER_HOSTNAME
, host
);
783 PUSH_NICKPUSHER(PUSHER_REALNAME
, realname
);
784 PUSH_NICKPUSHER(PUSHER_STRING
, authname
);
785 PUSH_NICKPUSHER(PUSHER_IP
, ipaddress
);
786 PUSH_NICKPUSHER(PUSHER_LONG
, numeric
);
788 nickpusher
[i
].argtype
= 0;
791 void lua_setuppusher(struct lua_pusher
*pusherlist
, lua_State
*l
, int index
, struct lua_pusher
**lp
, int max
) {
793 struct lua_pusher
*f
;
798 if(!lua_istable(l
, -1) || (max
< 2))
805 while (lua_next(l
, index
)) {
806 if(lua_isstring(l
, -1)) {
807 char *name
= (char *)lua_tostring(l
, -1);
809 for(f
=pusherlist
;f
->argtype
;f
++)
810 if(!strcmp(f
->structname
, name
))
826 INLINE
int lua_usepusher(lua_State
*l
, struct lua_pusher
**lp
, void *np
) {
830 void *offset
= (void *)np
+ (*lp
)->offset
;
832 switch((*lp
)->argtype
) {
834 lua_pushstring(l
, (char *)offset
);
836 case PUSHER_HOSTNAME
:
837 lua_pushstring(l
, (*(host
**)offset
)->name
->content
);
839 case PUSHER_REALNAME
:
840 lua_pushstring(l
, (*(realname
**)offset
)->name
->content
);
843 lua_pushstring(l
, (*((sstring
**)offset
))->content
);
846 lua_pushlong(l
, *((long *)offset
));
849 lua_pushstring(l
, IPtostr(*((long *)offset
)));
851 case PUSHER_TOTALUSERS
:
852 lua_pushint(l
, (*((channel
**)offset
))->users
->totalusers
);
855 if((*((channel
**)offset
))->topic
) {
856 lua_pushstring(l
, (*((channel
**)offset
))->topic
->content
);
870 void lua_initchanpusher(void) {
873 #define PUSH_CHANPUSHER(F2, O2, N2) chanpusher[i].argtype = F2; chanpusher[i].structname = N2; chanpusher[i].offset = offsetof(chanindex, O2); i++;
875 PUSH_CHANPUSHER(PUSHER_SSTRING
, name
, "name");
876 PUSH_CHANPUSHER(PUSHER_TOTALUSERS
, channel
, "totalusers");
877 PUSH_CHANPUSHER(PUSHER_TOPIC
, channel
, "topic");
879 chanpusher
[i
].argtype
= 0;