I think this is intended to make this more user-friendly. If it is not, well
I think this patch does exactly this, so what?
Thanks to kroimon for the patch.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1173 726aef4b-f618-498e-8847-2d620e286838
This adds a bunch of 'delete pZNC', turns some exit()s into returns
and does some whitespace fun.
kroimon (partly) gets the kudos for this, too.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1172 726aef4b-f618-498e-8847-2d620e286838
The code now just falls through to the normal bootup code.
Thanks to kroimon for this idea and also for writing this patch.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1171 726aef4b-f618-498e-8847-2d620e286838
This function displays a CTable via PutModule(), something that is often
needed. The function returns the number of lines displayed.
The idea for this function is from the user-contributed admin module
by Sebastian Ramacher. Thanks.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1168 726aef4b-f618-498e-8847-2d620e286838
The only difference between MODUNLOADCHK and GLOBALMODCALL and between
MODHALTCHK and GLOBALMODHALTCHK was that the one used CModule while the other
one used CGlobalModule.
Create two new macros that expects the class name as an extra parameter and
make all those other macros just call these two.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1166 726aef4b-f618-498e-8847-2d620e286838
The Makefile only compiles this module if it is enabled.
I think it's better to error out if for some reason this doesn't work instead
of silently producing an empty modperl.so.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1165 726aef4b-f618-498e-8847-2d620e286838
g++ 3 doesnt like map<>.at().
This changes how CTable stores its data internally.
This *might* be faster than the older system.
Thanks to kroimon for finding this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1163 726aef4b-f618-498e-8847-2d620e286838
OnModCTCP(), OnModCommand() and OnModNotice() are now called through a
preprocessor macro that does all the magic. This fixes a couple of bugs:
- the m_pUser member of global modules for OnModNotice() was wrong
- OnModCTCP() wasn't called for global modules
- Finally handle 'throw UNLOAD' for all of this three module calls
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1162 726aef4b-f618-498e-8847-2d620e286838
CTable now caches the width of each column instead of recalculating it
each time it is needed. The code for this was there before, but it was not
used. Now the widths are calculated when the table is filled, not when the
width is needed the first time.
This caching leads to a huge speedup (3-4 times faster) if there are many rows
in the table.
This also cleans up the interface by making it possible to mark
GetColumnWidth and GetLine as const.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1160 726aef4b-f618-498e-8847-2d620e286838
Due to the recent change that ZNC calls SetIsOn(true) when we receive the JOIN,
not the 'end of names' reply, the nick list of a channel was always ignored.
This fixes this bug.
Thanks to cnu for using a svn version and reporting this bug. :)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1154 726aef4b-f618-498e-8847-2d620e286838
When our primary nick is already taken, we try a couple of different nicks in
order to be able to connect to the IRC server. This code is now in an
own function.
BTW: CIRCSock::Readline() is still waaay too long.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1149 726aef4b-f618-498e-8847-2d620e286838
This also contains some minor changes to the code. One of those is that we now
also handle namesx and uhnames for channels we don't know.
BTW: CIRCSock::ReadLine() is waaay too long.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1148 726aef4b-f618-498e-8847-2d620e286838
The old code used a timer. That timer needed to be restarted if the user list
was changed (adding / removing of users), because it saved an iterator into
that map between runs, which would become invalid.
The new code in CConnectUserTimer::RunJob() is actually more complicated now,
but the iterator is gone. This also means no need to restart that timer
more or less always. ;) (This also means one theoretical source of bugs less)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1143 726aef4b-f618-498e-8847-2d620e286838
This was found via default channels (LoadModule = partyline ~#chan).
- Always use a valid (=non-empty) server name
- If a user is not connected to IRC, all clients might have a different idea of
the current nick. Handle this for SendNickList() via a new function
PutUserIRCNick() that uses the irc nick if we are connected to IRC and else
correctly uses the nick that clients thinks it curretnly has.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1141 726aef4b-f618-498e-8847-2d620e286838
This moves some calls from the raw 366 handler to the JOIN handler and it might
even fix a bug (well, which no one would ever have triggered).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1140 726aef4b-f618-498e-8847-2d620e286838
This also removes all the code catching those exceptions. There was nothing
which justified these exceptions and removing them doesn't hurt.
ByeBye CException::EX_BadModVersion
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838
We now close the write end of the pipe that serves as stdin for the apps
we run. This means that any read attempts will return EOD (read() returns 0)
which should hopefully tell our apps that we don't have stdin for them.
Sadly vim doesn't care... (Only thing I tested that still broke)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1136 726aef4b-f618-498e-8847-2d620e286838
We already have a special function for stripping of special chars, so
why does the shell module still do it 'by hand'?
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1135 726aef4b-f618-498e-8847-2d620e286838
The recent removal of CUser::m_bIRCConnected lead to a bug here which is now
fixed.
In addition to this, this function now also works properly for users without
a vhost.
Oh and in User.cpp: Make sure CUser::GetIRCServer() returns an empty string
when we are no longer connected to an IRCd.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1134 726aef4b-f618-498e-8847-2d620e286838
This function didn't properly check it had a valid iterator *before* using
this iterator (.begin()->second).
Now we first check if that iterator is valid (size() is *not* zero) before we
run this. No behaviour is changed, but the bug is gone. Yay. ;)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1133 726aef4b-f618-498e-8847-2d620e286838
getresuid() is a non-standard extension and is actually not defined on
some (older) boxes. Since we gain nothing with also checking the saved user id,
we can use this instead and, voila, znc compiles again.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1132 726aef4b-f618-498e-8847-2d620e286838
CUser::GetIRCSock() != NULL is the replacement. This is a small chance in
sematics. Before this, a user only counted as connected to IRC when the 001
numeric was received. Now it already counts as connected when the connection
was established. This change doesn't hurt any of the current users of
CUser::IsIRCConnected() and so this change should be fine.
Yay, one var less ;)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1131 726aef4b-f618-498e-8847-2d620e286838
These changes the format of the 'Pass' config option. The old format is
still accepted. The new format is:
Pass = plain#<plain text password>
Pass = md5#<password hash>
Pass = md5#<hash of password with salt appended>#<salt>#
This also makes ZNC only write configs in the new format.
znc --makeconf and znc --makepass now always generate salted hashes.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1127 726aef4b-f618-498e-8847-2d620e286838
Any library the znc binary links to is automatically available to modules.
So there is no point in linking modules to @LIBS@ as znc is linked against
those already. modules/Makefile.in already does it this way, not also
znc-config does it
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1126 726aef4b-f618-498e-8847-2d620e286838
This defines was added in rev 586 saying it's needed for 'older BSD boxes'.
I don't know how old 'old' is in this context, but since we don't compile
on FreeBSD 4 anyway (which really is old), because getopt_long is missing
(added in FreeBSD 5), we should give this a try.
I have no FreeBSD 5 box for testing if znc compiled/compiles there, so
suprise me!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1125 726aef4b-f618-498e-8847-2d620e286838
Trim() always removes all trailing and leading spaces and line endings from
that string, so there is no point in this main loop. It will always run once,
anyway.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1124 726aef4b-f618-498e-8847-2d620e286838