Commit Graph

71 Commits

Author SHA1 Message Date
Alexey Sokolov
c8edabb035 Fix memory leak when reading invalid znc.conf
Found by https://scan.coverity.com/
2015-10-30 14:36:01 +00:00
J-P Nurmi
d2c462ae03 Fix yet another startup failure with awaynick & simple_away
The detection whether simple_away is already on the list of loaded
modules failed when the simple_away load line contained arguments.

Close #954
2015-08-29 21:13:52 +02:00
J-P Nurmi
7345a6ee3a Fix CIRCNetwork::FindChans() and FindQueries() to be case-insensitive
The playback module failed to clear a buffer, because it tried to
clear "NickServ" whereas ZNC had internally stored it has "nickserv".
2015-02-19 08:45:58 +01:00
Falk Seidel
2e29d49a53 Welcome to 2015 2014-12-31 11:28:38 +01:00
Alexey Sokolov
8bc433a576 Convert fingerprint to lower case when adding it. 2014-12-14 10:33:57 +00:00
Alexey Sokolov
c8f49e1da0 Merge pull request #754 from jpnurmi/ready
Add CClient::IsPlaybackActive()
2014-12-04 21:56:13 +00:00
Alexey Sokolov
6d7458c678 Merge branch 'ssl' 2014-12-02 21:24:49 +00:00
J-P Nurmi
efe1e1ee91 Add CClient::IsPlaybackActive()
To let modules know whether a client is currently in playback mode.
The clientbuffer module (#343) wants to update "last seen message"
timestamps in OnSendToClient() but it must avoid doing that while
in playback mode.
2014-12-01 11:47:24 +01:00
Alexey Sokolov
4442af724f Validate TLS certificate of IRC server.
Fix #156
2014-11-29 14:25:15 +00:00
J-P Nurmi
80b799cec0 Pass timestamp to playline hooks
This allows implementing timestamp-based (eg. client specific - #343)
filtering of playback buffers. For clients that don't support server-time,
getting an accurate timestamp out of a raw buffer playline is impossible.
2014-11-27 20:45:35 +01:00
Alexey Sokolov
eedeb07cfe Merge pull request #752 from jpnurmi/findclients
Replace CIRCNetwork::FindClient() with FindClients()
2014-11-19 21:42:53 +00:00
J-P Nurmi
d308d727f7 Replace CIRCNetwork::FindClient() with FindClients()
FindClient() is not enough, because there are no restrictions to used
identifiers. They don't necessarily need to be unique, and the same
identified client might re-connect meanwhile a ghost connection is
still hanging there.
2014-11-19 19:12:22 +01:00
J-P Nurmi
aed1d61a98 Revise CChan::JoinUser() & AttachUser()
The old AttachUser() that sent JOIN without topic or names replies
would leave clients in incomplete/broken state. JoinUser() was doing
two things; depending on passed arguments it was either joining user
on the channel on IRC, or attaching clients (properly). Now JoinUser()
joins the user on IRC, and AttachUser() attaches as expected from the
method names.
2014-11-10 22:24:34 +01:00
J-P Nurmi
20c9b19328 Add CIRCNetwork::FindClient(const CString& sIdentifier) 2014-11-04 00:42:31 +01:00
Alexey Sokolov
a888d38511 Merge pull request #704 from jpnurmi/joindelay
Configurable join delay
2014-10-19 23:57:22 +01: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
78a0331daa CIRCNetwork: add support for join delay (resolves #586) 2014-10-15 22:24:39 +02:00
J-P Nurmi
eaf2d737d7 Add CIRCNetwork::LoadModule() helper
Makes it easier to retry loading replacement modules when
loading retired modules fail.
2014-10-14 22:17:52 +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
fb99593f75 Allow network specific quit messages (resolves #273) 2014-09-13 23:40:22 +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
Alexander Færøy
db0e0995e2 Add OnJoining module hook.
This patch adds an OnJoining module hook that allows a module to allow
or disallow joining any given channel.
2014-05-29 23:10:30 +02:00
Alexey Sokolov
0952ee82e0 Don't set ConnectDelay to zero 2014-04-26 16:45:04 +01:00
J-P Nurmi
ed25ca21e6 Add CIRCNetwork::FindChans() 2014-03-02 23:24:34 +01: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
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
d5e03cb736 Fix support for /msg @#chan :hi
005 STATUSMSG defines list of characters prependable to channel name,
but we used simple modes instead.

See
https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-3.16

Fix #272

Thanks to grawity for the link to 005 docs draft, and to carrot for
testing the patch.
2013-08-29 22:31:25 +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
390957723c Fix changing client nick when client connects.
If nicks are equal, it's not changed. The problem was that equality was
checked case-insensitively.

This makes some clients which compare nicks case-sensitively think that
JOINs which we send to them, are not related to the user, it's someone
else joining. So Konversation users which have lower case version of
their IRC nick configured in Konversation settings, didn't get their
channel opened when connecting to ZNC.

Thanks to Axanon for helping to investigate the issue.
2012-12-26 00:36:49 +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
b5102355cb Add a way to move networks between users.
It should help for migrating old multiuser setup to new multinetwork
one.

Fix #217
2012-09-30 16:23:50 +07:00
Kyle Fuller
e06c3f5e88 Broken merge 2012-08-14 21:49:48 +07:00
Kyle Fuller
67299ebfa8 Fix a bunch of conversion warnings #197 2012-08-14 19:31:14 +07:00
Kyle Fuller
e54f423ace Merge pull request #204 from kylef/nick
Send a nick change to clients connecting with a different nick
2012-08-14 05:18:16 -07:00
Alexey Sokolov
27aa7036f5 Fix #117 2012-08-10 19:32:27 +07:00
Alexey Sokolov
2370567f9c Don't show message about missing motd by default.
To enable it, load missingmotd module.
Fix #202
2012-08-09 22:58:20 +07:00
Kyle Fuller
85a3115b8d Send a nick change to clients connecting with a different nick
Before we was hoping that the client was using the nick from 001, not all
clients supported this.

Closes #170
2012-07-28 03:09:08 +07:00
Kyle Fuller
721d603383 Support messages directed to specific user prefixes
Closes #195
2012-07-28 00:07:46 +07:00
Alexey Sokolov
62c9ac1a0b using in headers is evil :( 2012-07-26 20:46:11 +07:00
Alexey Sokolov
cebc093254 Per-network bind hosts.
Fix #147
2012-07-19 00:59:41 +07:00
Alexey Sokolov
f557d4b805 Rename away/autoaway module to awaystore.
Now it at least tries to explain what it does...
2012-04-15 00:06:26 +07:00