Commit Graph

2598 Commits

Author SHA1 Message Date
Kyle Fuller a4aedc90d3 Create a connection queue including all the networks we need to connect 2011-10-04 15:59:28 +00:00
Alexey Sokolov 0f0591b648 Fscking perl... This fixes modperl's compilation. 2011-10-04 10:29:55 +07:00
Alexey Sokolov c86a61239e Trim spaces from end of commands to autoattach. 2011-10-04 00:30:40 +07:00
Alexey Sokolov c6464797e6 Fix shell module. It didn't send anything to user.
When the socket fires the Read event, CModule's m_pNetwork isn't set
anymore.
2011-10-04 00:00:11 +07:00
Alexey Sokolov 59c62150d4 Tell users to use user/network:pass in --makeconf 2011-09-28 21:20:21 +07:00
Alexey Sokolov 2c1ca45353 Merge branch 'headers' 2011-09-28 20:15:20 +07:00
Alexey Sokolov 187a05db40 Nick in 301 can start with : - it's IRC after all... 2011-09-25 22:19:09 +07:00
Uli Schlachter 7f6a4fb472 Update to latest Csocket
Lots of interesting stuff in here, if you want details, ask Csocket's git
history. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-25 14:08:08 +02:00
Uli Schlachter c0907f2e58 Fix visibility support
I definitely fixed this problem already when I ported the macro, so I wonder why
the fix got lost...

config.log says:

conftest.cpp: In function 'void dummyfunc()':
conftest.cpp:13:15: error: no previous declaration for 'void dummyfunc()'
[-Werror=missing-declarations]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-25 10:24:36 +02:00
Uli Schlachter 0acf0de204 Merge pull request #71 from schoentoon/master
A few new nickserv commands, little annoyance fix and a new hook
2011-09-25 01:20:14 -07:00
Toon Schoenmakers 23acbe42a6 Implemented a OnInvite hook
This hook will be called when the user get's invited into a channel
because we don't have a CChan of this channel yet this won't be send
through the hook. Instead a CString with the name of the channel is send.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2011-09-25 01:58:23 +02:00
Alexey Sokolov 2dcb3efcc3 Fix OnClientDisconnect() hook of network modules.
It wasn't called for them.
2011-09-25 03:50:53 +07:00
Toon Schoenmakers 232d2612fe This avoids your irc windows being filled with away stuff
Downside of antiidle is that because it messages yourself internally
the irc server will send messages to you when you're marked as away.
This can end up being really annoying, so those messages are blocked
with these changes.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2011-09-24 22:34:45 +02:00
Toon Schoenmakers 5248987907 Added several new features to the nickserv module
This includes a feature to ghost, which simply calls the ghost feature
of the actual nickserv. Same goes for group, recover and release.
These are called by simply doing /msg *nickserv ghost <nickname> etc.
The changes made actually explain themselves when doing something like
/msg *nickserv help. This is really just so we can be lazy and execute
nickserv commands that require a password without knowing the password
ourselves.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2011-09-24 22:18:39 +02:00
Alexey Sokolov c5578f875d Merge branch 'master' of github.com:znc/znc 2011-09-25 02:50:45 +07:00
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
Alexey Sokolov afeab4a9e6 Move core .cpp files to src/ 2011-09-23 03:33:13 +07:00
Alexey Sokolov e354c24ac1 Move ZNC headers into own directory.
Yes, this breaks backwards compatibility, so what?
It's already broken with network stuff anyway.
2011-09-23 03:31:58 +07:00
Uli Schlachter 768359277b Send a MODE request when JOINing
This kind of reverts/fixes f1cb09bd9c.

Robby found a bug with evil ChanServ which goes like this:

- You join an empty, but registered channel and the IRCd applies its default
  modes (+nt), but ZNC didn't ask for MODE, so doesn't know this.
- ChanServ applies whatever channel modes it wants to apply. This causes ZNC to
  see a mode change (e.g. +s).

The result of this is that ZNC thinks that the channel has mode +s and it will
tell every client that connects to it about this.

The fix is to send a MODE request when JOINing. To make sure that we don't
confuse clients, we block the reply.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 20:23:42 +02: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