Beispiel #1
0
    void Timeout() {
        // The timer will be deleted after this by the event loop

        if (!GetNV("silent_timeouts").ToBool()) {
            PutModule(
                "This module hit a timeout which is probably a connectivity "
                "issue.");
            PutModule(
                "However, if you can provide steps to reproduce this issue, "
                "please do report a bug.");
            PutModule("To disable this message, do \"/msg " + GetModNick() +
                      " silent yes\"");
            PutModule("Last request: " + m_sLastRequest);
            PutModule("Expected replies: ");

            for (size_t i = 0; m_pReplies[i].szReply != nullptr; i++) {
                if (m_pReplies[i].bLastResponse)
                    PutModule(m_pReplies[i].szReply + CString(" (last)"));
                else
                    PutModule(m_pReplies[i].szReply);
            }
        }

        m_pDoing = nullptr;
        m_pReplies = nullptr;
        SendRequest();
    }
Beispiel #2
0
bool CModule::PutModNotice(const CString& sLine, const CString& sIdent, const CString& sHost) {
	if (!m_pUser)
		return false;
	return m_pUser->PutUser(":" + GetModNick() + "!" +
		(sIdent.empty() ? GetModName() : sIdent) + "@" + sHost +
		" NOTICE " + m_pUser->GetCurNick() + " :" + sLine,
		m_pClient);
}
	void AddBuffer(CChan& Channel, const CString& sMessage) {
		// If they have keep buffer disabled, only add messages if no client is connected
		if (!Channel.KeepBuffer() && m_pUser->IsUserAttached())
			return;

		CString s = ":" + GetModNick() + "!" + GetModName() + "@znc.in PRIVMSG "
			+ Channel.GetName() + " :" + m_pUser->AddTimestamp(sMessage);
		Channel.AddBuffer(s);
	}
bool CModule::PutModule(const CString& sLine, const CString& sIdent, const CString& sHost) {
	if (!m_pUser)
		return false;
	if(m_pUser->ModRepliesAsNotices())
		return PutModNotice(sLine, sIdent, sHost);
	return m_pUser->PutUser(":" + GetModNick() + "!" +
		(sIdent.empty() ? GetModName() : sIdent) + "@" + sHost +
		" PRIVMSG " + m_pUser->GetCurNick() + " :" + sLine,
		m_pClient);
}
Beispiel #5
0
	virtual EModRet OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize) {
		if (RemoteNick.GetNick().Equals(GetModNick())) {
			CString sLocalFile = CDir::ChangeDir(m_sPath, sFile, CZNC::Get().GetHomePath());

			m_pUser->GetFile(m_pUser->GetCurNick(), CUtils::GetIP(uLongIP), uPort, sLocalFile, uFileSize, GetModName());

			return HALT;
		}

		return CONTINUE;
	}
Beispiel #6
0
	void Timeout()
	{
		// The timer will be deleted after this by the event loop

		if (!GetNV("silent_timeouts").ToBool()) {
			PutModule("This module hit a timeout which is possibly a bug.");
			PutModule("To disable this message, do \"/msg " + GetModNick()
					+ " silent yes\"");
			PutModule("Last request: " + m_sLastRequest);
			PutModule("Expected replies: ");

			for (size_t i = 0; m_pReplies[i].szReply != NULL; i++) {
				if (m_pReplies[i].bLastResponse)
					PutModule(m_pReplies[i].szReply +
							CString(" (last)"));
				else
					PutModule(m_pReplies[i].szReply);
			}
		}

		m_pDoing = NULL;
		m_pReplies = NULL;
		SendRequest();
	}
Beispiel #7
0
	void PutShell(const CString& sMsg) {
		CString sPath = m_sPath.Replace_n(" ", "_");
		CString sSource = ":" + GetModNick() + "!shell@" + sPath;
		CString sLine = sSource + " PRIVMSG " + m_pUser->GetCurNick() + " :" + sMsg;
		PutUser(sLine);
	}
Beispiel #8
0
	void PutShell(const CString& sMsg) {
		CString sPath = m_sPath.Replace_n(" ", "_");
		CString sSource = ":" + GetModNick() + "!shell@" + sPath;
		CString sLine = sSource + " PRIVMSG " + m_pClient->GetNick() + " :" + sMsg;
		m_pClient->PutClient(sLine);
	}