TEST(MessageTest, Kick) { CKickMessage msg; msg.Parse(":nick KICK #chan person :reason"); EXPECT_EQ("nick", msg.GetNick().GetNick()); EXPECT_EQ("KICK", msg.GetCommand()); EXPECT_EQ("#chan", msg.GetTarget()); EXPECT_EQ("person", msg.GetKickedNick()); EXPECT_EQ("reason", msg.GetReason()); EXPECT_EQ(CMessage::Type::Kick, msg.GetType()); msg.SetKickedNick("noone"); EXPECT_EQ("noone", msg.GetKickedNick()); msg.SetReason("test"); EXPECT_EQ("test", msg.GetReason()); EXPECT_EQ(":nick KICK #chan noone :test", msg.ToString()); }
void OnKickMessage(CKickMessage& Message) override { const CNick& OpNick = Message.GetNick(); const CString sKickedNick = Message.GetKickedNick(); CChan& Channel = *Message.GetChan(); const CString sMessage = Message.GetReason(); AddBuffer(Channel, OpNick.GetNickMask() + " kicked " + sKickedNick + " Reason: [" + sMessage + "]", &Message.GetTime(), Message.GetTags()); }
void OnKickMessage(CKickMessage& Message) override { const CNick& OpNick = Message.GetNick(); const CString sKickedNick = Message.GetKickedNick(); CChan& Channel = *Message.GetChan(); const CString sMessage = Message.GetReason(); AddBuffer(Channel, t_f("{1} kicked {2} with reason: {3}")( OpNick.GetNickMask(), sKickedNick, sMessage), &Message.GetTime(), Message.GetTags()); }
bool CIRCSock::OnKickMessage(CKickMessage& Message) { CString sChan = Message.GetParam(0); CString sKickedNick = Message.GetKickedNick(); CChan* pChan = m_pNetwork->FindChan(sChan); if (pChan) { Message.SetChan(pChan); IRCSOCKMODULECALL(OnKickMessage(Message), NOTHING); // do not remove the nick till after the OnKick call, so modules // can do Chan.FindNick or something to get more info. pChan->RemNick(sKickedNick); } if (GetNick().Equals(sKickedNick) && pChan) { pChan->SetIsOn(false); // Don't try to rejoin! pChan->Disable(); } return (pChan && pChan->IsDetached()); }