]>
jfr.im git - irc/quakenet/newserv.git/blob - rannounce/rannounce.c
2 #include "../nick/nick.h"
3 #include "../localuser/localuserchannel.h"
7 void rannouncehandler(nick
*me
, int type
, void **args
);
11 rannouncenick
=registerlocaluser("R","relay","quakenet.org","Relay announcer",NULL
,0,rannouncehandler
);
13 if ((cp
=findchannel("#twilightzone"))) {
14 localjoinchannel(rannouncenick
, cp
);
16 localcreatechannel(rannouncenick
, "#twilightzone");
19 if ((cp
=findchannel("#qnet.queue"))) {
20 localjoinchannel(rannouncenick
, cp
);
22 localcreatechannel(rannouncenick
, "#qnet.queue");
25 if ((cp
=findchannel("#qrequest"))) {
26 localjoinchannel(rannouncenick
, cp
);
28 localcreatechannel(rannouncenick
, "#qrequest");
33 deregisterlocaluser(rannouncenick
,NULL
);
36 void rannouncehandler(nick
*me
, int type
, void **args
) {
42 if (type
==LU_PRIVMSG
) {
46 if (IsOper(np
) && !ircd_strncmp(text
,"announce ",9)) {
48 items
=strtoul(text
,NULL
,10);
51 if ((cp
=findchannel("#twilightzone"))) {
52 sendmessagetochannel(me
, cp
, "%d item%s in queue - https://www.quakenet.org/secure/queue/",items
,items
==1?"":"s");
54 if ((cp
=findchannel("#qnet.queue"))) {
55 sendmessagetochannel(me
, cp
, "%d item%s in queue - https://www.quakenet.org/secure/queue/",items
,items
==1?"":"s");
57 if ((cp
=findchannel("#qrequest"))) {
58 sendmessagetochannel(me
, cp
, "%d item%s in queue",items
,items
==1?"":"s");
62 } else if (type
==LU_KILLED
) {