Commit Graph

77 Commits

Author SHA1 Message Date
Kevin Easton
1838a37a6c Cleanups in get_help_topic(). Topic now displays correctly, rather than the
argument supplied to /bhelp.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@126 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-18 14:30:03 +00:00
Kevin Easton
ab170a123d Further simplifications and improvements to the chelp code.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@125 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-18 12:54:13 +00:00
Kevin Easton
09c34c045f Further cleanups and fixes in chelp.c:read_file(). Now properly adds NULLs to
terminate the lists, that the code in get_help_topic() expects to be there - 
fixes a potential crash in /bhelp.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@123 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-17 11:58:16 +00:00
Kevin Easton
df5547af72 Add .xxx TLD to country(), and some more const-correctness.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@122 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-17 03:33:00 +00:00
Kevin Easton
780ac2c149 Cleanup and rename replace_color() to put_color(), including sanity-checking of
foreground color code - this ensures that if a wild color code makes it this
far, it doesn't crash the client.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@121 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-08 13:10:05 +00:00
Kevin Easton
fd9980b9c7 Fix spelling mistake.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@119 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-08 12:29:55 +00:00
Kevin Easton
7f293687b1 Correct help text for /bhelp, reported by t3gah.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@118 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-05 23:24:22 +00:00
Kevin Easton
9b92ec3c11 Cleanups and simplifications in read_file().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@117 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-05 11:59:06 +00:00
Kevin Easton
c816dcec22 Add missing entry for new USERMODE_OTHERS /fset.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@116 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-05 05:47:49 +00:00
Kevin Easton
3f0ef54b18 Remove some dead code and add a sanity check to create_fsets().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@115 13b04d17-f746-0410-82c6-800466cd88b0
2011-04-05 05:45:20 +00:00
Kevin Easton
c45c6a69bf Cleanup p_mode() and correct handling of user mode changes where the source
and the target aren't the same (reported by gauze).  This doesn't happen
on standard servers, but is used by services on some networks.

Adds /FSET USERMODE_OTHER.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@114 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-31 22:20:21 +00:00
Kevin Easton
719279790e Add some more TLDs to $country(), synchronised with the IANA list: .ax, .eu,
.me, .rs, .tl, .asia, .cat, .jobs, .tel and .travel.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@113 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-31 08:32:23 +00:00
Kevin Easton
b17b09949b Improve country() by using "static const" for lookup table (makes function 25% smaller)
and const-correctness.  Add .mobi TLD.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@112 13b04d17-f746-0410-82c6-800466cd88b0
2011-03-23 11:17:23 +00:00
Kevin Easton
3aa7f7765f Remove non-standard arithmetic on void *, and get offsetof() from <stddef.h> instead
of rolling our own.

Fixes building on Irix.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@110 13b04d17-f746-0410-82c6-800466cd88b0
2011-02-02 12:34:13 +00:00
Kevin Easton
b43ecbaa85 Improve memory allocation routines to fix alignment and remove non-standard
void * arithmetic.

Fixes compilation on Irix.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@109 13b04d17-f746-0410-82c6-800466cd88b0
2011-02-02 12:15:29 +00:00
Kevin Easton
08cca81993 Rework cset functions to remove non-standard void * arithmetic.
Fixes compiling on Irix.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@108 13b04d17-f746-0410-82c6-800466cd88b0
2011-02-02 12:13:54 +00:00
Kevin Easton
fc33f520ae Remove non-standard void * arithmetic (fixes compilation with Irix compiler).
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@107 13b04d17-f746-0410-82c6-800466cd88b0
2011-02-02 12:11:03 +00:00
Kevin Easton
6711ef7f00 Correct use of IN6ADDR_ANY_INIT initialiser, fixes IPv6 build on Intel ICC.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@105 13b04d17-f746-0410-82c6-800466cd88b0
2010-12-16 21:15:15 +00:00
Kevin Easton
d1e13bc526 Show correct message ("Remote end closed connection") when we get EOF
on a socket.

I also added a wrapper function around strerror() for dgets_errno, since
we did the same thing in a few places.  This all needs to be cleaned up
a little - the -1 value we use could in theory clash with an actual
errno error number.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@104 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-30 13:26:06 +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
f71e26acc7 Correct count in /CLONES (reported by t3gah), and format output nicely
using an /fset.

