Commit Graph

18 Commits

Author SHA1 Message Date
Kevin Easton
498631e74a Introduce get_kick_reason() and switch all kick commands to use it
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().
2015-06-28 00:35:50 +10:00
Kevin Easton
ee0cd23ae5 Rearrange code in bankick() to silence a compiler warning
Re-checking the command name to see if it's a timed ban means that the
compiler can't see that it's the same check.

This also makes sure you can't specify a negative timeout.
2015-06-24 23:38:28 +10: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
05cf540a99 Fix use of uninitialised variable and hostmask matching logic in userhost_unban()
Initialise ip_str so that it isn't used uninitialised.

Don't strip server flags from user@ portion of the hostmask, so that it will
not miss matching bans.

Switch ip_str from alloca() to malloc_sprintf() / new_free() - there's no
particular need for alloca() here.
2015-06-23 15:53:30 +10:00
Kevin Easton
6dc2335df9 The /mv command shouldn't send +v for already-voiced users.
The logic in the massop function to exclude already-voiced users from
massvoice was faulty - it was equivalent to just !nick_isop().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@500 13b04d17-f746-0410-82c6-800466cd88b0
2014-09-23 13:59:03 +00:00
Kevin Easton
a3170cf578 Fix regression introduced in r480, where /BKI on non-joined clients no longer ignored.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@499 13b04d17-f746-0410-82c6-800466cd88b0
2014-09-23 13:46:47 +00:00
Tim Cava
d8b8c169ab Remove a variable that is set but unused.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@481 13b04d17-f746-0410-82c6-800466cd88b0
2014-02-28 22:22:33 +00:00
Tim Cava
3494a55541 Remove variables that are set but unused.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@480 13b04d17-f746-0410-82c6-800466cd88b0
2014-02-28 22:13:49 +00:00
Kevin Easton
ffea653764 Fix the /TKB (timed kickban) command.
An incorrect pointer was being passed to malloc_sprintf(), causing a
crash.  Use m_sprintf() instead.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@471 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-16 03:13: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
Tim Cava
92012cccd1 Cleanup banlist.c and fix a few bugs, with suggestions from caf.
* Restore from_server in doop() when prepare_command() fails
* Make /bans &channel work
* Make /unban #channel #number work (caf)


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@296 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-17 14:17:29 +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
Tim Cava
46cf14c0da Fix the MKNU command, with suggestions from caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@205 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-07 04:22:17 +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
df93dcbbc0 Add /HOP and /DEHOP commands for halfop. Also did a little cleanup around
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
2008-06-14 06:51:03 +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