mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Update modtcl -> adding GetServerName function and network varia… (#1658)
Update modtcl -> adding GetServerName function and network variable with network name value. Modification to have the variable ::network such as an eggdrop. Example usage: <MalaGaM> return $network <*modtcl> artis <MalaGaM> return $::network <*modtcl> artis <MalaGaM> return [GetServerName] <*modtcl> artis
This commit is contained in:
committed by
Alexey Sokolov
parent
09a514ba02
commit
d7c5eecfe5
@@ -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<CModTcl*>(cd);
|
||||
Tcl_SetResult(irp, (char*)mod->GetNetwork()->GetName().c_str(),
|
||||
TCL_VOLATILE);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
static int tcl_GetRealName STDVAR {
|
||||
CModTcl* mod = static_cast<CModTcl*>(cd);
|
||||
Tcl_SetResult(irp, (char*)mod->GetUser()->GetRealName().c_str(),
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user