Commit Graph

2655 Commits

Author SHA1 Message Date
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
Alexey Sokolov 2ffcbed5bb Clarify the last commit a bit using a comment. 2011-11-12 09:46:14 +07:00
Kyle Fuller 0b57b7d437 Properly handle CIRCNetwork's when we rehash
This commit does the following:
- Do not segfault on rehash
- Delete CIRCNetwork's when they are removed from config
- Update to the configs nick/altnick/realname/ident
2011-11-09 20:02:41 +00:00
Kyle Fuller 18989a21c6 Merge branch 'master' of github.com:znc/znc 2011-11-09 20:02:27 +00:00
Kyle Fuller 812ec24105 Don't forward a 670 to a client
This might result in the client switching to SSL if it supports it.
Breaking the current connection
2011-11-08 19:19:22 +00: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
Reuben Morais 7cdf42d571 Clear text colors before appending timestamps to buffer lines 2011-11-08 19:19:19 +00:00
Kyle Fuller 74738a20b7 Fix a NULL pointer issue on CChan::SaveBuff
I also cleaned up a little and loop over vClients once instead of twice
2011-11-07 16:55:55 +00:00
Kyle Fuller 94ffcbed59 Don't forward a 670 to a client
This might result in the client switching to SSL if it supports it.
Breaking the current connection
2011-11-07 16:28:12 +00:00
Kyle Fuller aa085ef38d Add {Add,Del,List}Network to *admin module 2011-11-05 20:57:22 +00:00
Uli Schlachter e607b1a559 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-05 12:17:31 +01:00
Alexey Sokolov 96eceba0df Merge branch 'master' of github.com:znc/znc 2011-11-05 12:03:58 +07: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
Alexey Sokolov 970b87a5c5 Merge pull request #85 from reubenmorais/master
Clear text colors before appending timestamps to messages
2011-11-04 05:42:55 -07:00
Reuben Morais 6ed3b27af4 Clear text colors before appending timestamps to buffer lines 2011-11-04 00:35:35 -02:00
Alexey Sokolov 0b6d609014 Fix CZNC::Broadcast...
We need a good way to speak to users, not just sending some clients some
stuff...

Thanks to Cronus` for reporting this, as notify_connect failed for him
when using broken broadcast.
2011-11-04 00:04:32 +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
Alexey Sokolov 73b980bb83 Merge branch 'master' of github.com:znc/znc 2011-11-03 10:51:22 +07:00
Alexey Sokolov 7ac4609408 Check for /usr/bin/swig2.0 too.
SWIG 2 is named that way on Debian-based systems...
2011-11-03 10:49:14 +07: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 9140a0dbd5 CZNC::WriteConfig(): Better --debug output
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-30 13:42:36 +01:00
Uli Schlachter a97abc53f7 Just some small comment explaing some craziness
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-30 13:39:34 +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
Stéphan Kochen 2fdf54d43d Add string formatting function with named params.
In addition to the formatting function, a matching Escape type is added.
2011-10-27 18:25:24 +02:00
Stéphan Kochen f7e5b41ab1 Add server time CAP and Client flag. 2011-10-27 18:25:24 +02:00
Kyle Fuller a25316710d Respond to 670 from the server by switching to TLS
If a client sends STARTTLS to the IRC server, once the IRC server responds
with a 670 then it will expect all future communications to happen over
TLS.
2011-10-21 01:44:42 +00:00
Kyle Fuller 200940756b Update Csocket to d7206c6aa88bd7988f 2011-10-21 01:40:36 +00:00
Kyle Fuller 131a06594c Macro NETWORKMODULECALL to IRCSOCKMODULECALL inside CIRCSock
This saves a lot of repetitive lines (m_pNetwork->GetUser, m_pNetwork,
NULL)
2011-10-21 00:48:00 +00:00
Kyle Fuller 7a754f4ffd Its .co.uk not .co.u in the authors list 2011-10-21 00:25:29 +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 e11d338040 Pass the nick who send an invite with the OnInvite hook 2011-10-20 23:44:03 +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 71636d2dd7 Move me to the top of authors 2011-10-19 11:24:39 +00:00
Kyle Fuller 7e5144df04 Make sure a IRCSock is authed before we use the nick
This fixes a bug where an unauthed IRC connection will cause your
clients nick to be the default nick. But this is before we update
the client to use this nick. If a client tried another nick when
connecting then they are still expecting this nick.
2011-10-19 11:24:39 +00:00
Kyle Fuller 8659d7224a Make UpdateModule reload the module for every module type
UpdateModule has been moved to CZNC because it doesn't really fit into
CUser. The new UpdateModule will reload the module for global modules,
user modules and network modules.

Fixes #69
2011-10-19 10:47:55 +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 0a56a0281b zncconfig.h has moved to include/znc
__pycache__ is now used on python3.2 for cache files
2011-10-18 19:26:45 +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