Commit Graph

70 Commits

Author SHA1 Message Date
J-P Nurmi
015a8f6502 Merge branch '1.6.x'
Conflicts:
	src/Client.cpp
	znc-buildmod.in
2015-07-31 23:56:04 +02:00
J-P Nurmi
b2c83321ef Fix #1008: Channel keys get saved in a very wrong way 2015-07-27 02:06:21 +02:00
J-P Nurmi
d39b20b505 Fix sources to include their respective header 2015-07-14 19:05:23 +02:00
J-P Nurmi
089a0fd925 Add cap-notify support
This change alone doesn’t notify any capabilities to clients, but makes
ZNC itself offer cap-notify and builds the foundations for various
notifiable capabilities, such as away-notify, can be easily added.
2015-07-05 13:33:27 +02:00
Alexey Sokolov
d7a6a136db Update capability names as they are named in IRCv3.2.
Old names will be available for a while, then removed.
self-message is superseded by echo-message and will be removed in future
too.
2015-04-26 22:37:27 +01:00
Alexey Sokolov
06e365215b Remove CAP CLEAR, because it's useless, and got deprecated in IRCv3.1 2015-04-26 22:36:36 +01:00
J-P Nurmi
e3954f4824 Implement IRCv3.2 echo-message capability on the "client side"
http://ircv3.net/specs/extensions/echo-message-3.2.html

