Bram Matthys
cf29aa8feb
Replace various 90% identical functions with some macro's instead.
2019-06-22 17:29:03 +02:00
Bram Matthys
19af2c6b5c
Fix return value in can_send() and add tracing for modules that don't behave.
2019-06-22 17:21:57 +02:00
Bram Matthys
05202dd2a4
Move can_send() function from core to m_message.
2019-06-22 16:03:06 +02:00
Bram Matthys
bf4d96e991
can_send() now returns 0 (false) or 1 (true), rather than magic values.
...
Also, the HOOKTYPE_CAN_SEND prototype changed so you can communicate
the error message in a flexible way, similar to what I just did
with extbans.
2019-06-22 15:57:32 +02:00
Bram Matthys
f08557f2fd
Propagate is_banned() errmsg to m_message layer.
2019-06-22 15:36:21 +02:00
Bram Matthys
7fd794c563
Make /VERSION send 005 properly.
2019-06-22 15:16:16 +02:00
Bram Matthys
be49ef0bb8
More extban API changes... fun...
2019-06-22 15:11:16 +02:00
Bram Matthys
383f54a6c9
Fix bug caused last few weeks where user would receive a privmsg with
...
a SID/UID rather than server-/nickname.
2019-06-22 14:21:07 +02:00
Bram Matthys
086d370704
Change extban API: pass 'msg' in BANCHK_MSG and (new) BANCHK_LEAVE_MSG.
2019-06-17 20:19:34 +02:00
Bram Matthys
1cfebcf05e
Add new set::part_instead_of_quit_on_comment_change to convert QUIT to PART
...
in case of a change in the quit comment, such as color stripping / blocking.
The default is 'no', but some users may like this to be 'yes' so things like
+S only affect the channel and not the quit for all channels.
This hereby also lays the groundwork for some next commits of 'i' :)
The configuration item name may still change if I think of a better one....
2019-06-17 08:20:42 +02:00
Bram Matthys
b8cdb21754
Fix crash on "TKL" command without parameters. Due to rewrites from yesterday.
2019-06-17 07:46:32 +02:00
Bram Matthys
1d046b6f61
Move ban [nick|user|ip] { } block parsing to m_tkl.
2019-06-16 09:33:30 +02:00
Bram Matthys
d106609d89
Move all spamfilter { } block parsing to m_tkl.
2019-06-16 09:21:39 +02:00
Bram Matthys
36808a60ac
Remove all tk->flags & TKL_FLAG_CONFIG entries on rehash.
...
Make local spamfilter blocks use this too. Already did so for
ban xxx types that will cause kline/gline/zline and qline.
This also simplifies handling in the tkldb module.
2019-06-16 09:09:09 +02:00
Bram Matthys
d0d454f696
Fix 100% CPU loop problem on REHASH due to bug in history backend (deja-vu).
2019-06-16 08:44:57 +02:00
Bram Matthys
bd785a9309
Some initial work for the upcoming TKL 'e'/'E'/TKL_EXCEPT type.
2019-06-16 08:42:41 +02:00
Bram Matthys
18ae7b8925
Document *ALL* functions in m_tkl and remove efuncs that are no longer
...
needed: tkl_expire and tkl_check_expire, which are now self-contained
in the m_tkl module.
2019-06-16 08:35:56 +02:00
Bram Matthys
b102e79f8e
Use check_banned() from s_bsd too, less duplicate code.
2019-06-15 18:44:33 +02:00
Bram Matthys
24726d533d
Make the require authentication { } block use the TKL layer.
...
Remove CONF_BAN_UNAUTHENTICATED.
2019-06-15 18:31:06 +02:00
Bram Matthys
8c2ce9a7d5
[tkldb] skip if (tkl->flags & TKL_FLAG_CONFIG)
2019-06-15 18:27:43 +02:00
Bram Matthys
8e6302d003
Rip out CONF_BAN_NICK, CONF_BAN_IP, CONF_BAN_USER, now that they are moved
...
to the TKL layer.
2019-06-15 18:18:19 +02:00
Bram Matthys
97fc19591c
Add support for tkline->flag TKL_FLAG_CONFIG: item from configuration
...
file that cannot be deleted via commands such as /KLINE -...
And transform some ban XX entries to use the TKL system
TODO: test & rip out the old stuff
2019-06-15 18:08:43 +02:00
Bram Matthys
a40cd9fae4
Rename dospamfilter() to run_spamfilter(), which is more meaningful.
2019-06-15 17:43:34 +02:00
Bram Matthys
630ab8f869
Fix some indentation
2019-06-15 17:37:02 +02:00
Bram Matthys
060502aedd
Remove unused variables and some shadow...
2019-06-15 17:27:54 +02:00
Bram Matthys
4f4cda7f7d
Cleanup part 2 of m_tkl. Splitting up in m_tkl_add / m_tkl_del and
...
various whitespace / indenting fixes.
2019-06-15 17:18:48 +02:00
Bram Matthys
876fda63ec
Export tkl_type_string via efuncs (actually, the name may change...)
2019-06-15 17:06:41 +02:00
Bram Matthys
7542cdeaca
Cleanup of m_tkl part 1. New tkl_chartotype (the reverse of tkl_typetochar).
...
Move stripcrlf() to core instead of at 3 places, rename calls of iCstrip()
to that. Hopefully I didn't break anything.. :D
2019-06-15 16:56:34 +02:00
Bram Matthys
41ba282ed6
Obey MAXMODEPARA under all circumstances.
2019-06-15 15:17:24 +02:00
Bram Matthys
ca9b04a0fa
Module API: EventAddEx() -> EventAdd()
2019-06-12 19:09:33 +02:00
Bram Matthys
e3013ae067
Commit current work of history API and channel history mode (+H count:time)
...
Note: there are still some TODO items
2019-06-12 18:59:12 +02:00
GottemHams
bb4bd4dffc
[tkldb] Forgot a check for local Q-Lines, also bail early when reading local spamfilters/Q-Lines
2019-06-11 15:54:53 +02:00
Bram Matthys
fce0253b5a
Remove unused FLAGS_CHKACCESS / SetAccess / ClearAccess.
...
Also, DoAccess() was already commented out in UnrealIRCd 4 or something.
This results in an empty finish_auth() function but that should be OK,
as ident checking takes place before parsing any other input IIRC.
2019-06-10 18:39:03 +02:00
Bram Matthys
e5e260eaa1
Remove FLAGS_NONL / NoNewLine(), which isn't used since 4.0.0 or so.
...
And add a FIXME, or at least a TODO-investigate-this item ;)
2019-06-10 18:33:46 +02:00
Bram Matthys
ac19f91eb8
Turns out it's not that easy.. ;)
2019-06-08 16:49:46 +02:00
Bram Matthys
573a601127
Nothing important, just a silly m_dummy :D
2019-06-08 14:37:22 +02:00
Bram Matthys
12dbbca15e
Rip out support for changing offsets via TSCTL and tune file. Use NTP!!
...
Adjustments via TSCTL are never accurate enough.
2019-06-08 09:26:55 +02:00
Bram Matthys
3749f8d674
Remove timesync support. Use your OS time synchronization instead!
...
Timesync was previously disabled by default in March 2018.
2019-06-08 09:11:46 +02:00
Bram Matthys
d796247ddf
Re-indent
2019-06-07 15:08:23 +02:00
Bram Matthys
a2ee5d67f3
Update a few hooks to include mtags, more will follow later.
...
This fixes inconsistent mtags accross server links with delayjoin.
2019-06-07 15:05:10 +02:00
Bram Matthys
1f2bb0d89b
Delayjoin: if kicking invisible user we used to clear the invisibility
...
status of the victim (JOIN+KICK). That seems unnecessary to me, since
there is already code in place to handle this -- hopefully it works too.
2019-06-07 14:41:01 +02:00
Bram Matthys
61b4a6ea29
Add mtags in non-chan PRIVMSG. Remove sendto_message_one since you can
...
just use sendto_prefix_one. Actually it was only used at 1 place (m_message).
2019-06-07 14:25:28 +02:00
Bram Matthys
0e68265e12
Remove sock.h old compatibility code. Shouldn't be needed anymore.
...
(This provided FD_ZERO and such if the OS/libc did not provide it)
2019-06-07 12:42:28 +02:00
Bram Matthys
de89de9558
Fix MODE not sending message tags across servers
2019-06-07 12:34:22 +02:00
GottemHams
d292d2ee9c
Forgot to change a couple X:Line things to X-Line
2019-06-05 19:27:00 +02:00
GottemHams
8846506292
Might be a good idea to also skip local Q:Lines (ban nick {} blocks) :D
2019-06-05 19:19:03 +02:00
Bram Matthys
e423f69082
[tkldb] Add some extra check for trailing DB data.
...
If everything goes correctly then after reading all TKL entries we
should be at the end of file. If there is still data after that,
something went wrong... quite wrong.. :D
2019-06-05 09:39:59 +02:00
Bram Matthys
673779eab9
Write string lengths as 16-bit rather than 64-bit: saves about 34% space
...
of the database file, with possible some small speed improvement as well.
2019-06-05 09:35:43 +02:00
Bram Matthys
ec5811dc3b
[tkldb] Save every 5 minutes now that writing is fast enough :)
...
And mention the benchmark figures in the .c file.
2019-06-05 09:01:04 +02:00
Bram Matthys
eaa1b213b9
[tkldb] Use buffered I/O. Writing the DB is now 29 times faster.
...
Saving 100k zlines now takes 72ms instead of 2100ms
Loading 100k zlines now takes 510ms instead of 1300ms
2019-06-05 08:53:30 +02:00