diff --git a/modules/modtcl.cpp b/modules/modtcl.cpp index 8a3452d3..4f3900b7 100644 --- a/modules/modtcl.cpp +++ b/modules/modtcl.cpp @@ -116,6 +116,8 @@ class CModTcl : public CModule { Tcl_CreateCommand(interp, "GetCurNick", tcl_GetCurNick, this, nullptr); Tcl_CreateCommand(interp, "GetUsername", tcl_GetUsername, this, nullptr); + Tcl_CreateCommand(interp, "GetNetworkName", tcl_GetNetworkName, this, + nullptr); Tcl_CreateCommand(interp, "GetRealName", tcl_GetRealName, this, nullptr); Tcl_CreateCommand(interp, "GetVHost", tcl_GetBindHost, this, nullptr); @@ -305,6 +307,13 @@ class CModTcl : public CModule { return TCL_OK; } + static int tcl_GetNetworkName STDVAR { + CModTcl* mod = static_cast(cd); + Tcl_SetResult(irp, (char*)mod->GetNetwork()->GetName().c_str(), + TCL_VOLATILE); + return TCL_OK; + } + static int tcl_GetRealName STDVAR { CModTcl* mod = static_cast(cd); Tcl_SetResult(irp, (char*)mod->GetUser()->GetRealName().c_str(), diff --git a/modules/modtcl/modtcl.tcl b/modules/modtcl/modtcl.tcl index 06d0e3ea..e3f24438 100644 --- a/modules/modtcl/modtcl.tcl +++ b/modules/modtcl/modtcl.tcl @@ -34,6 +34,7 @@ set ::botnet-nick ZNC_[GetUsername] set ::botnick [GetCurNick] set ::server [GetServer] set ::server-online [expr [GetServerOnline] / 1000] +set ::network [GetNetworkName] # add some eggdrop style procs proc putlog message {PutModule $message}