TODO: Add echo-message support to CIRCSock when IRCds start supporting it.
Manual echoing won't be necessary for networks that support echo-message.
2015-04-26 19:49:39 +02:00
J-P Nurmi
6a6bb648d1 Use member initialization lists [-Weffc++] (#270) 2015-02-28 21:59:01 +01:00
J-P Nurmi
75b210e841 Search'n'replace remaining NULL occurrences (#816) 2015-02-26 20:58: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
70c0ffb10b Use nullptr (#816)
Changes applied by 'clang-modernize -use-nullptr [...]'
2015-02-25 09:20:20 +01:00
J-P Nurmi
0485aa8033 CClient: C++11 range-based for loops 2015-02-25 07:58:37 +01:00
OGAWA Hirofumi
c6d093a53a Change to return the value from OnUserQuit() as request 2015-02-22 04:33:15 +09:00
OGAWA Hirofumi
feec20b013 Add OnUserQuit() for extending clearbufferonmsg
Add OnUserQuit() callback. On smartphone, user doesn't want to see
same lines repeatedly. But, meanwhile, user doesn't want to miss lines
when connection was lost.

To do it, this uses OnUserQuit() callback. With this callback,
clearbufferonmsg can clear buffer if user quited client explicitly.
And when connection was lost, buffer is still not cleared.
2015-02-22 04:33:14 +09:00
Alexey Sokolov
cf6ec5646b Add ZNC to CTCP VERSION reply even if client is connected.
Previously, it replied to CTCP VERSION, but only if no client is connected.

See https://github.com/znc/znc/issues/820#issuecomment-70506203
2015-01-31 10:01:27 +00:00
Jos
26e466c677 More detailed instructions on how to connect to ZNC when not yet logged in.
The message now mentions you should configure your client to automatically log you in, and also lets you know how to connect to a specific network.
2015-01-25 10:25:13 +01:00
Jos
35b5525cc1 Tell user to use PASS <username>/<network> instead of just the username.
In versions prior to 1.0, ZNC did not allow multiple networks per user. The string telling users to connect has never been changed after ZNC 1.0, and this fixes just that.
2015-01-24 11:40:51 +01:00
Alexey Sokolov
600f91f128 Fix implicit context of OnSendTo* hooks
Thanks for markus-j for reporting it
2015-01-11 17:08:00 +00:00
Falk Seidel
2e29d49a53 Welcome to 2015 2014-12-31 11:28:38 +01:00
J-P Nurmi
4a31ec57de Fix #759 - channels cannot be reattached
This was a regression caused by aed1d61 :(
2014-11-26 12:34:47 +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
8d77faa260 Allow clients to specify an ID via PASS or USER
- PASS [user[@identifier][/network]:]password
- USER user[@identifier][/network] ...

NOTE: There's a slight ambiguosity with the '@' character, which happens
to be a valid character in usernames, but also acts as a marker for the
identifier. Therefore, '@' is considered as part of the username if it's
followed by non-word characters (as in an email address), otherwise as
a marker for an identifier.

This is only an enabler for #343. The rest can be done with modules:
- managing client ID specific playback buffers
- filtering channels based on the client ID

The reason this should be part of ZNC core is that only global modules
have access to OnUnknownUserRaw(), which is needed to capture USER/PASS.
First of all, the aforementioned modules shouldn't be global. Furthermore,
it would be possible to have only one module that parsed and removed the
client ID so that ZNC core woulnd't choke.
2014-11-04 00:42:28 +01:00
J-P Nurmi
382ce76ded Add self-message support
https://github.com/ircv3/ircv3-specifications/blob/master/extensions/self-message-3.2.md
2014-11-02 16:59:17 +01:00
J-P Nurmi
ba1b1da701 Make Detach, EnableChan and DisableChan accept multiple channels
These commands now take a comma/space separated list
2014-10-26 22:18:29 +01:00
Alexey Sokolov
e337cb433d Merge commit 'refs/pull/665/head' of github.com:znc/znc 2014-10-26 12:17:31 +00: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
Alexey Sokolov
f4b8f69660 Merge pull request #689 from NuclearW/multitarget-notice+privmsg
Handle multi-receiver NOTICE and PRIVMSG
2014-09-29 23:41:14 +01:00
NuclearW
ecac78691e Handle multi-receiver NOTICE and PRIVMSG
This changes znc to handle multi-receiver messages in the same way it handles multi-channel join or parts.  This will ensure that no more than one target is ever given to a module for any given call.
2014-09-28 16:46:12 -04:00
NuclearW
73b6936d6d Add ircv3.2 batch and batch channel and query buffer playback. 2014-09-28 14:57:06 -04:00
Uli Schlachter
7704bc49d7 client auth: Switch from CSmartPtr to std::shared_ptr
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-09-12 15:12:46 +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
J-P Nurmi
76bfa99dd0 Add module hooks for raw client and server messages 2014-03-04 00:24:15 +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
Nicolas Martyanoff
f215ec602f Include the command name in ERR_INVALIDCAPCMD messages
As described in the IRCv3 Client Capability Negotiation document
(http://ircv3.org/specification/capability-negotiation-3.1).
2014-01-23 12:44:07 +01:00
Falk Seidel
f19b4caa43 Welcome to 2014 - year 10 with ZNC 2013-12-31 10:10:55 +01: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
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
Kyle Fuller
9e7110175a DETACH should support the same syntax as PART (except no message)
Closes #225, this isn't the same as #225, but `/msg *status detach` is
something different, since it supports wildcard matching.
2012-12-22 17:16:57 +00:00
Alexey Sokolov
1c8485cebe Update server-time to new specs with ISO 8601 2012-11-24 01:45:36 +07:00
Alexey Sokolov
f54d4d443f Merge commit 'refs/pull/206/head' of github.com:znc/znc 2012-11-07 21:40:37 +07:00
Alexey Sokolov
ed83ac632d Hide current impl of server-time to znc.in/ namespace
The specs are going to change to support leap seconds properly,
so ZNC implementation will need to be updated.
But it would be too big change now, when 1.0-beta is out.

So support for this capability is delayed for 1.2
2012-10-16 19:50:16 +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
27aa7036f5 Fix #117 2012-08-10 19:32:27 +07:00
Alexey Sokolov
d37cb447a0 Use gettimeofday instead of clock_gettime.
POSIX.1-2008 deprecates gettimeofday...
So perhaps it will be changed back in future.

For now gettimeofday is more portable :(
2012-08-09 00:37:16 +07:00
Alexey Sokolov
44b382c6fc Update server-time implementation to match new standard. #181 2012-08-05 09:45:48 +07:00
Austin Morton
be76679065 change PutModule to handle multiple lines if need be. fixes #205 2012-07-28 02:11:00 -04:00