Commit Graph

743 Commits

Author SHA1 Message Date
J-P Nurmi 31ba15d686 CClient::ReadLine(): use CMessage 2015-08-31 00:24:30 +02:00
J-P Nurmi e5b7f2c6df Make CBufLine hold a CMessage internally 2015-08-31 00:24:30 +02:00
J-P Nurmi f1dead9ff3 Add OnUserXxxMessage(CXxxMessage) module hooks 2015-08-30 15:50:12 +02:00
J-P Nurmi 82375eed65 Add CMessage::Clone()
Due to (intentional) lack of CFooMessage::operator=(CMessage), it was
a bit clumsy to do such copy-conversions:

    CMessage Copy = Message;
    CJoinMessage& JoinMsg = static_cast<CJoinMessage&>(Copy);
    // ...

vs.

    CJoinMessge JoinMsg;
    JoinMsg.Clone(Message);
    // ...

Alternatively, copy ctor(CMessage) and assignment operator=(CMessage)
could have been added to all CMessage subclasses. I've been trying to
avoid that, to make these operations very explicit. It has helped a
lot so far by preventing accidental copies.
2015-08-30 15:50:12 +02:00
J-P Nurmi 320abef756 Merge CChanMessage & CPrivMessage to... CTextMessage
This naming is a bit hairy. I chose CTextMessage because this type of
message carries a text argument. Alternatively, it could be also called
CPrivateMessage, because the IRC protocol calls it PRIVMSG. On the other
hand, ZNC module hooks use the "Priv" naming convention for private
messages. It would look a bit weird to have OnChanMsg(CPrivMessage)...

More details and reasoning of the merge in the previous commit message.
2015-08-30 15:50:12 +02:00
J-P Nurmi 3976651c35 Merge CChan+PrivAction, CChan+PrivCTCP, CChan+PrivNotice
OnUserAction(), OnUserCTCP(), and OnUserNotice() don't separate private
private and channel messages. A module could even redirect a message by
modifying its target, so technically, if they were two distinct types,
the type of a message could change on the way.

