Merge pull request #1395 from elyscape/feature/log-user-quits

Log user quit messages
This commit is contained in:
Alexey Sokolov
2017-04-22 15:33:15 +01:00
committed by GitHub
+13
View File
@@ -114,6 +114,8 @@ class CLogMod : public CModule {
const vector<CChan*>& vChans) override;
EModRet OnTopic(CNick& Nick, CChan& Channel, CString& sTopic) override;
EModRet OnSendToIRCMessage(CMessage& Message) override;
/* notices */
EModRet OnUserNotice(CString& sTarget, CString& sMessage) override;
EModRet OnPrivNotice(CNick& Nick, CString& sMessage) override;
@@ -399,6 +401,17 @@ void CLogMod::OnQuit(const CNick& Nick, const CString& sMessage,
}
}
CModule::EModRet CLogMod::OnSendToIRCMessage(CMessage& Message) {
if (Message.GetType() != CMessage::Type::Quit) {
return CONTINUE;
}
CIRCNetwork* pNetwork = Message.GetNetwork();
OnQuit(pNetwork->GetIRCNick(),
Message.As<CQuitMessage>().GetReason(),
pNetwork->GetChans());
return CONTINUE;
}
void CLogMod::OnJoin(const CNick& Nick, CChan& Channel) {
if (!HasNV("joins") || GetNV("joins").ToBool())
PutLog("*** Joins: " + Nick.GetNick() + " (" + Nick.GetIdent() + "@" +