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#151Fix#366
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>
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
- 7f53cc810bFix#311Fix#218
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.
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>
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>
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.
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.
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.
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.