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:
1 parent
3976651c35
commit
320abef756
5 files changed
+19
-26
No files matched your search
@@ -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