Commit Graph
97 Commits
Author SHA1 Message Date
Uli Schlachter d91803bf22 Increase the version number to 0.200
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-20 22:33:15 +02:00
Uli Schlachter 8f53d3fbb0 Fix modp{erl,ython} installation
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-06 10:43:39 +02:00
Uli Schlachter da0ba75549 Fix CString::Escape_n() and add some tests for it
This bug was originally reported by someone on irc, but sadly I forgot who it
was. Sorry!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 16:09:22 +02:00
Uli Schlachter cb6798d36f Fix module data for extra/ modules
No module in extra/ comes with any data currently, so this was tested by moving
perform to extra/. The install is untested.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 15:19:09 +02:00
Uli Schlachter 8d17f50600 Include zncconfig.h in all headers
The rule is that zncconfig.h must be the very same thing that is included. We
cheat and only include it in headers (so that modules dont have to have be
changed). However, it looks like some modules where missed.

This commit fixes test/ConfigTest which crashed if _GLIBCXX_DEBUG was enabled
(--enable-debug) because it didn't see this define before including a c++
header.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 15:02:04 +02:00
Uli Schlachter dcf357b1f6 Stop asking for the host name in --makepem
Come on, it's a self-signed certificate, how much value does it have anyway?
Also, it gets rid of a question during --makeconf which confuses some people.

This should now use $HOSTNAME and fall back to "host.unknown" if that isn't set.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-03 22:05:21 +02:00
Uli Schlachter 9685f16b96 Fix a memleak in CChan::AddNick()
This memleak existed since 5e070e788 from almost a year ago.

Thanks to Olipro for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-27 15:14:01 +02:00
Uli Schlachter f1cb09bd9c Don't send a MODE request when JOINing
Since commit 1a1cc4c756, we'd always send a "MODE #chan" to IRC when we
received a "JOIN #chan". It used to work before that commit, because the mode
reply which is automatically sent on join is sent before the "end of /names"
numeric.

This just removes that MODE request. Proper IRC server should always send a MODE
reply on channel join.

Thanks to nyuszika7h`` for the report.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-27 15:12:03 +02:00
Uli Schlachter dd56a3c2ba Broadcast an error on EMFILE
When we hit the "maximum open files" limit, we close the listener that hit this
error. Previously we did so silently which means no one could figure out what
happened.

This commits adds a broadcast message giving a hint, but this should never
happen in a real-world situation anyway (unless you have 1000 users).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-25 16:58:11 +02:00
Uli Schlachter 789f1ff7b5 Update to latest Csocket
This fixes the "busy loop waiting for an SSL handshake to finish" which the last
"Update to latest Csocket" was already supposed to fix. However, that fix had a
bug if poll() is used instead of select().

poll()'s timeout argument is in milliseconds while select also allows
microseconds. Since Csocket originally used select(), it expects the
microseconds-approach. This means it has to divide by 1000 to get the timeout
argument for poll().

However, the iQuickReset which was used to "fix" (rather: hide) the busy loop
was less than 1ms so this still resulted in a timeout of 0 (= busy loop) because
integer division truncates the result.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:47:56 +02:00
Uli Schlachter 4fbca80705 WebMods: Set another cookie if the IP check fails
This means that they will get a new cookie on the next request. This will make
sure that you will be able to use webadmin again if your IP changed (which seems
to happen to quite a number of people).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:40:55 +02:00
Uli Schlachter 00024b1b3a znc-buildmod: Print znc's version number
This helps people figuring out that they are still building their modules for
the wrong znc version since they have more than one installation on their box.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 19:56:48 +02:00
Uli Schlachter 88e7f093a1 Update to latest Csocket
Fixes:

- A possible crash bug for empty DNS replies with c-ares. E.g. a AAAA lookup for
  google.com doesn't give any reply but is still successful. This might be a
  c-ares bug (there is ARES_ENODATA) or c-ares just changed its behavior?
  (No bug report, just noticed accidentally)
