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>
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>
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>
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>
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>
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>
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>
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>
Instead of sending a single JOIN line for each channel, znc now tries to stuff
all of the channel that it has decided to join into a single JOIN command.
Apparently this helps with some IRCds which decide when to flood someone off
based on the number of lines received, not based on the number of bytes.
Let's hope for the best...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2182 726aef4b-f618-498e-8847-2d620e286838
Once Upon A Time, this was the only mechanism that throttled users that wanted
to connect to IRC servers. ConnectDelay and ServerThrottle now do a much better
job on this problem.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2174 726aef4b-f618-498e-8847-2d620e286838
While a user is connecting to an IRC server, the CUser instance didn't know
about the CIRCSock instance (due to historic reasons). This meant that we needed
to use FindSockByName() when we had to check if there is any CIRCSock associated
with this user. However, this is a bad idea since FindSockByName() is O(n) on
the number of sockets that the socket manager is managing.
Instead, we now already set CUser::m_pIRCSock when the CIRCSock is created so
that checking for an irc socket becomes O(1).
This was inspired by the results of profiling a znc instance with 900 users.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2171 726aef4b-f618-498e-8847-2d620e286838
"virtual host" seems to be confusing to users since they wonder why
i.am.superman doesn't work. Let's rename this to "bindhost" and perhaps it
becomes clearer what this setting does.
Thanks to SilverLeo!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2113 726aef4b-f618-498e-8847-2d620e286838
If you have 10 servers in your server list and you want to directly jump to e.g.
irc.foo.bar, you can now do "/znc jump irc.foo.bar".
Thanks to PsWii60 for constantly bugging me for this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2109 726aef4b-f618-498e-8847-2d620e286838
Thanks to vBm for running cppcheck against znc and sharing the results.
This should fix all the "foo can be const" messages.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2081 726aef4b-f618-498e-8847-2d620e286838
Previously, /znc setbuffer had a hardcoded limit of 500, other ways of setting
the buffer size didn't have any limit built-in.
This patch makes that limit configurable and makes sure the various places
honour it.
Thanks to DarthGandalf for the idea with the bForce argument, I were too
small-minded to come up with it myself. :(
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2020 726aef4b-f618-498e-8847-2d620e286838
At the beginning of lines, one uses tabs for indenting. In the middle of the
line, you use spaces. If you want two different lines to line up with each
other, you start them with the same number of tabs and use spaces for the rest
of the indenting in the "other" line.
Really, that's how one does it!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1963 726aef4b-f618-498e-8847-2d620e286838
Sets the internal "automatically connect" flag just like /msg *status connect and
/msg *status disconnect do. Idea by Advis0r, thanks!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1851 726aef4b-f618-498e-8847-2d620e286838
That way, user modules can write stuff to the user section, too.
OnWriteConfig() is still a global module call. A later commit will have to make
OnConfigLine() a user module hook...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1848 726aef4b-f618-498e-8847-2d620e286838
This broke webadmin, changed CString::Token()'s behavior possibly breaking a lot
of stuff just before a release and added an unused config entry.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1748 726aef4b-f618-498e-8847-2d620e286838
If a new client logs in and we don't have a MOTD cached, we request it via
/motd. Since the IRC server sends it to use on connect anyway, there is no point
in requesting it if there is none. (And even if there is no MOTD, we should get
a "422 MOTD File is missing" which would be cached, so still no empty MOTD
buffer)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1728 726aef4b-f618-498e-8847-2d620e286838
This means that you can now:
- turn off the message (it's even off by default until you load the module)
- have the message sent to you as a notice instead of a privmsg
- restrict messages to previously unseen client ip addresses only (no more spam on sucky connections)
- be notified of disconnecting clients if you want to.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1698 726aef4b-f618-498e-8847-2d620e286838
Without this, after you cloned a user via e.g. the admin modul, it would still
write to the datadir of the old user.
Patch by flakes, thanks a lot.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1686 726aef4b-f618-498e-8847-2d620e286838
If strftime() returns 0, the buffer we passed to it shouldn't be touched at
all, because it's not guaranteed to be null-terminated.
Someone (*cough*) already tried to fix this in r1394, but failed badly.
Thanks to DarthGandalf for spotting this and providing a patch.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1671 726aef4b-f618-498e-8847-2d620e286838