Change to return the value from OnUserQuit() as request

This commit is contained in:
OGAWA Hirofumi
2015-02-22 04:32:35 +09:00
parent 85941f87c0
commit c6d093a53a
8 changed files with 12 additions and 9 deletions
+2 -1
View File
@@ -722,8 +722,9 @@ public:
virtual EModRet OnUserTopicRequest(CString& sChannel);
/** This module hook is called when a user requests to quit from network.
* @param sMessage The quit message the client sent.
* @return See CModule::EModRet.
*/
virtual void OnUserQuit(CString& sMessage);
virtual EModRet OnUserQuit(CString& sMessage);
/** Called when we receive a CTCP reply <em>from IRC</em>.
* @param Nick The nick the CTCP reply is from.
+2 -1
View File
@@ -105,9 +105,10 @@ public:
return CONTINUE;
}
virtual void OnUserQuit(CString& sMessage) override {
virtual EModRet OnUserQuit(CString& sMessage) override {
if (m_bRules[RULE_QUIT])
ClearAllBuffers();
return CONTINUE;
}
void SetAllRules(bool bVal) {
+1 -1
View File
@@ -47,7 +47,7 @@ EModRet OnUserJoin(CString& sChannel, CString& sKey)
EModRet OnUserPart(CString& sChannel, CString& sMessage)
EModRet OnUserTopic(CString& sChannel, CString& sTopic)
EModRet OnUserTopicRequest(CString& sChannel)
void OnUserQuit(CString& sMessage)
EModRet OnUserQuit(CString& sMessage)
EModRet OnCTCPReply(CNick& Nick, CString& sMessage)
EModRet OnPrivCTCP(CNick& Nick, CString& sMessage)
EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage)
+1 -1
View File
@@ -86,7 +86,7 @@ public:
virtual EModRet OnUserJoin(CString& sChannel, CString& sKey) override;
virtual EModRet OnUserPart(CString& sChannel, CString& sMessage) override;
virtual EModRet OnUserTopic(CString& sChannel, CString& sTopic) override;
virtual void OnUserQuit(CString& sMessage) override;
virtual EModRet OnUserQuit(CString& sMessage) override;
virtual EModRet OnUserTopicRequest(CString& sChannel) override;
virtual EModRet OnCTCPReply(CNick& Nick, CString& sMessage) override;
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) override;
+1 -1
View File
@@ -47,7 +47,7 @@ EModRet OnUserJoin(CString& sChannel, CString& sKey)
EModRet OnUserPart(CString& sChannel, CString& sMessage)
EModRet OnUserTopic(CString& sChannel, CString& sTopic)
EModRet OnUserTopicRequest(CString& sChannel)
void OnUserQuit(CString& sMessage)
EModRet OnUserQuit(CString& sMessage)
EModRet OnCTCPReply(CNick& Nick, CString& sMessage)
EModRet OnPrivCTCP(CNick& Nick, CString& sMessage)
EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage)
+1 -1
View File
@@ -103,7 +103,7 @@ public:
virtual EModRet OnUserPart(CString& sChannel, CString& sMessage) override;
virtual EModRet OnUserTopic(CString& sChannel, CString& sTopic) override;
virtual EModRet OnUserTopicRequest(CString& sChannel) override;
virtual void OnUserQuit(CString& sMessage) override;
virtual EModRet OnUserQuit(CString& sMessage) override;
virtual EModRet OnCTCPReply(CNick& Nick, CString& sMessage) override;
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) override;
virtual EModRet OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage) override;
+2 -1
View File
@@ -199,7 +199,8 @@ void CClient::ReadLine(const CString& sData) {
return;
} else if (sCommand.Equals("QUIT")) {
CString sMsg = sLine.Token(1, true).TrimPrefix_n();
NETWORKMODULECALL(OnUserQuit(sMsg), m_pUser, m_pNetwork, this, NOTHING);
NETWORKMODULECALL(OnUserQuit(sMsg), m_pUser, m_pNetwork, this, &bReturn);
if (bReturn) return;
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
return; // Don't forward this msg. We don't want the client getting us disconnected.
} else if (sCommand.Equals("PROTOCTL")) {
+2 -2
View File
@@ -693,7 +693,7 @@ CModule::EModRet CModule::OnUserJoin(CString& sChannel, CString& sKey) { return
CModule::EModRet CModule::OnUserPart(CString& sChannel, CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnUserTopic(CString& sChannel, CString& sTopic) { return CONTINUE; }
CModule::EModRet CModule::OnUserTopicRequest(CString& sChannel) { return CONTINUE; }
void CModule::OnUserQuit(CString& sMessage) {}
CModule::EModRet CModule::OnUserQuit(CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnCTCPReply(CNick& Nick, CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnPrivCTCP(CNick& Nick, CString& sMessage) { return CONTINUE; }
@@ -855,7 +855,7 @@ bool CModules::OnUserJoin(CString& sChannel, CString& sKey) { MODHALTCHK(OnUserJ
bool CModules::OnUserPart(CString& sChannel, CString& sMessage) { MODHALTCHK(OnUserPart(sChannel, sMessage)); }
bool CModules::OnUserTopic(CString& sChannel, CString& sTopic) { MODHALTCHK(OnUserTopic(sChannel, sTopic)); }
bool CModules::OnUserTopicRequest(CString& sChannel) { MODHALTCHK(OnUserTopicRequest(sChannel)); }
bool CModules::OnUserQuit(CString& sMessage) { MODUNLOADCHK(OnUserQuit(sMessage)); return false; }
bool CModules::OnUserQuit(CString& sMessage) { MODHALTCHK(OnUserQuit(sMessage)); }
bool CModules::OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans) { MODUNLOADCHK(OnQuit(Nick, sMessage, vChans)); return false; }
bool CModules::OnNick(const CNick& Nick, const CString& sNewNick, const vector<CChan*>& vChans) { MODUNLOADCHK(OnNick(Nick, sNewNick, vChans)); return false; }