Commit Graph

140 Commits

Author SHA1 Message Date
J-P Nurmi 69f1138052 CClient::PutClient(): handle away-notify and account-notify 2015-09-20 23:22:02 +02:00
J-P Nurmi 7f03484899 CClient: add ATTACH command
The main benefit is that (unlike JOIN) ATTACH allows wildcards.
It's also nicely symmetric with DETACH.
2015-09-10 01:12:19 +02:00
J-P Nurmi 832430659f CClient: share the chan detaching code 2015-09-10 01:12:19 +02:00
J-P Nurmi 7916efa997 CClient: share the chan matching code 2015-09-10 01:12:19 +02:00
J-P Nurmi 77ddb3c420 CClient::ReadLine(): use CMessage::GetType() 2015-09-07 00:00:25 +02:00
J-P Nurmi b95f1f7fbf echo-message: status/module should echo before replies (#1022) 2015-09-06 10:45:42 +02:00
J-P Nurmi ce0ddd3aac Merge pull request #1059 from jpnurmi/networklesshooks
Don't require network for OnUserXxxMessage() hooks
2015-09-04 23:29:49 +02:00
J-P Nurmi 0faafbf3bf Merge pull request #1056 from jpnurmi/handlecap
Implement CClient::HandleCap() using CMessage (ref #1013)
2015-09-04 20:49:11 +02:00
J-P Nurmi 81e6d0bbf2 Don't require network for OnUserXxxMessage() hooks
- OnUserJoinMessage()
- OnUserPartMessage()
- OnUserTopicMessage()
- OnUserActionMessage()
- OnUserCTCPMessage()

Supersedes #503
2015-09-02 23:46:05 +02:00
J-P Nurmi 2a40c355f4 Fix #1022: Status and module commands not echoed back to client 2015-09-02 20:15:15 +02:00
J-P Nurmi 453401eef4 Implement CClient::HandleCap() using CMessage (ref #1013) 2015-09-02 00:08:43 +02:00
J-P Nurmi 31ba15d686 CClient::ReadLine(): use CMessage 2015-08-31 00:24:30 +02:00
J-P Nurmi 8a7c79bb78 Pass known/compatible tags to clients 2015-08-15 12:33:23 +02:00
J-P Nurmi c17c8c022b Buffer message tags and the original timestamps 2015-08-15 12:28:38 +02:00
J-P Nurmi 4995e7517e Prefer StartsWith(s) over Left(n) == s 2015-08-14 13:51:44 +02:00
Alexey Sokolov a3f748448e Merge branch '1.6.x' 2015-08-11 21:32:33 +01:00
J-P Nurmi 45183612c8 Fix CClient::GetNickMask()
A regression introduced by cebc093. A potentially empty network
specific bind _host_ should not be used as nick mask _ident_.
2015-08-11 14:06:41 +02:00
J-P Nurmi d6d57cb708 Merge branch '1.6.x' 2015-08-01 12:44:06 +02:00
J-P Nurmi ad99d5f46e Merge pull request #1013 from DarthGandalf/cap-end
Support "CAP :END"
2015-08-01 12:33:26 +02:00
J-P Nurmi 015a8f6502 Merge branch '1.6.x'
Conflicts:
	src/Client.cpp
	znc-buildmod.in
2015-07-31 23:56:04 +02:00
Alexey Sokolov 89e99bfe35 Support "CAP :END"
Thanks to jaybe for complaining about this.
2015-07-30 22:01:11 +01: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