/CLONES now uses the same formats as the /U command.  Also tweaked those
formats at the same time.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@98 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-06 13:40:13 +00:00
Kevin Easton
cb8e8c21ae Add definition of BIND_8_COMPAT to fix build problem on Mac OS X.
Every other UNIX in existence defines BIND_4_COMPAT in arpa/nameser.h, which
ensures that nameser_compat.h gets included.  Mac OS X changed it to 
BIND_8_COMPAT and stopped including it by default.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@97 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-06 12:46:03 +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
d6c105861c Fix auto-away time strangeness when server reconnection happens.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@94 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-05 08:37:04 +00:00
Tim Cava
a72091bb0e Fix the -z command line option and the use of the IRCUSER environment variable.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@93 13b04d17-f746-0410-82c6-800466cd88b0
2010-07-30 09:52:17 +00:00
Tim Cava
28f8b2c9af Use the value passed to auto_away() instead of recalculating it, and rename
this variable "idle_mins". (From BX2)


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@92 13b04d17-f746-0410-82c6-800466cd88b0
2010-07-01 08:19:28 +00:00
Tim Cava
7269d14c75 When /AWAYMSG is used without an argument, tell the user their auto-away msg was unset,
instead of saying it was set to "nothing". (From BX2)


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@91 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-30 05:50:12 +00:00
Kevin Easton
60d451fa92 Cleanup my_whois a bit.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@90 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-27 13:05:32 +00:00
Kevin Easton
223926fdf2 Fix up /WILN, /WILC and /WILCR. last_ctcp is now the last CTCP request
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
2010-06-26 14:43:22 +00:00
Kevin Easton
789ed916cd Backport changes from epic5 to make recv_nick, sent_nick and sent_body
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
2010-06-26 08:18:34 +00:00
Kevin Easton
56d5c9e643 Add a "const" qualifier to get rid of some warnings.
(*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
2010-06-26 08:01:55 +00:00
Kevin Easton
1a0e5ec166 The /cd command now handles getcwd() failing (eg if the current directory
has been removed).


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@85 13b04d17-f746-0410-82c6-800466cd88b0
2010-05-02 08:18:29 +00:00
Kevin Easton
38cd097631 Remove symlinks from repository - not needed, Makefile regenerates 'em.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@84 13b04d17-f746-0410-82c6-800466cd88b0
2010-03-23 14:12:28 +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
0770358394 Correct misuse of RETURN_STR macro in function_gettmatch.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@81 13b04d17-f746-0410-82c6-800466cd88b0
2009-11-24 12:06:54 +00:00
Kevin Easton
7ac4b8520c Convert my_stricmp, my_strnicmp and wild_match from unsigned char * to char *.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@80 13b04d17-f746-0410-82c6-800466cd88b0
2009-11-24 10:21:30 +00:00
Kevin Easton
f8c9021184 Fix minor memory leak in banlist.c:delay_flush_all.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@79 13b04d17-f746-0410-82c6-800466cd88b0
2009-11-18 10:30:46 +00:00
Kevin Easton
b2a282feaa Fix a refcounting issue in the whowas list handling.
When a user in one of the whowas lists rejoins, their entry is removed from
the whowas list (and added to a channel nicklist).  However the count of
entries in the whowas list wasn't being decremented, so eventually the client
thinks the lists are full when they're really empty... at this point only one
user at a time can be in the lists (so /WHOLEFT after a netsplit would only
show one user).



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@77 13b04d17-f746-0410-82c6-800466cd88b0
2009-10-16 12:35:56 +00:00
Kevin Easton
4e72a992b4 Fix argument-handling for the /hostname (/irchost) command - now you can do
/hostname 2 instead of /hostname #2.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@75 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-27 12:45:28 +00:00
Kevin Easton
eab1834e64 Add 0::1 to list of ipv6 addressed ignored as vhost candidates.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@74 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-27 12:06:31 +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
e338d2d9fd Fix the $servernum() function - no matter what string
you gave it, it would return the first server in the list
where server.itsname == server.name, due to a misplaced
variable.  It also returned an empty string for
$servernum(  ) when it should return the current server.

Also removed the useless function_serverport() function -
it was a character-for-character duplicate of
function_servports().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@70 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-17 13:38:09 +00:00
Kevin Easton
eb13453e50 Fix snprintf() call in /QUIT to make glibc2.9 happy.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@67 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-08 13:22:27 +00:00
Kevin Easton
a6636dd449 Add missing third parameter to open().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@65 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-08 12:44:03 +00:00
Kevin Easton
7a046f56ab Add missing third argument to open().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@64 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-08 12:37:39 +00:00
Kevin Easton
ef503e318e Fix .cmsg crash reported by zimzum.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@62 13b04d17-f746-0410-82c6-800466cd88b0
2009-09-02 14:14:21 +00:00
Kevin Easton
147ea72710 Some cleanups in quit message handling. Fixed a bug where a quit from a user
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
2008-07-07 11:55:00 +00:00