Commit Graph

32 Commits

Author SHA1 Message Date
Kevin Easton
cd9c358eed Fix CHANGE_NICK_ON_KILL feature
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.
2017-07-15 23:29:14 +10:00
Kevin Easton
917a04ce66 Use correct printf format for current_numeric 2017-06-08 23:31:10 +10:00
Kevin Easton
60dc1afdca Remove unnecessary duplicated NULL tests in handle_server_stats()
Also make handle_server_stats() static.
2017-06-08 23:17:06 +10:00
Kevin Easton
0a16ab16ac Introduce strbegins() macro and replace all open-coded instances
This test is done quite a bit across the tree, and the open-coded variants make it easy to have an
accidental mismatch between the length of the prefix being tested and the length actually passed to
strncmp().

This fixes an issue of that type comparing the server version against the prefix "u2.10", where the old
code used an incorrect length of 4.
2017-06-06 23:47:10 +10:00
Kevin Easton
1ccd082cd2 Cleanup remove_channel()
remove_channel() is only called in direct response to a message from a server,
so it always acts on from_server - remove the unnecessary server argument.

The channel argument is always non-NULL - remove the dead code that removed all
channels if a NULL channel was passed.
2017-04-16 16:19:55 +10:00
Kevin Easton
23967ba5be Wire up /FSET WHOIS_BOT for users on the userlist with the BOT flag
This FSET has existed for a long while but has been unused for some time,
since before the userlist was reworked to use flags instead of levels.  This
means that the default value for the FSET also has to be updated.
2016-05-25 23:38:11 +10:00
Kevin Easton
d464bd91fb Remove unnecessary inclusions of <numbers.h>
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.
2016-03-24 11:21:09 +11:00
Kevin Easton
f129ca29e7 Move got_initial_version_28() from notice.c to numbers.c, where it belongs 2016-03-24 00:08:57 +11:00
Kevin Easton
28bd7a66b6 Remove useless check for !nick from userhostbase callbacks
The userhostbase callback is always called with non-null nick.  Checking for
this is just noise which also sometimes results in odd compiler warnings.
2015-06-24 23:20:53 +10:00
Kevin Easton
aa3dc1939d Remove obsolete Chatnet 310 numeric support (WANT_CHATNET)
Chatnet doesn't use the odd 310 numeric support anymore, it now uses 310 for
the same WHOIS_HELPFUL as Dalnet.  They apparently use a pretty bog-standard
Unreal ircd now.
2015-06-16 13:23:36 +10:00
Kevin Easton
a06fe2a883 Revert back to using floating point for stats calculations, but correctly rounded.
Integer division has potential edge-case overflow problems that are best avoided.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@536 13b04d17-f746-0410-82c6-800466cd88b0
2014-11-14 10:34:50 +00:00
Kevin Easton
5126d21126 Add /FSET WHOIS_LOGGEDIN to format RPL_WHOISLOGGEDIN, used by hybrid, ratbox, ircu and derivatives.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@506 13b04d17-f746-0410-82c6-800466cd88b0
2014-10-10 12:56:09 +00:00
Tim Cava
2677dc4c60 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@451 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:28:26 +00:00
Tim Cava
112b38ac7a Revert the last commit. It accidentally had autogenerated files in it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@432 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 03:00:24 +00:00
Tim Cava
276fd24258 Use snprintf rather than sprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@431 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 02:41:16 +00:00
Kevin Easton
17e3a91f03 Remove handling for the 484 numeric. It was intended for ircnet's 484
(ERR_RESTRICTED), to set user mode +r - however this does not appear to
be necessary anymore.  It was also buggy for several reasons: due to 
a change in set_server_flag() this has actually been setting mode +G; and
484 is ERR_ISCHANSERVICE on other ircds.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@233 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-25 12:22:54 +00:00
Tim Cava
d7a0c781f8 Convert simple uses of alloca/strcpy to LOCAL_COPY.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@232 13b04d17-f746-0410-82c6-800466cd88b0
2013-02-24 07:32:59 +00:00
Kevin Easton
1541299fa1 Merge infrastructure for SASL authentication support from flashback.
This includes all of the underlying support, but doesn't hook it up to the
/SERVER command yet, so it's not useable at this point.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@216 13b04d17-f746-0410-82c6-800466cd88b0
2012-12-30 02:22:56 +00:00
Kevin Easton
71cc2bf5f4 Add FORMAT_WHOIS_SECURE for SSL connection info from ratbox, unreal and freenode servers (RPL_WHOISSECURE). Does not support
hybrid yet because it uses numeric 275, which clashes with unreal's RPL_STATSDLINE.

