Commit Graph

44 Commits

Author SHA1 Message Date
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
Toon Schoenmakers
98ceafb1ba Replaced the GetNick().Equals() with NickEquals() where possible
Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 22:35:49 +02:00
Toon Schoenmakers
9166f5a250 Renamed IsNick to NickEquals
Also added a TODO to add proper IRC case comparing.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 18:36:03 +02:00
Toon Schoenmakers
83b9a28e4c Implemented a nick compare function
As suggested by the todos in IRCSock, added IsNick(CString) method
so the ugly Nick.GetNick().Equals(GetNick()) could be simplified.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 17:22:16 +02: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
Uli Schlachter
999cc085d2 Revert "Add 381 to the buffer (You are now an IRC Operator)"
This reverts commit 11e5f7636d.

Having this in the raw buffer multiple times is obviously wrong, because you can
use /oper more than once and would get a new 381 numeric each time. So this
would need to use UpdateRawBuffer() instead of AddRawBuffer() (=replace old
entries with the same text).

However, this is still wrong. If you -o yourself, you no longer have oper
status. ZNC wouldn't notice this and still deliver the 381 numeric to new
clients.

Clients which use raw 381 to detect oper status will have to switch to user mode
+o.

Thanks to Han` for reporting this problem.
2013-05-14 18:30:40 +02:00
Uli Schlachter
9b23ee60b8 Debug: Only print queued lines if they are really just queued
Previously, every line that was forwarded to the IRCd was printed twice in debug
mode. Once when it got added to the send queue and a second time when it was
actually sent. However, most of the time this queue is empty and thus the two
events happened at approximately the same time.

Thus, this patch now changes the debug output. Lines are only printed extra if
they really have to wait in the queue for a while before they can be sent out.

This has the positive effect of making the debug output more readable, because
it is shorter and less repetitive and it makes it more obvious when znc actively
throttles the traffic that is sent out.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-05-07 20:59:38 +02:00
KindOne
2db7307ac3 Remove unneeded headers. 2013-03-08 01:47:57 +07: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
412bdb7869 Fix my fix which was supposed to fix #220
Thanks to KindOne for reporting the issue with that fix.

363 numeric was sent twice to the client for attached channels.
2012-12-25 00:28:10 +07:00
Alexey Sokolov
ebf9aebf51 Fix detached 363 too 2012-12-20 22:12:21 +07:00
Alexey Sokolov
deb38b060e Check detachedness of chans. Fix #220 2012-12-08 23:22:02 +07:00
Alexey Sokolov
978e3b7832 Fix a typo and user modes.
Thanks to KindOne for noticing it.
2012-11-22 01:32:58 +07:00
Kyle Fuller
67299ebfa8 Fix a bunch of conversion warnings #197 2012-08-14 19:31:14 +07:00
Kyle Fuller
7c1e41acc7 Don't replace our motd with a different servers motd
Fixes #167
2012-08-12 22:22:19 +07:00
Alexey Sokolov
27aa7036f5 Fix #117 2012-08-10 19:32:27 +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
27f42d1118 Rename (non-) KeepBuffer to AutoClearChanBuffer.
It should be a less confusing name...
2012-05-09 22:32:12 +07:00
Uli Schlachter
d5b84f50db Fix an dangerous substr() call
A malicious IRCd could send a WHO reply for a nick which consisted completely
out of prefix characters (thus an empty nick). In this case
std::string::find_first_of() would return std::string::npos. This argument would
make std::string::substr() throw an exception and kill the process.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-30 23:13:03 +02:00
Alexey Sokolov
e83efead26 Nicify webadmin interface for flood protection. 2012-03-22 13:22:13 +07:00
Kyle Fuller
6999c8222d ResetJoinTries once we enable a channel
Fixes #83
2012-03-21 22:25:45 +00:00
Kyle Fuller
38ce17906c Don't forward WHO replies with multi-prefix to unsupported clients 2012-03-21 15:23:16 +00:00
Alexey Sokolov
c98abf00a5 Implement protection from flood.
For ZNC-server connection
2012-03-21 19:48:26 +07:00
Kyle Fuller
11e5f7636d Add 381 to the buffer (You are now an IRC Operator) 2012-02-19 14:39:03 +00:00
Kyle Fuller
5c844cf81a Send nick changes to clients before we use call the OnNick module hook
This fixes a bug where sending anything to a client, such as with
PutModule will fail because it will refer to the new nick before the
client knows about it. The watch module did this.
2012-02-12 20:07:57 +00:00
Kyle Fuller
f5dbe86543 CTCP's with no values should not be passed to the client
Fixes #105
2012-01-17 21:40:14 +00:00
Uli Schlachter
c87e7cf5ba Update Csocket to e00323f9f18
This breaks API for Csock::SockError()!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-14 11:33:38 +01:00
Kyle Fuller
3d7d1793aa Move IRCConnectEnabled to each network instead of a global user setting 2012-01-11 14:49:17 +00:00
Un1matr1x
73270ff023 Welcome in 2012 2012-01-01 09:30:19 +01:00
Alexey Sokolov
9e047a3beb Store all 005 values in a map.
Thanks to jayne for requesting this.
2011-12-04 19:53:26 +07: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
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
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
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
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
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
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
Alexey Sokolov
2c1ca45353 Merge branch 'headers' 2011-09-28 20:15:20 +07:00
Alexey Sokolov
afeab4a9e6 Move core .cpp files to src/ 2011-09-23 03:33:13 +07:00