Previously you could unset CMDCHARS and the effect would be to treat it like it was set to DEFAULT_CMDCHARS,
except that some code was missing the fallback (eg. ignore_last_nick()) which would make it crash.
Instead of having the fallback everywhere, just make it so that you can't unset the variable - if you try, it
sets it to DEFAULT_CMDCHARS. This reflects what the behaviour has always been, it just makes it explicit to
the user and the bonus is we don't have the test it for NULL everywhere.
glob_commands() would run off the end of the irc_command array if given a match that matched
the last command. It also leaked memory because it used m_s3cat() to construct the string,
then passed that to m_strdup().
This fixes these problems by reworking glob_commands(), and at the same time removes the use
of alloca() and wild_match() by using strncmp() instead to match the start of a string. Move
glob_commands() to alias.c and make it static since it's only used for aliasctl().
Change the 'name' argument of find_command() and find_dll_command() to const char * at the same
time, so that glob_commands()'s prefix argument can be const char * too.
The 'channels' argument was unnecessary because the channel list passed to it would
always be from get_server_channels(server) anyway.
Changing the message argument from a protocol message format string to a plain payload
string for PRIVMSG means printf-escaping of the argument is avoided in the caller.
This simplifies the callers and means we can remove the last use of quote_it().
This change also switches set_server_away() to use send_msg_to_channels() instead of
open-coding the equivalent, which simplifies that function a lot.
We are changing the signature of a function exported to modules here; however none
of the in-tree modules use this function so it should be OK.
The RELSN format already existed but wasn't used - instead it used SEND_NOTICE. The other relay
types already used similar formats for their relayed messages.
The default /FSET RELSN looks just like the default /FSET SEND_NOTICE so this shouldn't be
noticeable to anyone using the defaults.
This required updating the NOTICE-sending code to correctly stash the 'to' in the right place.
Some systems need <sys/sockio.h> for the SIOCGIFCONF ioctl - this switches
to using a proper configure check for that header rather than just assuming
it'll be there if we can't find SIOCGIFCONF. Should be more robust.
This also fixes a few others - eg /KBI now kicks-then-bans, and
/BKI bans-then-kicks (previously these were the wrong way around).
Reported by profiler.
close_server() should call clear_server_queues() on the server that's being
closed, not from_server. This also lets us remove a few other calls to
clear_server_queues() that are right next to calls to close_server().
get_reason() is then used only for the implementation of get_kick_reason()
and for the $getreason() scripting function. Add current nick as an
explicit argument for get_reason(), which pushes all use of from_server
out of the ransom reason functions.
Also switch a few instances of send_to_server() to my_send_to_server() where
the current server has been returned by prepare_command().
Previously only send_kill() used BitchX.kill - the other KILL commands (eg.
/WHOKILL) were using the random kick reasons. Standardise them all on
BitchX.kill, and add this file to the source so it can be installed along
with the other random reason files.
Adding these in preparation for converting server->connect_time from time_t
to struct timeval. Also converts three existing open-coded versions over to
the new functions.
send_2comm() always sends the command on to the server, so it always requires a server connection.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@526 13b04d17-f746-0410-82c6-800466cd88b0
send_comm() just passes the command directly to the connected server, so it obviously
requires a server connection.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@525 13b04d17-f746-0410-82c6-800466cd88b0
They're pretty widely used these days, and the cost is trivial. And quite frankly,
the less #ifdefs I have to see, the better.
This covers /NICKSERV, /CHANSERV, /OPERSERV and /MEMOSERV. It also brings
in the bahamut / unreal /SILENCE server-side-ignore command, and unreal's /HELPOP.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@524 13b04d17-f746-0410-82c6-800466cd88b0
Remove unused function declaration, add SERVERREQ flag to CHANSERV command and remove IRCIIHELP
command that no server has provided in a long time, as far as I can tell.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@523 13b04d17-f746-0410-82c6-800466cd88b0
Kill commented out code that normally prevents some commands from
being quoted.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@490 13b04d17-f746-0410-82c6-800466cd88b0
that don't provide the POSIX setenv().
This fixes building plugins that link to compat.c on OS X (shared libraries on
OS X don't have direct access to environ). It also reduces the binary size on
platforms which provide setenv(), which these days is most of them.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@382 13b04d17-f746-0410-82c6-800466cd88b0
Clean up e_topic(), splitting out untopic() and using prepare_command()
to check for ops.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@136 13b04d17-f746-0410-82c6-800466cd88b0
recieved; last_ctcp_reply is the last reply recieved (used by /RELCR etc.)
All of the /WI* commands now do a /WII style full whois request.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@88 13b04d17-f746-0410-82c6-800466cd88b0
per-server, and apply new version of do_oops from flewid (the BX2 version).
This means that /oops, "/query .", "/query ,", "/msg ." and "/msg ," are now
per-server, along with the $. $, and $B aliases.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@87 13b04d17-f746-0410-82c6-800466cd88b0
(*why* is the return value of inet_ntop() const char *? it just returns a
pointer to the user-supplied char * parameter!)
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@86 13b04d17-f746-0410-82c6-800466cd88b0
that isn't in a channel with the client (god knows how *that* happens, but
someone reported the bug...) could crash the client, because a NULL pointer
is passed to logmsg(). The bug didn't show under glibc because it handles
the NULL pointer OK.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@58 13b04d17-f746-0410-82c6-800466cd88b0
doop() and dodeop() - they could do with a bit more though.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@53 13b04d17-f746-0410-82c6-800466cd88b0
chanop first, then halops, voices and others). Added /SCAN -stat
to sort nicks using NICKSORT_OP. Removed NICKSORT_VOICE - it was broken
anyway.
Removed "scan" plugin, this functionality is now covered by /SCAN -stat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@52 13b04d17-f746-0410-82c6-800466cd88b0