Previously these codepaths were dead because it was passing an argument like "+HOST" to check_whowas_nick_buffer()
in place of the channel name, so it would never find anything.
Now that function supports a NULL channel to mean "any channel", so we can use that. The actual code itself needed to be
fixed as well, it's now similar to the way userhost_unban() is written.
The second branch of if (str) ... else if (str) is dead code, remove it. Also remove the if() entirely because
the while condition covers it exactly anyway.
Move the static variables used only in this function to function scope.
Change color_mod to const static and remove unneeded variable c_mod.
Move the increment of cparse_recurse to after the point where we bail.
None of this should have any user-visible impact.
This is just a simplification - the string format should always match the arguments passed,
and none of the options are using anything but plain %s formats.
This also requires modifying /RELI to store the invited-channel in .last_msg so that it
can use the numargs = 3 format.
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.
Functions display_msg() and check_sync() are only used in numbers.c, so they
can be static.
Remove inclusions of <numbers.h> from .c files that don't need it.
There's several different types of DCC offers, all of which need slightly
different handling. Previously they were all handled by the monster function
register_dcc_type() - this breaks them out into seperate functions for handling
SEND, RESEND, CHAT and BOT offers, moves common code into static helper
functions and renames the entry point from ctcp.c to handle_dcc_offer().
This will allow adding a way for modules to register DCC offer types that
they're interested in.
This also moves rename_file() from misc.c into dcc.c, where its only user is.
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.
Rename randreason() to fread_random() to better reflect its function,
and change it to a one-pass algorithm. Have it write into a caller-provided
buffer instead of a static buffer. Fixes a file leak when an empty
file is given to this function.
Change freadln() so that it never returns an empty line - it only returns
0 at end-of-file now. This simplifies its callers.
Factor out some common code from the several get_reason()-type functions,
which greatly simplifies them.
This silences a few compiler warnings.
This also cleans the function up by removing some always-true checks.
I'm not convinced that this function makes a whole lot of sense, though.
Will look into it further...
This function is only used by the GUI menu code, so we don't need to
build it for normal builds.
Also clean up some unsigned char / char mismatches that the compiler warned
about.
These functions are only used by parse.c:annoy_kicks(), so move them next
to that function and make them static.
This also changes their arguments from unsigned char * to char *, getting rid
of some signed/unsigned mismatch warnings.
We now send PING <server> :<server> for /spings, and
PING LAG!<cookie>.<tv_sec>.<tv_usec> :<server> for lag checks. The cookie is
set randomly at server connect time, and means that clients connected to the
same bouncer shouldn't act on each other's lag checks.
We can now remove in_sping entirely - previously it would get out of synch if
you disconnected with a sping in progress.
Recent OpenBSD and NetBSD have changed time_t to be a 64 bit type on all
platforms. This means that on 32 bit systems, time_t is now longer than
long, and %lu can't be used to format it.
The lag check doesn't actually care what is in the first field of the PING
command, so change it to be our nick (which is arguably what it should be).
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@498 13b04d17-f746-0410-82c6-800466cd88b0
recent Cygwin (including windows.h after the macros defined in modval.h
causes the build to fail due to our 'load' macro). Reported by VICODAN.
Also define WIN32_LEAN_AND_MEAN in misc.c, which should speed up Cygwin
build times a little.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@219 13b04d17-f746-0410-82c6-800466cd88b0
res_init() if /etc/resolv.conf doesn't exist, which is usual.
Add code to handle this by calling GetNetworkParams().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@198 13b04d17-f746-0410-82c6-800466cd88b0
and switch to using BIND4 macros (GETSHORT / GETLONG).
Should fix /nslookup on OpenBSD.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@196 13b04d17-f746-0410-82c6-800466cd88b0
to the existing BIND_8_COMPAT fix for OSX.
Oh how I hate the /nslookup function.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@187 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