Commit Graph

70 Commits

Author SHA1 Message Date
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
KindOne
8c6b4b8d21 Correct two typos. 2013-09-18 00:26:37 +04:00
Kyle Fuller
e7ff40f785 Fix a crash when you delete a user with more than one attached client
Fixes #403
2013-09-17 18:55:22 +02:00
Alexey Sokolov
894e0a2f18 Return old fakeonline module as modules_online
It was accidentally dropped in 0.207 because of the confusing name,
it looked too much like antiidle module.

Instead, this module tells broken clients like Colloquy that *status and
*module are "online". Otherwise those clients require user to always
prepend messages to *module with "/msg *module", even if the window of
*module's query is active.

Also fix the module to support network modules
2013-09-01 22:21:11 +04:00
Alexey Sokolov
b2dcad5fd4 Change ZNC license to Apache 2.0
The following people agreed with the change, in alphabetical order:
(people who approved in several ways are listed only once)
By email:
- Adam (from Anope)
- Austin Morton
- Brian Campbell
- Christian Walde
- Daniel Holbert
- Daniel Wallace
- Falk Seidel
- Heiko Hund
- Ingmar Runge
- Jim Hull
- Kyle Fuller
- Lee Aylward
- Martin Martimeo
- Matt Harper
- Michael J Edgar
- Michael Ziegler
- Nick Bebout
- Paul Driver
- Perry Nguyen
- Philippe (cycomate)
- Reuben Morais
- Roland Hieber
- Sebastian Ramacher
- Stefan Rado
- Stéphan Kochen
- Thomas Ward
- Toon Schoenmakers
- Veit Wahlich
- Wulf C. Krueger

By IRC:
- CNU
- Jonas Gorski
- Joshua M. Clulow
- Prozac/SHiZNO
- SilverLeo
- Uli Schlachter

At https://github.com/znc/znc/issues/311 :
- Alexey Sokolov
- Elizabeth Myers
- flakes
- Jens-Andre Koch
- Jyzee
- KindOne/ineedalifetoday
- Lee Williams
- Mantas Mikulėnas
- md-5
- Reed Loden

At the last few pull requests' comments:
- Allan Odgaard
- Jacob Baines
- Lluís Batlle i Rossell
- ravomavain
- protomouse

The following commits' authors didn't respond:
Trivial changes:
- f70f1086fd
- 4ca8b50e45

The changes which are not presented in master anymore:
- 5512ed2ea0
- 960a4498f7
- 0f739de2c0
- 7f53cc810b

Fix #311
Fix #218
2013-06-14 00:43:34 +04:00
Alexey Sokolov
a06b6495e8 Revert "Rewrite the JOIN channel logic, dropping MaxJoins"
This reverts commit db7c47f97d.

Too many joined channels at once started to cause disconnect because of
"Max SendQ Exceeded", which is not much better than previous Flood.

Now MaxJoins is 0 by default, which preserves the current behavior of
joining all channels at once. If someone experiences those disconnects
due to SendQ, they can tune MaxJoins.

Fix #329

Conflicts:
	include/znc/User.h
	modules/controlpanel.cpp
	modules/webadmin.cpp
	src/User.cpp
2013-06-09 23:39:10 +04:00
KindOne
2db7307ac3 Remove unneeded headers. 2013-03-08 01:47:57 +07:00
baines
c256116d81 Catch as references 2013-02-26 22:03:15 -05:00
Un1matr1x
3a34593359 The same procedure as last year, Miss sophie?
Same procedure as every year, James.
2012-12-31 12:44:31 +01:00
Alexey Sokolov
27eb957964 Don't disconnect networkless users without PINGing them first.
Thanks to Austin for reporting this issue.
2012-12-27 01:40:13 +07:00
Alexey Sokolov
c216c94696 Fix renaming away to awaystore for user modules.
When it was renamed, it already was a network module, and IRCNetwork got
a check for away module.
But users of 0.206 and earlier have this module loaded as user module,
they even can't have networks at all, so the renaming didn't go smooth
for them :(

It's broken in 1.0 already anyway, but users who skip 1.0 and upgrade
from older version to 1.2+ directly will be happier.

Thanks to Ammler (Marcel Gmür) for reporting it.
2012-12-20 21:41:24 +07:00
Alexey Sokolov
a0e9977264 Rename control back to controlpanel...
I shouldn't do this during beta.
2012-10-19 22:51:33 +07:00
Alexey Sokolov
4f1fd1f6db Rename controlpanel to control, fix #240
It's just a shorter name, and hopefully still not as confusing as old
"admin".

Also unrelated change: fix case of few output lines during startup.
2012-10-19 22:14:25 +07:00
Alexey Sokolov
9b2898f603 Implement setting "Max number of networks" for user.
Fix #226
2012-09-20 01:24:47 +07:00
Alexey Sokolov
38ff2a9400 Add space before AppendTimestamp for colorless lines.
Thanks to fred for reporting it.
2012-09-07 20:22:12 +07:00
Alexey Sokolov
c3f3dddddc Show loading of networks during startup.
Only modules and servers were shown, without explanation which networks
do they belong to.
2012-08-27 23:08:08 +07:00
Alexey Sokolov
395ae4fc9f Oh, I forgot to add a back-compatibility crap. 2012-08-16 21:29:07 +07:00
Alexey Sokolov
62c9ac1a0b using in headers is evil :( 2012-07-26 20:46:11 +07:00
Alexey Sokolov
2858ab4b26 Add more control codes and comments. 2012-07-05 00:29:30 +07:00
Kyle Fuller
a53d997586 Only prepend the timestamps with \0F if they use formatting
This fixes a bug with fish implementation and append timestamps
2012-07-04 16:09:02 +01:00
Alexey Sokolov
27f42d1118 Rename (non-) KeepBuffer to AutoClearChanBuffer.
It should be a less confusing name...
2012-05-09 22:32:12 +07:00
Alexey Sokolov
ca650a5eb2 Use fabs() instead of abs() for double.
Again thanks to fred.
2012-05-06 10:29:05 +07:00
Alexey Sokolov
1d4d657e23 Deprecate TimezoneOffset 2012-03-22 23:21:25 +07:00
Alexey Sokolov
f0cab46c3f Merge https://github.com/znc/znc/pull/78 (TZ)
Conflicts:
	modules/admin.cpp
	src/User.cpp
2012-03-22 22:58:46 +07:00
Alexey Sokolov
355d5feb7a Move TZ-related code to own place. 2012-03-22 22:20:41 +07:00
Kyle Fuller
db7c47f97d Rewrite the JOIN channel logic, dropping MaxJoins
Instead we fill the JOIN line up with as many channels as we can fit in
an IRC line. Rate limiting is done per command now, making MaxJoins
unnecessary.
2012-03-21 22:06:54 +00:00