]> jfr.im git - irc/quakenet/newserv.git/blame - glines/glines_util.c
Add missing "Done." reply.
[irc/quakenet/newserv.git] / glines / glines_util.c
CommitLineData
c60d02ed
GB
1#include "../irc/irc.h"
2#include "glines.h"
3
dd1aa3fb 4int glinebyip(const char *user, struct irc_in_addr *ip, unsigned char bits, int duration, const char *reason, int flags, const char *creator) {
c60d02ed
GB
5 glinebuf gbuf;
6 int hits;
7
8 glinebufinit(&gbuf, 1);
9 glinebufaddbyip(&gbuf, user, ip, bits, flags, creator, reason, getnettime() + duration, getnettime(), getnettime() + duration);
10
11 glinebufcounthits(&gbuf, &hits, NULL);
12
13 if (flags & GLINE_SIMULATE)
14 glinebufabandon(&gbuf);
15 else
16 glinebufflush(&gbuf, 1);
17
18 return hits;
19}
20
dd1aa3fb 21int glinebynick(nick *np, int duration, const char *reason, int flags, const char *creator) {
c60d02ed
GB
22 glinebuf gbuf;
23 int hits;
24
25 glinebufinit(&gbuf, 1);
26 glinebufaddbynick(&gbuf, np, flags, creator, reason, getnettime() + duration, getnettime(), getnettime() + duration);
27
28 glinebufcounthits(&gbuf, &hits, NULL);
29
30 if (flags & GLINE_SIMULATE)
31 glinebufabandon(&gbuf);
32 else
33 glinebufflush(&gbuf, 1);
34
35 return hits;
36}
37