- Connecting to ipv4-only hosts with a v6 bindhost caused weird errors:
  https://github.com/znc/znc/issues/47
- There was a pull request for some DSA server certificate thingy:
  https://github.com/znc/znc/pull/46
- Busy loop waiting for an SSL handshake to finish:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631590
- Some other stuff? No idea what some of the changes in here are actually doing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-26 12:11:40 +02:00
Uli Schlachter 554429a61f Fix a bug in MCString::Encode()
For character values above 127, the signed char that could be used here did the
wrong thing. That is, *it >> 4 returned a negative value and the array hexdigits
was read indexed with that wrong value.

Fix this by explicitly using unsigned char.

Thanks to crocket for reporting this bug which he found with perform (broken
entries after a restart/reload).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-13 15:19:17 +02:00
Uli Schlachter 25ce7de020 Only export a single function from modules
This moves the version check into the function which loads the module info. That
way, we just need a single dlsym() call per module and thus can't get any errors
from the second dlsym() call. And IMHO this feels nicer anyway. ;-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-11 18:33:50 +02:00
Uli Schlachter ca97dca6dc Use references instead of pointers for CModInfo
This works fine and reduces the chances of memory leaks.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-11 18:16:00 +02:00
Uli Schlachter 5ca6291f8a Check the for our minimum required autoconf version
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-10 16:39:51 +02:00
Uli Schlachter 76010c16bd Merge pull request #55 from Un1matr1x/bugfix/white_space_edition
remove evil trailing white space
2011-06-09 12:38:59 -07:00
Uli Schlachter f6113b322d Merge pull request #50 from bpcampbe/TrimBuffer
Add CChan::TrimBuffer and have SetBufferCount call it.
2011-06-07 09:23:05 -07:00
Uli Schlachter 4324d5ff02 Merge branch 'master' of https://github.com/pfn/znc
Conflicts:
	modules/extra/away.cpp

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-21 13:58:41 +02:00
Uli Schlachter 6deae62c5b autoattach: Allow limiting by hostmask
This adds hostmasks to autoattach. E.g. if you don't like me, you add an entry
of "! * psychon!*" and autoattach won't attach you to channels just because I
said something. The same can be done in the non-negated case, "only attach when
foo says something".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-15 13:15:51 +02:00
Uli Schlachter 2985efb524 Correctly handle excessive web sessions
The old code didn't actually destroy the session, but only made sure we couldn't
use it anymore. What a waste of memory.

This was tested by adding a DEBUG()-call to CWebSock::~CWebSock():

Before this patch:

 Page Request [/]
 Remote IP:   127.0.0.1; discarding session [ca104adaa54f933b6b8394e88e68ab0d22e0fc227ed23e93d1421e4d3fda8211]
 Auto generated session: [d40364e8d0a55432b86a1b2598865c2323e35cc6e77cade35b9a1b7605712ca6]