The original reason for the separation was that at some point during
CMessage development, GetChan() didn't exist in CPrivXxx, but only in
CChanXxx message types. To achieve cleaner implementation, the getter
was later promoted to CMessage and made return nullptr for non-channel
specific messages. From this point of view, the separation is also no
longer necessary since the CPrivXxx and CChanXxx types are API-wise
identical with each other.
2015-08-30 15:50:12 +02:00
Edoardo Spadolini 39d373c971 Add an %empty% substitution in ExpandString that expands to the empty string.
This can be useful in various situations, for instance for quit messages.
2015-08-29 23:33:10 +02:00
J-P Nurmi 068d5af719 Merge branch '1.6.x' 2015-08-29 21:16:33 +02: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 37cd61a667 Fix CMessage to prefix also empty last params with a colon 2015-08-27 12:33:47 +02:00
Alexey Sokolov 9688727f32 Add a possibility (not an "option") to disable launch after --makeconf
See #257
2015-08-24 21:22:14 +01:00
J-P Nurmi 478f1952b7 Fix #1040: recent CMessage changes break modules 2015-08-23 12:48:17 +02:00
Alexey Sokolov 672e8c5731 Add OnRawMessage() 2015-08-23 00:52:27 +01:00
J-P Nurmi 2ad2ee5620 Bring back the smileys - part II 2015-08-22 11:54:33 +02:00
J-P Nurmi 66053e24ff Add CZNC::GetNetworkTrafficStats() 2015-08-22 01:27:23 +02:00
J-P Nurmi 38fb4cc444 Calculate per-network traffic (#963) 2015-08-22 01:27:23 +02:00
J-P Nurmi b402c1e582 Merge branch '1.6.x'
Conflicts:
	src/IRCSock.cpp
2015-08-22 00:18:55 +02:00
J-P Nurmi b8088a5b02 Fix CMessage::ToString() to ':' -prefix the last param when appropriate
Close #1037
2015-08-21 22:08:16 +02:00
Alexey Sokolov e546cedaa2 Merge pull request #1035 from jpnurmi/server-time
Make ZNC request server-time when available (close #839)
2015-08-20 22:31:24 +01:00
J-P Nurmi 2e85eff2fd CQuery: fix buffer playback
A regression caused by d0a58ff. Unlike for CChan, from which the
snippet was copy-pasted, for CQuery the params actually need to be
passed. Otherwise buffer playback PRIVMSGs have empty target nick.
2015-08-18 12:59:21 +02:00
J-P Nurmi 1f11b10b70 Make ZNC request server-time when available (close #839) 2015-08-18 01:42:42 +02:00
J-P Nurmi d19a040f2d Remove flawed Add/Del/List/BindHost(s) (close #983) 2015-08-17 15:35:29 +02:00
J-P Nurmi d0a58ff239 Pass CMessage to buffer playback hooks 2015-08-15 13:03:56 +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 ff181a4a85 Add specialized types and hooks for the most common msgs
PRIVMSG, NOTICE, JOIN, PART, QUIT, NICK, KICK, TOPIC
2015-08-15 12:27:06 +02:00
J-P Nurmi 50ab019901 CIRCSock::ReadLine(): use CMessage as a helper 2015-08-15 12:27:04 +02:00
J-P Nurmi a06bf1c985 Introduce a Message type (#506) 2015-08-15 12:26:16 +02:00
J-P Nurmi 51caa5c4cf Add CUtils::ParseServerTime() 2015-08-15 12:26:16 +02:00
J-P Nurmi 2417ca68a8 Prefer Contains() over find() != npos 2015-08-14 13:55:11 +02:00
J-P Nurmi 6a6fbab342 Replace Right(1)[0] with back() 2015-08-14 13:52:14 +02:00
J-P Nurmi 21ed56f46a Prefer EndsWith(s) over Right(n) == s 2015-08-14 13:52:12 +02:00
J-P Nurmi 4995e7517e Prefer StartsWith(s) over Left(n) == s 2015-08-14 13:51:44 +02:00
J-P Nurmi 52395fad5e Prefer TrimSuffix() over Right() + RightChomp() 2015-08-14 12:31:01 +02:00
J-P Nurmi 475acd8f00 Prefer TrimPrefix() over Left() + LeftChomp() 2015-08-14 12:29:42 +02:00
J-P Nurmi 0220979ccf Fix #124: OnChanMsg(): nick doesn't have perms 2015-08-11 23:29:19 +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 e93c37fc6b Cleanup extra semi-colons 2015-08-07 22:00:08 +02:00
Alexey Sokolov 71fc592bfa Merge pull request #1019 from jpnurmi/ssl
CZNC: add missing SSL-related getters and setters
2015-08-07 09:26:43 +01:00
Gustavo Zacarias 9a51195e91 Add <time.h> includes where appropiate
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
2015-08-06 11:20:54 -03:00
J-P Nurmi a13b4a8e46 CZNC: add missing SSL-related getters and setters
- SSLCiphers
- SSLProtocols
- SSLCertFile
2015-08-05 01:05:46 +02:00
J-P Nurmi dce289a5d4 CUser: add API for removing and clearing allowed hosts 2015-08-04 16:09:27 +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 b16faf5058 Merge pull request #990 from jpnurmi/reset
Allow reseting channel specific AutoClearChanBuffer & Buffer settings
2015-08-01 12:30:36 +02:00
J-P Nurmi 824cb3cc56 Merge pull request #1011 from jpnurmi/disconkick
src/IRCSock.cpp: use *status as kicker
2015-08-01 01:02:14 +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
J-P Nurmi 53d9161b20 Merge pull request #998 from jpnurmi/buffer
Resolve #967: separate chan & query buffer size settings
2015-07-31 22:51:03 +02:00
J-P Nurmi ef06901966 Merge pull request #996 from jpnurmi/account-notify
Add support for account-notify and extended-join
2015-07-31 21:50:36 +02:00