Exemplo n.º 1
0
	virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {
		CString sOpNick = TclEscape(CString(OpNick.GetNick()));
		CString sNick = TclEscape(sKickedNick);
		CString sOpHost = TclEscape(CString(OpNick.GetIdent() + "@" + OpNick.GetHost()));

		CString sCommand = "Binds::ProcessKick {" + sOpNick + "} {" + sOpHost + "} - {" + Channel.GetName() + "} {" + sNick + "} {" + sMessage + "}";
		i = Tcl_Eval(interp, sCommand.c_str());
		if (i != TCL_OK) {
			PutModule(Tcl_GetStringResult(interp));
		}
	}
Exemplo n.º 2
0
	virtual EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) {
		CString sMes = TclEscape(sMessage);
		CString sNick = TclEscape(CString(Nick.GetNick()));
		CString sHost = TclEscape(CString(Nick.GetIdent() + "@" + Nick.GetHost()));
		CString sChannel = TclEscape(CString(Channel.GetName()));

		CString sCommand = "Binds::ProcessPubm {" + sNick + "} {" + sHost + "} - {" + sChannel + "} {" + sMes + "}";
		i = Tcl_Eval(interp, sCommand.c_str());
		if (i != TCL_OK) {
			PutModule(Tcl_GetStringResult(interp));
		}
		return CONTINUE;
	}
Exemplo n.º 3
0
	virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
		CString sOldNick = TclEscape(CString(OldNick.GetNick()));
		CString sNewNickTmp = TclEscape(sNewNick);
		CString sHost = TclEscape(CString(OldNick.GetIdent() + "@" + OldNick.GetHost()));

		CString sCommand;
		// Nick change is triggered for each common chan so that binds can be chan specific
		unsigned int nLength = vChans.size();
		for (unsigned int n = 0; n < nLength; n++) {
			sCommand = "Binds::ProcessNick {" + sOldNick + "} {" + sHost + "} - {" + vChans[n]->GetName() + "} {" + sNewNickTmp + "}";
			i = Tcl_Eval(interp, sCommand.c_str());
			if (i != TCL_OK) {
				PutModule(Tcl_GetStringResult(interp));
			}
		}
	}
Exemplo n.º 4
0
	virtual EModRet OnUserRaw(CString& sLine) {
		CString sEscaped = TclEscape(sLine);
		
		CString sCommand = "Binds::ProcessRaw {client} {" + sEscaped + "}";
		i = Tcl_Eval(interp, sCommand.c_str());
		if (i != TCL_OK) {
			result = interp->result;
			PutModule(CString(result));
		}
		
		return CONTINUE;
	}