Needed to bump it to 16 anyway (the RFC says 15 plus the protocol command itself, so 16), but EPIC5 bumped it
up to 20 based on a report from users of RusNet so we might as well go up to that as well.
Change remove_all_dcc_binds() so that it only removes DCC binds for the module supplied, as it's supposed to.
get_dcc_type() should ignore the first entry in dcc_types[] ("<none>") otherwise the client will try to
respond to DCC requests with that name.
Explicitly track the number of entries in the dcc_types[] array rather than using a NULL terminator. This
allows us to change dcc_types[] to use NULL entries to mark unused slots in the array, rather than pointers
to entries with a NULL .name element. Together, this means that the dcc_types[] array is only resized when it
actually needs to be grown and removal works correctly (without eg. prematurely marking the end of the array).
Make add_dcc_bind() fail if the requested DCC type has already been bound by a module (this still allows one
module at a time to rebind a built-in DCC type). Previously the behaviour was ill-defined in this case.
The idea here is that if you have a module which implements a new DCC type that is essentially
a lightly-modified version of CHAT or SEND you can reuse these functions.
This function gets the status of a single umode flag identified by umode char rather than
internal server flag number.
This also lets us remove all the USER_MODE* constants because they're no longer required.
Invert the sense of the +w check in e_wall() - we only echo our OPERWALL if we're *not* +w,
because if we are +w then the server will echo it back to us anyway.
The idea here is not to expose the internal server implementation for storing umodes,
but instead have callers just work in terms of umode characters.
The 'possible umodes' have always been the same for all servers anyway. We just assume
that [a-zA-Z] is the bounding set.
server.ctx is now allocated once for each server on first connection, then reused for subsequent connections.
server.ctx wasn't being cleared when the server was closed (as server.ssl_fd is), so this was causing
reconnection to fail until try_connect() got called.
This also removes the last uses of the CHK_* macros in ssl.h, so remove them.
It is only called in one place, where from_server is already set to the same as the argument.
Rename rebuild_all_ison() to rebuild_notify_ison_all().
Make rebuild_notify_ison() and rebuild_notify_ison_all() static, they are only called from
this file.
Remove the 'how' parameter to rsindex(), making it reverse-search for only the first matching character,
as sindex() already does. There are only two callers, and one already passed a hardcoded value of 1.
Also change rsindex() so that it starts searching at the character BEFORE the passed in position. This
makes it easier to repeatedly call rsindex() in a loop to search for the Nth matching character, and
also fixes a technical instance of undefined behaviour where a pointer is decremented to point before
the start of the string.
Remove the 'mark' parameter to strsearch(). Instead, always forward-search from the beginning of the
string and reverse-search from the end of the string, as this is what the two callers want anyway.
Bump the module ABI version because these functions are exported to modules.
inv_strpbrk() is the inverse of the standard function strpbrk().
Calls to sindex() where both strings are not NULL and the second string begins with ^ are equivalent
to calls to inv_strpbrk() (but without the ^). Convert those calls.
The old code could move the variable 'pointer' backwards one character before the start
of the string (then incremented it again before returning). Formally this is undefined
behaviour, so fix it.
The removed variables are:
dll_functions
dll_numeric
dll_commands
dll_variable
dll_ctcp
dll_window
These are not actually directly used by any modules, and hiding them allows us to more easily
change their implementation later.
This helper function is for modules to save the contents of their module variables to a file
as SET commands.
It will remove the need to export the raw dll_variable list to modules.
A fractional-second timeout was already supported for the initial timeout of a /TIMER, but
if the timer was recurring then the interval was rounded to a whole number of seconds for
the subsequent timeouts.
Change the type of interval from long to double to fix this.
These globals were used to store the original terminal dimesions from the terminal database (or
in the case of reattaching, supplied by scr-bx) to be applied if the current terminal dimensions
could not be determined.
Instead, we leave the original terminal dimensions in current_term->TI_lines and current_term->TI_cols,
and create current_term->li and current_term->co to store the current terminal dimensions (as eg.
supplied by scr-bx).
With this change, the signal handler signature is defined in only one place.
Also make most signal handler functions static (those that are only referred to in irc.c).
CLOSING_SERVER was never referenced outside of server.h where it's defined, and CLOSE_PENDING was cleared
but never set by any code.
Rename LOGGED_IN to namespace it (in anticipation of other flag variables in the server struct being
consolidated into a set of server flags).
Also put correct parantheses around the definition of SF_LOGGED_IN.
The guts of this function doesn't need to be in server.c - it only uses extern server functions so it
makes sense just to move it into the body of function_servers(), the only caller.
That means it's no longer accessible for loadable modules, but it isn't much use for them anyway. They
can always directly access the server list if they need that info.
(Requires rolling the module table version).
Remove the 'resend_only' flag option to fudge_nickname(). The only caller passing it was the CHANGE_NICK_ON_KILL
feature, and in that case it was the wrong thing too (and stopped that function from working at all).
Some other minor cleanups in fudge_nickname() while we're there.
This uses another bit in the existing flags argument in place of the command argument, and avoids
having to re-compare against fixed strings ("PRIVMSG", "NOTICE").
This allows building against recent libtcl versions.
A fallback definition of Tcl_GetStringResult() is included so that building against libtcl 7 still works.