Commit Graph

967 Commits

Author SHA1 Message Date
Un1matr1x 73270ff023 Welcome in 2012 2012-01-01 09:30:19 +01:00
Uli Schlachter 01341cfb0a Fix some invalid iterator uses
This fixes #96. When the last user in a partyline channel is deleted, the
channel is deleted, too. This invalidates the iterator used in OnDeleteUser().
This fix is to increase the iterator before the channel can be deleted.

After the above fix, znc still crashed due to another broken use of iterators.
When a network is deleted, it takes all its clients with it (why aren't they
just moved into the "no network"-state?"). However, deleting a CClient removes
it from the network's list of clients via CClient::Disconnect(). This resulted
in another invalid use of iterators.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-29 13:54:24 +01:00
Alexey Sokolov 6443563bd5 Python modules are network mods by default. 2011-12-29 18:58:46 +07:00
Alexey Sokolov 8bb7ea5370 Rework modperl to better integrate with perl.
Now it supports global and network modules.
Fixes github issue #82
2011-12-29 11:35:25 +07:00
Alexey Sokolov eb66e58028 autoreply: Honor RFC 2812.
There must not be autoreply for notices.

Thanks to nyuszika7h for noticing this.
2011-11-29 18:51:17 +07:00
Kyle Fuller 44a230c8b7 Remove notes on the GENERATE command in the cert module 2011-11-21 20:20:51 +00:00
Kyle Fuller b9457274bd nickserv: Use CModCommands 2011-11-21 12:10:14 +00:00
Alexey Sokolov 3fd0429e1e Python: Use znc.Socket if no socket class is specified in CreateSocket()
Thanks to Azelphur for giving this idea.
2011-11-19 11:47:47 +07:00
Kyle Fuller a36d47c947 Add {Add,Del,List}Network to *admin module 2011-11-08 19:19:20 +00:00
Uli Schlachter e5facdf557 route_replies: Handle raw 482
lahwran reported the following message from *route_replies and also figured out
which message we failed to handle, thanks!

<*route_replies> This module hit a timeout which is possibly a bug.
<*route_replies> To disable this message, do "/msg *route_replies silent yes"
<*route_replies> Last request: MODE #somesecretchannel I

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-08 19:19:20 +00:00
Alexey Sokolov 8af35e1fe5 Change the order of -I directives in Makefile.
If ZNC was already installed, it had its headers somewhere.
The chances are that something else can be installed at the same place,
including some ZNC's dependency	whose include dir would be included to
CXXFLAGS. Another possibility of including that dir is triggered when
using FreeBSD - ./configure explicitly adds -I/usr/local/include in that
case.

And so we get a directory with old ZNC headers included to CXXFLAGS
before our new shiny ./include.

With their order changed, the proper headers are included now.

Thanks to those who repored the issue, thanks to PsWii60 for helping to
track it down, thanks to my parents for creating me and therefore
enabling me to fix it, and to many other people.
2011-11-05 11:51:53 +07:00
Uli Schlachter a08ec52dbf Don't use "mkdir" during install
lahwran just showed up on irc and told us that he installed znc, but znc failed
to find any modules. The reason for this was his umask 077 which means that
"make install" installed stuff so that only root can access it.

The solution is do use "install -d" since that makes sure to ignore the
currently set umask.

However, google finds results which say that "install -d" might mess with stuff
of pre-existing directories when it shouldn't, so we must first test if the
directory already exists before calling install. Obviously, this makes our
Makefile a lot more readable. :-(

I didn't have time to test this properly, so stuff might break.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-03 09:01:13 +01:00
Uli Schlachter a66721eacb webadmin: Add a "Disabled" checkbox for channels
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-30 13:44:36 +01:00
Uli Schlachter 962c10795d Disable some more warnings on mod{perl,python}
It seems to me like swig is trying to trigger every warning that exists...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-30 13:37:11 +01:00
Alexey Sokolov c00ad1a2ff Ups, forgot to change message for python compiler. 2011-10-30 02:21:11 +07:00
Alexey Sokolov f4097e6fd5 Separate compilation and linking for modules.
To gain more benefits from distcc.
2011-10-30 02:15:26 +07:00
Alexey Sokolov cf49449dde Be able to remove servers using webadmin.
Thanks for appel for reporting this.
2011-10-30 00:47:11 +07:00
Stéphan Kochen 355f196bbe Working savebuff saving and loading.
It's even backwards compatible!
2011-10-27 19:54:23 +02:00
Stéphan Kochen c36480c8a1 Store and format time in CBufLine.
Buflines need to know which part of text to wrap with the timestamp. The
second parameter to `AddLine` (and shorthands) is that text, which after
wrapping is added as the `text` parameter to `NamedFormat`.

Timestamps are formatted at the moment buffers are flushed to the
client. The client parameter to `GetLine` provides access to the User
and the new server-time capability.
2011-10-27 18:25:25 +02:00
Stéphan Kochen c3d677a4d8 Slight refactor of CBuffer & CBufLine.
This is in preparation of adding more attributes to a CBufLine. Going
forward, at least savebuf will need access to all of these to properly
serialize buffers.

Basically, instead of relying on `GetLine()` to return `false`, the
caller is now expected to check bounds himself using `Size()`.
2011-10-27 18:25:25 +02:00
Stéphan Kochen cb4131e320 Unify channel buffers and CBuffer. 2011-10-27 18:25:25 +02:00
Stéphan Kochen 948ae2510c Rewrite Buffer to store a format string.
Will use this to allow more parameters to be inserted at the time the
buffers are flushed to the client.
2011-10-27 18:25:24 +02:00
Kyle Fuller 200940756b Update Csocket to d7206c6aa88bd7988f 2011-10-21 01:40:36 +00:00
Kyle Fuller b8c2da95f1 Make the OnInvite hook return EModRet so we can ignore invites 2011-10-21 00:20:58 +00:00
Kyle Fuller 8cce595fbe antiidle: Don't SIGABRT when receiving a line with less than 2 words
This was introduced in 232d2612fe which
tries to split a line by spaces and then tries splitted[1] and
splitted[2] which will cause a SIGABRT if the line isn't actually that
long.

This also uses the 4th argument to the 301 line to determine if this
message is because we sent a message to ourselfs. Previously the 3rd
option was used, which is always our own nick. This was resulting in any
301 line being halted.
2011-10-20 23:33:13 +00:00
Kyle Fuller 3a7d0150cf Don't include Modules.h from User.h 2011-10-19 09:56:21 +00:00
Kyle Fuller 483c8ed0d1 autoreply: check if the network is attached instead of the user
This fixes a bug where the autoreply message wasn't being sent if you
were attached to another network

Also allow loading this module as a network module
2011-10-19 09:59:35 +01:00
Kyle Fuller a8cb7697cf simple_away: check if the network is attached instead of the user
Also make simple_away a network module, so that when the timer fires we
have a network to send the AWAY lines

Fixes #77
2011-10-19 09:58:45 +01:00
Kyle Fuller 9c86f08b82 Only save a buffer in buffextras if no clients are "away" 2011-10-18 22:12:43 +00:00
Kyle Fuller bce4e60c08 Allow a client to become "away"
The result of CIRCNetwork::IsUserOnline() will only show clients which
do not have the away state set. This value is not set from the IRC
command AWAY, but a future module could use this behaviour.

Some CIRCNetwork::IsUserAttached() checks are now moved into of
CIRCNetwork::IsUserOnline() checks.

This allows "away" clients to store buffer even if KeepBuffer is false.
2011-10-18 19:26:37 +00:00
Kyle Fuller 6ae491ca66 bouncedcc should use PutUser() and not m_pUser->PutUser() 2011-10-16 23:28:54 +00:00
Kyle Fuller edaa20e59e identfile: Improve the debug messages
The new debug messages allow us to see when the identfile is unlocked
2011-10-07 11:30:31 +01:00
Alexey Sokolov f483053687 Improve admin module description. 2011-10-06 21:47:52 +07: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 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
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 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
Alexey Sokolov cd1192e01f Honor per-network nick in awaynick and keepnick. 2011-09-17 14:32:25 +07: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
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
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
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
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