Commit Graph

2580 Commits

Author SHA1 Message Date
Alexey Sokolov
ceeebf746b Fix CUser::IsUserAttached().
It honored only clients connected without any network.

Thanks to Cronus` for reporting this.
2011-09-25 02:37:00 +07:00
Kyle Fuller
4b1e7143c3 Set default TrimPrefix to ":"
Use TrimPrefix instead of if prefix then chomp, saving quite a lot of
duplicated code
2011-09-22 18:09:17 +00:00
Kyle Fuller
523deaf4e3 Clean up CClient::ReadLine 2011-09-22 18:09:09 +00:00
Uli Schlachter
4d4e6a6eb1 SHA256.cpp: Include some ZNC header first
This is required to make sure that zncconfig.h is the very first header that is
being included.

This problem was noticed by someone reporting some "macro redefined" warnings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 18:25:22 +02:00
Uli Schlachter
08cc624bcc Fork the gl_visibility macro
That macro currently was broken. It added flags to $CFLAGS but then called the
C++ compiler. The result was that ZNC didn't compile with GCC 3, because it
tried to use -fvisibility=hidden which isn't supported in that GCC version.

A list of changes done to this macro is contained in a comment.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 18:14:48 +02:00
Uli Schlachter
6f2335d529 configure.ac: Redefine AC_PROG_CC to cause errors
ZNC is written in C++ and doesn't need a C compiler. This redefine let's us
catch code which accidentally uses the C compiler.

Currently this means that we break due to gl_VISIBILITY.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 18:12:02 +02:00
Alexey Sokolov
ca476ef558 Bump version of master to 0.203
As 0.202 is being released today
2011-09-20 23:12:12 +07:00
Kyle Fuller
9e3dc0bf4e PutModule should try sending the line to all clients connected to the same network before the user clients 2011-09-18 15:09:04 +00:00
Alexey Sokolov
cd1192e01f Honor per-network nick in awaynick and keepnick. 2011-09-17 14:32:25 +07:00
Alexey Sokolov
f7919bbee3 Compare floats as floats. 2011-09-16 23:43:39 +07:00
Alexey Sokolov
b90bdf21dd Warn if config was saved in too new version. 2011-09-16 23:42:33 +07:00
Alexey Sokolov
689c330d51 Backup znc.conf when upgrading ZNC.
Now ZNC saves its version to znc.conf.
When ZNC tries to load znc.conf, it compares stored version with running
one. If the stored version is older, make a backup.
2011-09-16 23:37:30 +07:00
Uli Schlachter
e029dded0d Fix CIRCNetwork::ExpandString()
It pretty much always returned an empty string (or rather: whatever was in the
return variable before, which is an empty string in 99% of cases).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 12:02:55 +02:00
Uli Schlachter
b07f37b23d Backup znc.conf once when updating to networks
This copies znc.conf to znc.conf.backup, if that file doesn't exist yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 11:41:01 +02:00
Uli Schlachter
f97a6a8a26 Fix network module calls
These calls really should be network module calls, so this fixed
NETWORKMODULECALL() to again silently do nothing if the network is NULL.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 11:07:36 +02:00
Uli Schlachter
57c4ccf4f2 Move log out of extra
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 11:07:36 +02:00
Alexey Sokolov
425b6da770 Fix code style in Chan.cpp 2011-09-13 23:58:44 +07:00
Jim Hull
f604709cf0 rename away to autoaway to help alleviate any ambiguity as to what it does 2011-09-13 09:44:27 -07:00
Jim Hull
793c34699a rework SendBuffer fixing an issue where ClearBuffer() nuked the buffer after playing to the first client 2011-09-13 09:43:24 -07:00
Alexey Sokolov
c13148b31d Better describe what does away module do. 2011-09-13 20:46:46 +07:00
Jim Hull
4b1b346107 update module description with something more useful. Additionally added explanation at the top of the header. 2011-09-12 23:03:20 -07:00
Jim Hull
002b31d407 fixed a null reference to pClient in hooks 'OnChanBufferStarting,OnChanBufferStarting,OnChanBufferEnding,OnChanBufferEnding', such that when pClient is NULL the hooks are called on all clients associated to that user 2011-09-12 23:03:03 -07:00
Alexey Sokolov
0ccc815dd4 Merge branch 'master' of github.com:znc/znc 2011-09-13 02:49:07 +07:00
Alexey Sokolov
3947ea9cb0 Partyline compiles again! Yay!
I didn't test this fix at all.
Any crashy (or weird behavioury) feedback welcome :)
2011-09-13 02:46:54 +07:00
Alexey Sokolov
c25e24017c CString should be const& in parameters.
Especially when it's not copied inside the function.
2011-09-13 01:30:36 +07:00
Uli Schlachter
a3226c2954 Anyone seen my brown paper bag?
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 20:04:20 +02:00
Uli Schlachter
bdf0d19ce8 (Hopefully) fix all remaining module calls
This should turn all network module calls which could use NULL for the network
into user module calls. I'm not sure if this is the right thing to do, but for
now this might be the easiest fix.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 19:55:32 +02:00
Kyle Fuller
fa7ec788dd Add CIRCNetwork::ExpandString 2011-09-12 16:31:30 +00:00
Kyle Fuller
6686c0de79 Support having a nickname per network 2011-09-12 15:59:15 +00:00
Uli Schlachter
64ae6f30fb Fix ALLMODULECALL()
It didn't call network modules, so stuff like OnBoot() wasn't sent to network
modules.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 17:36:28 +02:00
Uli Schlachter
3e9ad07d85 Fix a crash with OnClientLogin()
A client doesn't necessarily have a network after logging in (e.g. could have
used an invalid network name).

This is another crash found by exoa, thanks.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 17:31:13 +02:00
Uli Schlachter
9e3019db72 Remove MODULECALL macro
Depending on which of its arguments where NULL, that macro called network / user
modules or not. While this is nice in that it avoids crashes, this behavior
actually surprised me and I'd rather have the caller explicitly say what it
wanted to do.

This macro is replaced with explicit calls to {GLOBAL,USER,NETWORKMODULECALL}.

Since there are actually module calls which do provide a CClient*, but may
happen before login (OnUnknownUserRaw() and the 3 CAP hooks), those are changed
to get the client pointer as their first argument. This should make it more
obvious that these module calls are special.

This commit should make it easier to catch bugs like the recent
OnClientDisconnected() with m_pUser == NULL.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 17:26:32 +02:00
Kyle Fuller
895d766499 Only run NETWORKMODULECALL from MODULECALL if we have a network 2011-09-12 14:32:43 +00:00
Kyle Fuller
cb604a0b0d webadmin: Show a field for the network name when someone add's a network
Finally fix this before any more people complain its broken
2011-09-12 14:20:02 +00:00
Uli Schlachter
ff35970318 OnClientDisconnect() always needs a valid user
If a client disconnected before completing the authentication,
OnClientDisconnect() was called with m_pUser == NULL. This problem is new since
previously MODULECALL silently failed if it got a NULL.

Thanks to ex0a for repeatedly crashing his znc to figure this out. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 10:50:27 +02:00
Uli Schlachter
893a631aa5 Wrap MODULECALL macros in a do-while
This makes sure that there is a semicolon after his macro call and that this
macro works correctly in an if, e.g. if (foo) MODULECALL(foo);

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-10 14:00:58 +02:00
Uli Schlachter
924381f663 Add a missing semicolon
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-10 14:00:47 +02:00
Uli Schlachter
3e913d49ec assert that we have a user/network on module calls
exoa found a bug where OnClientDisconnected() was called with m_pUser = NULL
when a client disconnected before logging in which blows up further down the
road.

This stuff should *never* be called with NULL pointers, despite the if which it
has. E.g. the above case skipped user modules, but global modules where still
called with a NULL pointer which they didn't expect nor handle for
OnClientDisconnected().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-10 11:51:29 +02:00
Uli Schlachter
1e3b73c7b2 Make the debug output for raw query line up
This adds the network name to stuff sent to clients.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-08 09:57:16 +02:00
Alexey Sokolov
fa9321ac2d Make 1st parameter of CConfig::Write() a reference.
Pointer doesn't make much sense, because File can't be NULL.
2011-09-07 02:17:42 +07:00
Alexey Sokolov
508ca27a4c Move CConfigEntry out of CConfig.
This exposes CConfigEntry to SWIG, and therefore to modperl/modpython.
2011-09-07 02:09:40 +07:00
Kyle Fuller
eb5ac35466 modpython: We are modpython not modperl 2011-09-05 21:56:18 +00:00
Kyle Fuller
b75e0b71ae modpython: Supress "Nested struct not currently supported (ignored)." warnings from 2011-09-05 21:39:59 +00:00
Kyle Fuller
855e0778ac Destroy the CIRCSock for a network when the CIRCNetwork is destroyed 2011-09-05 20:16:10 +00:00
Kyle Fuller
8945fbeb48 Check we have a network before we try to get its modules (in /msg *status listavailmods) 2011-09-05 17:38:44 +00:00
Kyle Fuller
12d1a5a422 modpython: Show (module/__init__.py) in listavailmods 2011-09-05 17:38:37 +00:00
Alexey Sokolov
9e95d1c3e1 Don't crash when loading python network modules. 2011-09-05 22:57:49 +07:00
Uli Schlachter
b9fe573814 route_replies: Improve the timeout message
Fixes #57.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-05 08:22:58 +02:00
Kyle Fuller
c6b74fa29d Fix CChan::TrimBuffer() (#63)
CChan::TrimBuffer() was trying to do "m_vsBuffer.begin() + -<some number>" which would cause a segmentation fault

Fixes #63
2011-09-04 19:18:26 +00:00
Uli Schlachter
dbf8c2705e Upgrading to networks: Slightly rephrase a message
Someone was confused by the "[user]" part since he expected his username to be
printed there. The fix: Just remove that part.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-04 21:02:42 +02:00