]>
jfr.im git - irc/quakenet/newserv.git/blob - glines/glines_util.c
1 #include "../irc/irc.h"
4 int glinebyip(const char *user
, struct irc_in_addr
*ip
, unsigned char bits
, int duration
, const char *reason
, int flags
, const char *creator
) {
8 glinebufinit(&gbuf
, 1);
9 glinebufaddbyip(&gbuf
, user
, ip
, bits
, flags
, creator
, reason
, getnettime() + duration
, getnettime(), getnettime() + duration
);
11 glinebufcounthits(&gbuf
, &hits
, NULL
);
13 if (flags
& GLINE_SIMULATE
)
14 glinebufabandon(&gbuf
);
16 glinebufflush(&gbuf
, 1);
21 int glinebynick(nick
*np
, int duration
, const char *reason
, int flags
, const char *creator
) {
25 glinebufinit(&gbuf
, 1);
26 glinebufaddbynick(&gbuf
, np
, flags
, creator
, reason
, getnettime() + duration
, getnettime(), getnettime() + duration
);
28 glinebufcounthits(&gbuf
, &hits
, NULL
);
30 if (flags
& GLINE_SIMULATE
)
31 glinebufabandon(&gbuf
);
33 glinebufflush(&gbuf
, 1);