RIP dmr.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@144 13b04d17-f746-0410-82c6-800466cd88b0
2011-10-13 12:45:27 +00:00
Kevin Easton
15f6d8ac06 Pass through arguments of 338 numeric unchanged to script hook.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@143 13b04d17-f746-0410-82c6-800466cd88b0
2011-10-06 09:48:10 +00:00
Kevin Easton
b355145d69 Add /FSET CHANNEL_URL to format the RPL_CHANNELURL (328) numeric sent by dalnet and atheme services.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@142 13b04d17-f746-0410-82c6-800466cd88b0
2011-10-04 12:47:01 +00:00
Kevin Easton
7a59da1f2e Add /FSET WHOIS_CALLERID for +g mode notification on hybrid & ratbox.
This is numeric 716.  Hybrid shows it in WHOIS, and both show it when you
try to PRIVMSG someone who is +g (similar to AWAY).  So I've formatted it
to match the WHOIS block.

I also took the chance to fix up the ordering of the fsets, and remove
a bunch of redundant setting of default values.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@103 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-30 12:48:28 +00:00
Kevin Easton
5430be4c78 Add RPL_WHOISHOST (378) numeric from Unreal (and freenode).
Formats with /fset WHOIS_ACTUALLY.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@102 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-20 12:30:55 +00:00
Kevin Easton
3c0e23a7c5 Ensure that SHOW_AWAY_ONCE doesn't hide away status in /whois output, by
clearing last_away_msg when the 311 whois reply numeric is recieved.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@95 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-05 09:03:32 +00:00
Kevin Easton
abb5e06233 Modify the RPL_WHOISACTUALLY numeric handling to work on Bahamut as well.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@82 13b04d17-f746-0410-82c6-800466cd88b0
2009-12-10 13:07:23 +00:00
Kevin Easton
5337b226fa Change the handle_server_stats so that the averages (eg. users per
channel) are correctly rounded. Added a divide_rounded() function
that rounds to nearest integer.  This also gets rid of the messy
floating point divisions in that function.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@73 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-22 22:35:23 +00:00
Kevin Easton
0fc23ba148 Reinstate a new version of RPL_WHOISACTUALLY numeric handling.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@72 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-21 14:14:28 +00:00
Kevin Easton
771b2af59d Fixed two places where the client compared the source of a numeric against
get_server_name(from_server) instead of get_server_itsname(from_server) -
this meant that if the client had a different idea of the local server name
from the server (say, if you used a round-robin to connect), then the client
would incorrectly assume the numeric came from a remote server.

The symptoms were:

 * If your local server sent you a "you're not op" type message, BitchX would
report the channel had desynched.

 * If your local server send you a "channel doesn't exist" numeric (eg. if
you typed /mode #nosuchchannel to see if it existed), BitchX would not show
it. 


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@71 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-19 14:24:15 +00:00
Kevin Easton
06f23669c6 Fix bug where you got disconnected if the server sent a 464 numeric
(bad password) that the client wasn't expecting.

The most common case is failing a CHALLENGE oper attempt.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@55 13b04d17-f746-0410-82c6-800466cd88b0
2008-07-02 09:48:22 +00:00
Kevin Easton
3de93b1dbc Far-reaching changes to make BitchX compatible with 64 bit architectures
like x86-64, where sizeof(int) != sizeof (void *).  This involves correctly
casting every function pointer from the global table to the correct
function type, which has the added benefit of allowing type-checking of
function arguments and return values.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@26 13b04d17-f746-0410-82c6-800466cd88b0
2008-04-30 13:57:56 +00:00
Kevin Easton
533c3dbcbf Turn on SVN keyword replacement for $Date$, $Author$, $Revision$, $Id$ for all
*.c and *.h files.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/branches/ircii-pana-1.1@3 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:49:14 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00