Commit Graph

95 Commits

Author SHA1 Message Date
Donal Cahill
db7e1ef162 Fix up CIDR code. 2015-12-13 15:36:35 +00:00
Donal Cahill
56c97af14b Improve code quality. 2015-12-13 12:23:08 +00:00
Donal Cahill
a5540557ac Fix another memory leak. 2015-12-13 08:10:40 +00:00
Donal Cahill
8748abb525 Try to fix memory leak. 2015-12-13 07:58:04 +00:00
Donal Cahill
d6b839ef85 Remove AI_ADDRCONFIG from CIDR IP conversion.
IPv6 tests will fail if AI_ADDRCONFIG is set. It's not really needed.
2015-12-13 07:39:10 +00:00
Donal Cahill
b4bb4fa0cd Add support for CIDR notation in allowed hosts list.
Fixes #207
2015-12-13 06:31:51 +00:00
Alexey Sokolov
16a8c77737 Replace virtual with override where possible.
Using clang-tidy
2015-12-08 20:51:50 +00:00
Alexey Sokolov
d185d6f22d clang-format: switch tabs to spaces
I like tabs, but I have to admit that spaces make source code more
consistent, because every editor/viewer tends to render tabs differently :(
2015-12-07 00:53:30 +00:00
Alexey Sokolov
33b0627d75 Add clang-format configuration.
For now, it uses tabs like before, to make the diff easier to read/check.
One of following commits will switch it to spaces.
2015-12-07 00:53:01 +00:00
Jos Ahrens
2c8baa8193 ExpandString %network%, alphabeticize ExpandString list 2015-10-08 21:39:02 +02:00
J-P Nurmi
6ad7cdb4a2 Resolve #818: "Got ZNC?" is a little weird real name 2015-09-20 23:22:01 +02:00
J-P Nurmi
2b18d6ee38 Merge pull request #1020 from jpnurmi/traffic
Calculate per-network traffic (#963)
2015-09-02 01:01:13 +02:00
J-P Nurmi
64e39aca88 Merge pull request #1049 from kerio92/appel_du_vide
Add an %empty% substitution in ExpandString that expands to the empty string.
2015-09-01 22:14:29 +02:00
J-P Nurmi
d9479189ea Merge branch '1.6.x' 2015-09-01 21:41:05 +02:00
Jos Ahrens
0b32da4ccc Always try to delete an uppercase CTCP response in DelCtcpReply
AddCtcpReply always adds an CTCP response in uppercase, it is only fair we do the same in DelCtcpReply
2015-09-01 21:37:14 +02:00
Edoardo Spadolini
39d373c971 Add an %empty% substitution in ExpandString that expands to the empty string.
This can be useful in various situations, for instance for quit messages.
2015-08-29 23:33:10 +02:00
J-P Nurmi
38fb4cc444 Calculate per-network traffic (#963) 2015-08-22 01:27:23 +02:00
J-P Nurmi
2417ca68a8 Prefer Contains() over find() != npos 2015-08-14 13:55:11 +02:00
J-P Nurmi
52395fad5e Prefer TrimSuffix() over Right() + RightChomp() 2015-08-14 12:31:01 +02:00
Gustavo Zacarias
9a51195e91 Add <time.h> includes where appropiate
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
2015-08-06 11:20:54 -03:00
J-P Nurmi
dce289a5d4 CUser: add API for removing and clearing allowed hosts 2015-08-04 16:09:27 +02:00
J-P Nurmi
496a132e32 Resolve #967: separate chan & query buffer size settings 2015-07-19 00:31:10 +02:00
Alexey Sokolov
2f65dbbc64 Integrate disconkick module to core.
Fix #968
2015-06-04 22:02:39 +01:00
Alexey Sokolov
8f9aad4580 Merge branch '1.6.x'
Conflicts:
	src/User.cpp
2015-04-28 21:44:07 +01:00
J-P Nurmi
28393c309b Fix #954: Startup failure when simple_away is loaded after awaynick 2015-04-28 21:36:25 +01:00
J-P Nurmi
5aa8b0dcef Fix copy ctor/assignment oper warnings of -Weffc++ (#270) 2015-03-07 21:54:33 +01:00
J-P Nurmi
21dc83e58f CUser: use member initialization list [-Weffc++] (#270) 2015-03-01 16:03:59 +01:00
J-P Nurmi
6a6bb648d1 Use member initialization lists [-Weffc++] (#270) 2015-02-28 21:59:01 +01:00
Alexey Sokolov
0794e602a7 Merge pull request #889 from jpnurmi/c++11
Replace some C++98isms with C++11isms (#816)
2015-02-25 22:00:06 -08:00
J-P Nurmi
84e289cc76 CUser: C++11 range-based for loops 2015-02-26 00:17:46 +01:00
J-P Nurmi
6002bd5c2b Remove unnecessary virtual keyword occurrences
This makes it convenient to 'grep virtual' and 'grep override' :)
2015-02-25 18:33:09 +01:00
J-P Nurmi
ef9939e1ec Add override (#816)
Changes applied by 'clang-modernize -add-override [...]'
2015-02-25 09:24:00 +01:00
J-P Nurmi
70c0ffb10b Use nullptr (#816)
Changes applied by 'clang-modernize -use-nullptr [...]'
2015-02-25 09:20:20 +01:00
Falk Seidel
2e29d49a53 Welcome to 2015 2014-12-31 11:28:38 +01:00
Alexey Sokolov
8930fc4d7a Don't break IRC control characters in some encodings
Fix #577
2014-12-21 17:09:59 +00:00
J-P Nurmi
14e09e1a10 Retire awaynick (resolves #661)
== built-in awaynick ==

debug output on startup:

    [ .. ] Loading network module [awaynick]...
    [ !! ] Module [awaynick] aborted: retired module - see http://wiki.znc.in/awaynick
    [ .. ] Loading network module [simple_away] instead...
    [ >> ] [/Users/jpnurmi/znc/lib/znc/simple_away.so]

loadmod client command:

    <jpnurmi> loadmod awaynick
    <*status> Module [awaynick] aborted: retired module - see http://wiki.znc.in/awaynick

webadmin description:

    retired module - see http://wiki.znc.in/awaynick

webadmin load attempt:

    Unable to load module [awaynick] [Module [awaynick] aborted:
    retired module - see http://wiki.znc.in/awaynick]

== external awaynick ==

znc-buildmod:

    $ znc-buildmod awaynick.cpp
    Building "awaynick.so" for ZNC 1.5... [ ok ]

debug output on startup:

    [ .. ] Loading network module [awaynick]...
    [ >> ] [/Users/jpnurmi/.znc/modules/awaynick.so]

loadmod client command:

    <jpnurmi> loadmod awaynick
    <*status> Loaded module [awaynick] [/Users/jpnurmi/.znc/modules/awaynick.so]

webadmin description:

    Change your nick while you are away
2014-10-18 12:12:43 +02:00
J-P Nurmi
2286291d6b Add CUser::LoadModule() helper
Makes it easier to retry loading replacement modules when
loading retired modules fail.
2014-10-18 12:11:26 +02:00
J-P Nurmi
ef4caae6d1 const correctness fixes 2014-10-03 09:14:12 +02:00
J-P Nurmi
4fe249280e Fix GetClients() const correctness
It’s dangerous to give a non-const reference to an internal
container that the API users are not supposed to modify.
2014-10-03 09:11:03 +02:00
J-P Nurmi
6457bd6dc1 Fix #680 - make channels follow user-level settings when appropriate 2014-09-30 00:34:01 +02:00
J-P Nurmi
14a534c953 Full-fledged query buffers
Store query buffers per query the same way it's done for channels.

This allows clients to implement persistent query buffers. Queries
remain open across clients and sessions until a client explicitly
sends a command to clear a (closed) query buffer.

A new config option AutoClearQueryBuffer that default to false
ensures behavioral backwards compatibility, and another config
MaxQueries protects from OOM eg. due to PM attacks.
2014-08-04 10:04:21 +02:00
Uli Schlachter
ba11b8eecf Less magic numbers for timeout settings
Currently the connection timeout handling of znc uses three magic numbers, each
of which is at least repeated in two unrelated places. This commits defines the
numbers in CIRCNetwork and makes the other places just use this number.

This also renames PING_TIMEOUT to PING_FREQUENCY because I feel that describes
this constant better.

I am not really happy about the name NO_TRAFFIC_TIMEOUT that is used for the
real timeout, but I couldn't think of a better name. PING_TIMEOUT isn't good
because that sounds like the time between sending a PING and the resulting
timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-07-14 15:33:36 +02:00
Alexander Færøy
2521d64a1c Add PING_TIMEOUT constant to CIRCNetwork 2014-06-18 21:04:20 +02:00
Alexander Færøy
299f3aa637 Split CUserTimer into CIRCNetworkPingTimer and CIRCNetworkJoinTimer
This patch splits CUserTimer into two other timers:

CIRCNetworkPingTimer: This timer sends PING messages to connected
client's and IRC servers.

CIRCNetworkJoinTimer: This timer enforces the MaxJoin setting by only
allowing a specified amount of channels to join at the same time.

JoinChans() is modified to reset the ping timer once we hit the MaxJoin.
This allows us to call it from any function without breaking the timing
logic.
2014-06-18 21:04:20 +02:00
Alexey Sokolov
cfc1227171 Drop old charset module
It didn't work well with webadmin
2014-01-25 13:50:07 +00:00
Alexey Sokolov
c0a5ecb40b Add support for character encodings
Previous commit added support of it to Csocket.
When encoding is specified, core will convert incoming messages to UTF-8,
and outgoing messages from UTF-8.
When no encoding is specified, it will do nothing to bytes, like before.
This is to be changed somewhere in future, to have UTF-8 on wire by
default too.
When encoding's name starts with *, incoming messages will be treated as
UTF-8, if it is already correct UTF-8. Otherwise, it's converted.

Fix #151
Fix #366
2014-01-25 13:50:07 +00:00
Falk Seidel
f19b4caa43 Welcome to 2014 - year 10 with ZNC 2013-12-31 10:10:55 +01:00
Alexey Sokolov
c74344f783 Fix error message for invalid network name 2013-10-20 17:51:43 +04:00
Ingmar Runge
7a1b725958 whitespace fix 2013-10-18 21:03:20 +02:00
Ingmar Runge
b5c898eaff modules: add OnAddNetwork, OnDeleteNetwork hooks. 2013-10-18 20:35:21 +02:00