virtual void OnJoin(const CNick& cNick, CChan& cChannel) { if (cNick.GetNick().Equals(m_pUser->GetNick()) && cChannel.GetBuffer().empty()) { BootStrap((CChan *)&cChannel); if (!cChannel.GetBuffer().empty()) Replay(cChannel.GetName()); } AddBuffer(cChannel, SpoofChanMsg(cChannel.GetName(), cNick.GetNickMask() + " JOIN")); }
virtual void OnIRCConnected() { // dropped this into here because there seems to have been a changed where the module is loaded before the channels. // this is a good trigger to tell it to backfill the channels if( !m_bFirstLoad ) { m_bFirstLoad = true; AddTimer(new CSaveBuffJob(this, 60, 0, "SaveBuff", "Saves the current buffer to disk every 1 minute")); const vector<CChan *>& vChans = m_pUser->GetChans(); for (u_int a = 0; a < vChans.size(); a++) { if (!vChans[a]->KeepBuffer()) continue; if (!BootStrap(vChans[a])) { PutUser(":***[email protected] PRIVMSG " + vChans[a]->GetName() + " :Failed to decrypt this channel, did you change the encryption pass?"); } } } }
virtual bool OnLoad(const CString& sArgs, CString& sMessage) { CString sMyArgs = sArgs; size_t uIndex = 0; if (sMyArgs.Token(0) == "-nostore") { uIndex++; m_saveMessages = false; } if (sMyArgs.Token(uIndex) == "-notimer") { SetAwayTime(0); sMyArgs = sMyArgs.Token(uIndex + 1, true); } else if (sMyArgs.Token(uIndex) == "-timer") { SetAwayTime(sMyArgs.Token(uIndex + 1).ToInt()); sMyArgs = sMyArgs.Token(uIndex + 2, true); } if (m_saveMessages) { if (!sMyArgs.empty()) { m_sPassword = CBlowfish::MD5(sMyArgs); } else { sMessage = "This module needs as an argument a keyphrase used for encryption"; return false; } if (!BootStrap()) { sMessage = "Failed to decrypt your saved messages - " "Did you give the right encryption key as an argument to this module?"; m_bBootError = true; return false; } } return true; }