} else if (sCommand.CaseCmp("TOPIC") == 0) {
CString sChan = sLine.Token(1);
CString sTopic = sLine.Token(2, true);
- bool bUnset = false;
- if (sTopic.Left(1) == ":") {
- sTopic.LeftChomp();
- if (sTopic.empty())
- bUnset = true;
- }
-
- MODULECALL(OnUserTopic(sChan, sTopic), m_pUser, this, return);
-
- sLine = "TOPIC " + sChan;
-
- if (!sTopic.empty() || bUnset) {
- sLine += " :" + sTopic;
+ if (!sTopic.empty()) {
+ if (sTopic.Left(1) == ":")
+ sTopic.LeftChomp();
+ MODULECALL(OnUserTopic(sChan, sTopic), m_pUser, this, return);
+ sLine = "TOPIC " + sChan + " :" + sTopic;
+ } else {
+ MODULECALL(OnUserTopicRequest(sChan), m_pUser, this, return);
}
} else if (sCommand.CaseCmp("MODE") == 0) {
CString sTarget = sLine.Token(1);
CModule::EModRet CModule::OnUserJoin(CString& sChannel, CString& sKey) { return CONTINUE; }
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; }
CModule::EModRet CModule::OnCTCPReply(CNick& Nick, CString& sMessage) { return CONTINUE; }
CModule::EModRet CModule::OnPrivCTCP(CNick& Nick, CString& sMessage) { return CONTINUE; }
bool CModules::OnUserJoin(CString& sChannel, CString& sKey) { MODHALTCHK(OnUserJoin(sChannel, sKey)); }
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::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; }
virtual EModRet OnUserJoin(CString& sChannel, CString& sKey);
virtual EModRet OnUserPart(CString& sChannel, CString& sMessage);
virtual EModRet OnUserTopic(CString& sChannel, CString& sTopic);
+ virtual EModRet OnUserTopicRequest(CString& sChannel);
virtual EModRet OnCTCPReply(CNick& Nick, CString& sMessage);
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage);
virtual bool OnUserJoin(CString& sChannel, CString& sKey);
virtual bool OnUserPart(CString& sChannel, CString& sMessage);
virtual bool OnUserTopic(CString& sChannel, CString& sTopic);
+ virtual bool OnUserTopicRequest(CString& sChannel);
virtual bool OnCTCPReply(CNick& Nick, CString& sMessage);
virtual bool OnPrivCTCP(CNick& Nick, CString& sMessage);