mirror of
https://github.com/znc/znc.git
synced 2026-07-31 14:03:00 +02:00
Added support for bind msg/msgm.
This commit is contained in:
@@ -79,6 +79,7 @@ public:
|
||||
interp = Tcl_CreateInterp();
|
||||
Tcl_Init(interp);
|
||||
Tcl_CreateCommand(interp, "Binds::ProcessPubm", tcl_Bind, this, NULL);
|
||||
Tcl_CreateCommand(interp, "Binds::ProcessMsgm", tcl_Bind, this, NULL);
|
||||
Tcl_CreateCommand(interp, "Binds::ProcessTime", tcl_Bind, this, NULL);
|
||||
Tcl_CreateCommand(interp, "Binds::ProcessEvnt", tcl_Bind, this, NULL);
|
||||
Tcl_CreateCommand(interp, "Binds::ProcessNick", tcl_Bind, this, NULL);
|
||||
@@ -186,6 +187,19 @@ public:
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) {
|
||||
CString sMes = TclEscape(sMessage);
|
||||
CString sNick = TclEscape(CString(Nick.GetNick()));
|
||||
CString sHost = TclEscape(CString(Nick.GetIdent() + "@" + Nick.GetHost()));
|
||||
|
||||
CString sCommand = "Binds::ProcessMsgm {" + sNick + "} {" + sHost + "} - {" + sMes + "}";
|
||||
i = Tcl_Eval(interp, sCommand.c_str());
|
||||
if (i != TCL_OK) {
|
||||
PutModule(Tcl_GetStringResult(interp));
|
||||
}
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector<CChan*>& vChans) {
|
||||
CString sOldNick = TclEscape(CString(OldNick.GetNick()));
|
||||
CString sNewNickTmp = TclEscape(sNewNick);
|
||||
|
||||
Reference in New Issue
Block a user