mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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.
This commit is contained in:
@@ -93,7 +93,7 @@ TEST(MessageTest, ChanCTCP) {
|
||||
|
||||
TEST(MessageTest, ChanMsg) {
|
||||
CMessage msg(":sender PRIVMSG #chan :text");
|
||||
CChanMessage& priv = static_cast<CChanMessage&>(msg);
|
||||
CTextMessage& priv = static_cast<CTextMessage&>(msg);
|
||||
EXPECT_EQ("sender", priv.GetNick().GetNick());
|
||||
EXPECT_EQ("PRIVMSG", priv.GetCommand());
|
||||
EXPECT_EQ("text", priv.GetText());
|
||||
@@ -176,7 +176,7 @@ TEST(MessageTest, PrivCTCP) {
|
||||
|
||||
TEST(MessageTest, PrivMsg) {
|
||||
CMessage msg(":sender PRIVMSG receiver :foo bar");
|
||||
CPrivMessage& priv = static_cast<CPrivMessage&>(msg);
|
||||
CTextMessage& priv = static_cast<CTextMessage&>(msg);
|
||||
EXPECT_EQ("sender", priv.GetNick().GetNick());
|
||||
EXPECT_EQ("PRIVMSG", priv.GetCommand());
|
||||
EXPECT_EQ("foo bar", priv.GetText());
|
||||
|
||||
Reference in New Issue
Block a user