After this patch:

 Page Request [/]
 Remote IP:   127.0.0.1; discarding session [707e3b262fe47b93d8c796354574506c398cc5b5d84aa2972dc3d031d8f731f5]
 Destroying session [707e3b262fe47b93d8c796354574506c398cc5b5d84aa2972dc3d031d8f731f5, 127.0.0.1 for <unknown>
 Auto generated session: [47de1c82a8b6eaae54a9cc8c29163ab53ec2add7198cf1df7f80506ea1bda2b6]

Obviously, the destructor is only called after this change.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 18:19:08 +02:00
Uli Schlachter 3e591e7043 Set errno in CListener::Listen()
CSocket doesn't necessarily set errno, but the callers of Listen() assume an
error message in errno.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 17:24:10 +02:00
Uli Schlachter 3034d1f81a Make it possible to use ExpandString-stuff in QuitMsg
You can now use "Uptime: %uptime%" as your quit message, yay!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 16:40:40 +02:00
Uli Schlachter eb229659e5 Warn if a *module message is ignored
Some modules (e.g. webadmin) don't handle messages to *module in any way. Make
it clear to the user why they didn't get any reply back in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 15:48:47 +02:00
Uli Schlachter 55ba59de02 WebModules: Add some more debug output
This now prints more info in case of errors which might help figure out bugs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-08 22:19:51 +02:00
Uli Schlachter 54d8cd6831 Some fixes for README.md
This fixes some broken markup and adds modpython

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-01 11:58:03 +02:00
Uli Schlachter ca81a0c786 Merge pull request #42 from Un1matr1x/change/readme.
overhaul Readme.md
2011-05-01 02:49:21 -07:00
Uli Schlachter 6e48f3535c Update to latest Csocket
This fixes a problem where Csocket detected socket timeouts (as configured with
SetTimeout()) too late if there was few activity. See csocket's git commit
message for more info, I'm lazy. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-30 12:29:12 +02:00
Uli Schlachter e0c5c3b93c Csocket: Compile when SSLv2 is disabled in openssl
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-15 18:03:38 +02:00
Uli Schlachter 72c1fa0c90 Don't use poll() on Mac OS
Congratulations, Apple. Your OS is really great. In some versions (according to
google, it used to work in older releases), poll() can only handle sockets. If
you give it a pipe (as e.g. the shell module does), it will fail with POLLNVAL
which Csocket handles by going into an endless loop.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 18:04:14 +02:00
Uli Schlachter 3f24f28736 Stop including FileUtils.h in any header
This causes every piece of code which wants to use CFile or CDir to have to
include FileUtils.h. This causes quite some noise.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 11:50:44 +02:00
Uli Schlachter 1761fe71e4 Move CExecSock to ExecSock.h
As a result, Utils.h no longer has to include Socket.h and lots of stuff breaks.

Due to a severe case of lazyness, some of the code for CExecSock is still in
Utils.cpp. Feel free to fix if you really have to.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 11:50:41 +02:00
Uli Schlachter ac5c021c93 Move DEBUG() from Utils.h into new ZNCDebug.h
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:41:27 +02:00
Uli Schlachter 0e0ab34773 defines.h doesn't need main.h
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:24:15 +02:00
Uli Schlachter 8e59f75125 Don't include FileUtils.h in znc.h or Modules.h
Both these headers only really need CFile* which can be handled with a forward
declaration.

To make this possible, some methods are moved from the header file into the
corresponding implementation file, because they used CFile or CDir static
members.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:21:59 +02:00
Uli Schlachter ad442f4f10 Include less headers in WebModules.h
From Client.h, only CAuthBase is needed. This is solved by moving the whole
CWebAuth class to WebModules.cpp.

The include of FileUtils.h is avoided by changing the API. GetAvailSkins() now
returns the skin names instead of a CFile for the skin's path.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:06:16 +02:00
Uli Schlachter 3fa04f8c0a Handle Listeners after SSLCertFile
Else, the Listeners will ignore the SSLCertFile config option.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 09:27:08 +02:00
Uli Schlachter ca36887ddf Don't include znc.h in Listener.h
znc.h pulls in most headers, Socket.h pulls in way less headers. This should
speed up compiles by 0.0000000314%.

The rest of this is compile fixes for stuff which assumed that Listener.h
includes znc.h for them. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 23:28:32 +02:00
Uli Schlachter d2f3b8c508 Raise our IRC connection timeouts
ZNC will now send a PING if the connection was idle for 270 to 300 seconds.
After 540 seconds (that is, about 270 to 240 seconds later) the timeout is
triggered and ZNC reconnects.

These values are "inspired" by the values eggdrop uses.

The old timeouts were 180 to 210 secs for the PING and 240 secs for the timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 23:03:33 +02:00
Uli Schlachter f0bf7134ec Improve the handling of module load messages
Instead of doing ugly stuff to shorten the "Loaded Module [foo]" message, we now
just always generate the shorter version of that message. The code paths which
didn't do this shortening now prepend that message themselves.

The result is that every message looks the same as it did before, but the code
for generating these is a little nicer.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 16:52:52 +02:00
Uli Schlachter 2003465489 Config: Fix some errors in the comment handling
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:46:14 +02:00
Uli Schlachter 90fb9e8c29 Re-add the ISpoof{File,Format} handling which was lost
Whoops, someone here failed at rebasing stuff.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:46:14 +02:00
Uli Schlachter 70c7745899 Overhaul the config parsing
This moves stuff to a two-step model. First, the new class CConfig reads the
config file, parses it and creates a in-memory model of stuff. Only then do we
actually go forward and apply the stuff.

The upside of this is that some config errors are caught before we change
anything on the running upside.

Let's see how much stuff this broke...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:43:05 +02:00
Uli Schlachter ee9686e422 Fix a stupid memleak
Where's my brown paper back...?

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 19:18:11 +02:00
Uli Schlachter a4d388b56d Improve lock file error handling
When we have an error during rehashing / config writing, we continue keeping the
old lock around since we haven't gotten rid of that one yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 19:07:36 +02:00
Uli Schlachter 7f3e55e72f Check for errors while writing the config
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:21:36 +02:00
Uli Schlachter bff969f404 CZNC::WriteNewConfig() check for errors
This code now errors out if there is any error while writing the config. I
tested this with a full file system (full tmpfs of size 4k).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:15:49 +02:00
Uli Schlachter cc2d84d4a6 CFile::TryExLock(): Use O_RDWR by default
Getting an exclusive lock on a file with TryExLock() requires write access,
therefor O_RDONLY is wrong here.

This worked back when we were using flock() for file locking, because flock()
doesn't need write access for an exclusive locks.

This fixes a bug where "--makeconf" claims that there is already a znc instance
running on the config file. This happened because it mis-interpreted the -EBADF
error from fcntl() as "something else already has a lock".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:10:02 +02:00
Uli Schlachter 70358cabdd CFile: Add an error flag
Whenever an error happens with some file operation, the error flag is now set.
This is especially interesting for tracking errors from Write().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:00:07 +02:00
Uli Schlachter 23fb4df67a Remove config-related module hooks
This removes the following module hooks:

OnConfigLine()
OnWriteConfig()
OnWriteUserConfig()
OnWriteChanConfig()

Modules could use these hooks for writing/reading their own stuff to/from
znc.conf. However, no module (ever?) did this and IMHO no module should ever do
this either. Modules can save stuff via SetNV(), module arguments (SetArgs())
and in their GetSavePath().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 17:29:49 +02:00
Uli Schlachter 0ff6cd7491 Merge branch 'notes' of https://github.com/kylef/znc 2011-03-30 10:38:07 +02:00
Uli Schlachter 1042795c96 Merge branch 'pem' of https://github.com/kylef/znc 2011-03-29 20:30:11 +02:00
Uli Schlachter 97ce939558 Merge branch 'lastseen' of https://github.com/kylef/znc 2011-03-29 20:02:42 +02:00
Uli Schlachter 000efa6be3 Don't try connecting users if the ISpoof is locked
This fixes various issues with slow connecting users. E.g. the users caused
themselves to be added to the ConnectThrottle map even though they didn't
actually try to connect.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 21:17:18 +02:00
Uli Schlachter f9ffe6f417 Move m_sHomePath from CZNC to CFile
Thanks to this change, linking the following object files produces no unresolved
symbols: FileUtils.o Utils.o ZNCString.o MD5.o SHA256.o

The idea here is that ZNC is a little better modularized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 21:05:39 +02:00
Uli Schlachter fbe2b7403a Make znc compile without getopt_long
If getopt_long() (GNU extension) isn't available, we use the plain old getopt()
instead. This means that long options won't work, but at least this compiles.

Tested on Solaris 9, but should also work on Irix.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 12:30:35 +02:00
Uli Schlachter 64e565c96e Merge branch 'log' of https://github.com/MentalFS/znc 2011-03-28 11:43:03 +02:00
Uli Schlachter b6ea6994db Merge branch 'away' of https://github.com/kylef/znc 2011-03-28 11:41:04 +02:00
Uli Schlachter 4473146018 Remove some evil trailing whitespaces
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 11:40:50 +02:00
Uli Schlachter 0e2b1dcc19 Merge branch 'perform' of https://github.com/kylef/znc 2011-03-28 11:40:30 +02:00
Uli Schlachter e12c0a517e Merge branch 'attach' of https://github.com/kylef/znc 2011-03-28 11:40:08 +02:00
Uli Schlachter 61f89a0b3c Merge branch 'buildmod' of https://github.com/kylef/znc 2011-03-28 11:39:56 +02:00
Uli Schlachter e0b7291b2d Merge branch 'notes' of https://github.com/kylef/znc 2011-03-28 11:39:39 +02:00
Uli Schlachter 1109455f30 Merge branch 'cleanup' of https://github.com/kylef/znc 2011-03-28 11:38:33 +02:00
Uli Schlachter bc67400daa Increase the version number to 0.099
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 11:22:34 +02:00
Uli Schlachter add7d7953e Increase the version number to 0.098
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 11:22:34 +02:00
Uli Schlachter d44e590336 Make CUser::m_sUserName constant
Changing the user name for a CUser instance is a really, really bad idea. There
are lots of paths that depend on the user name and only few of them are fixed up
when the user name changes.

This fixes a problem where admin's "CloneUser from to" caused problems with
modules, because all modules where loaded under the old user name and thus they
read/write NV data from the wrong directory in ~/.znc/users.

Thanks to un1matr1x for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-24 19:13:06 +01:00
Uli Schlachter 8419964165 watch: Use empty() instead of !size()
Yay for useless micro-optimizations. ;-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 23:38:10 +01:00
Uli Schlachter 8eda266bae Fix shell module
shell didn't compile since 6bc36d1708 because it used the
three-argument-version of CModule::PutModule(). This commit replaced that with a
call to CModule::PutUser().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 23:36:54 +01:00
Uli Schlachter 9da852a07f Merge remote branch 'github-kylef/nick' 2011-02-22 23:15:50 +01:00
Uli Schlachter 4acadb3cdf Evil trailing whitespace is evil!
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 21:03:45 +01:00
Uli Schlachter f3f49e1092 Merge remote branch 'github-kylef/send_raw' 2011-02-22 20:51:34 +01:00
Uli Schlachter 1aed330825 Fix .gitignore
The following files where incorrectly ignored:

./configure.ac
./modules/modpython/znc.py

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 14:57:25 +01:00
Uli Schlachter 31bbffa579 Convert admin to the new CModCommand interface
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:34:28 +01:00
Uli Schlachter 8e59fb957c Add CModule::OnUnknownModCommand()
This module hook is called to generate messages for unknown commands. This hook
has a default implementation that actually does something!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:34:25 +01:00
Uli Schlachter ebd7e53d7f Add a generic command handling to CModule
With this, modules can use AddCommand() to register commands. CModule will
dispatch all calls to OnModCommand() to the correct command handler.

If a module calls AddHelpCommand(), it will also generate help output.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:33:59 +01:00
Uli Schlachter cb2e50a5bd CFile: Handle paths like "~/foo"
This let's CFile expand relative-to-home paths. I "accidentally" broke
ISpoofFile with some recent commit and that is now fixed with this. This should
solve this problem for quite a lot of other places, too.

Idea (c) by DarthGandalf, thanks. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter ce10cee260 Correctly handle "~" in SSLCertFile
This works correctly because only the config writing/reading accesses
CZNC::m_sSSLCertFile directly, everything else goes through this getter.

This ChangeDir() call will also "sanitize" the path. E.g. "/foo//..//home///"
will be turned into "/home/" and stuff like that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter f69aeff3d9 Some minor cleanup
This makes the code use GetISpoofFile() instead of accessing m_sISpoofFile
directly. Additonally, CFile::GetLongName() is used for printing the filepath.

(This also removes an useless if branch, because nothing here cares if
m_sISpoofFile is empty, we just need the lock file.)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter cd78225482 Don't expand ~ in ISpoofFile
This way, we can write the original value back to the config. Also, this "fixes"
a bug because webadmin didn't do this step.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter fbd8d69c50 Partly revert commit 7784492
"Don't force --foreground when compiled with --enable-debug"

Instead, this is now wrapped in an #ifdef ALWAYS_RUN_IN_FOREGROUND, so that I
can use ./configure CXXFLAGS="-DALWAYS_RUN_IN_FOREGROUND".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 13:51:58 +01:00
Uli Schlachter 4faad67f81 admin: Allow omitting of the user name with some commands
This changes admin to assume that an "empty username" was specified if some
arguments is empty which shouldn't be empty. This empty username is then
interpreted as meaning the current user.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter 3f0e200073 Admin: Add functions for listing/adding/removing CTCP replies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter c1bb18b9e8 Add CUser::DelCTCPReply()
This function is the counterpart for CUser::AddCTCPReply(). Guess what? It
removes an entry from CUser::m_mssCTCPReplies again! It's magic!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter 2ccafaf516 Add CTable::empty
It shouldn't make any real difference (especially not for std::vector), but
"empty()" is better than using "size() == 0".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter e7fc8fa907 CUser::AddCTCPReply(): Reject CTCP requests containing spaces
CTCP requests can't contain spaces so it's useless to specify rules for those.

This doesn't affect any of the existing callers because those use Token(0) for
generating the first argument to this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter 4ed833abbd Remove a useless lookup
All the places that add entries to the CTCPReplies map use CString::Token(0) to
split the first token away. This means it is impossible for this to contain
spaces. Now this means that it is pointless to look up the full CTCP request in
the CTCPReplies map because it can't contain any matching item.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter cc552fb3f5 Update to latest Csocket
We are using a vanilla version of Csocket again. Previously, our copy of
Csocket.h had a new '#include "zncconfig.h"'.

The other changes are mostly cleanup for various compiler warnings. The switch
from inet_ntoa() to inet_ntop() is for thread-safety reasons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 11:56:39 +01:00
Uli Schlachter 32e89efa95 Fix some minor spelling weirdness
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 10:46:53 +01:00
Uli Schlachter 2dcf79cedc Move modtcl into modules/
If you did ./configure --enable-tcl, tcl wasn't actually enabled because
--enable-extra was missing, That's less than optimal.

Just moving modtcl out of modules/extra solves this problem.

Big thanks go to zynox/kylef for noticing this!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-17 17:45:46 +01:00
Uli Schlachter a533066dc6 Call modules for /MODE done by not-in-channel nicks
When ChanServ ops someone in a channel without joining first, znc didn't call
modules for this event, because it couldn't figure out a CNick* instance to use

Instead, the module hooks are now executed with a temporary CNick instance which
is created by CIRCSock anyway.

Big thanks to Robby for reporting this and helping me test it!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-16 12:53:06 +01:00
Uli Schlachter 86c0e97c85 .gitignore: Add some more rules
This now also ignores the generated files due from modpython and modperl and
some more fun.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-14 17:19:29 +01:00
Uli Schlachter 2d27386ced Merge branch 'ignore' of https://github.com/kylef/znc 2011-02-14 17:10:41 +01:00
Uli Schlachter b37e239328 webadmin: Allow admins to ignore MaxBufferSize
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-14 14:56:09 +01:00
Uli Schlachter 0d928cd3c7 Make the output of "/znc help" smaller
The explanation for the arguments for AddPort and DelPort can still be reached
via e.g. "/znc addport". Removing this makes the output from /znc help a lot
smaller.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-14 14:53:34 +01:00
Uli Schlachter d728fb98cc Remove some outdated comment
Since b359f968 / r2171 this comment is outdated, but someone (*cough*) forgot to
remove it back then.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-14 14:23:20 +01:00