diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/my/libkvimy.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/modules/my/libkvimy.cpp b/src/modules/my/libkvimy.cpp index ed33c54df..e76ebf0f6 100644 --- a/src/modules/my/libkvimy.cpp +++ b/src/modules/my/libkvimy.cpp @@ -29,6 +29,7 @@ #include "kvi_ircconnection.h" #include "kvi_ircconnectionuserinfo.h" #include "kvi_ircconnectionserverinfo.h" +#include "kvi_ircserver.h" #include "idle.h" Idle* g_pIdle; #ifdef COMPILE_NEW_KVS @@ -264,6 +265,37 @@ static bool my_kvs_fnc_ip(KviKvsModuleFunctionCall * c) } return true; } + +/* + @doc: my.serverIsIPV6 + @type: + function + @title: + $my.serverIsSSL + @short: + Returns 1 if the current server connection use IPV6. + @syntax: + <boolean> $my.serverIsIPV6([irc_context_id:uint]) + @description: + Returns 1 if the server connection use IPV6.[br] + If the irc context is not connected then an empty string is returned.[br] + If <irc_context_id> is specified this function returns acts as it was called + in that irc_context.[br] +*/ + +static bool my_kvs_fnc_serverIsIPV6(KviKvsModuleFunctionCall * c) +{ + + GET_KVS_CONSOLE + if(wnd) + { + if(wnd->connection()) + c->returnValue()->setBoolean(wnd->connection()->server()->isIpV6()); + } + return true; +} + + /* @doc: my.serverIsSSL @type: @@ -359,7 +391,8 @@ static bool my_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"network",my_kvs_fnc_network); KVSM_REGISTER_FUNCTION(m,"umode",my_kvs_fnc_umode); KVSM_REGISTER_FUNCTION(m,"serverIsSSL",my_kvs_fnc_serverIsSSL); - + KVSM_REGISTER_FUNCTION(m,"serverIsIPV6",my_kvs_fnc_serverIsIPV6); + KVSM_REGISTER_SIMPLE_COMMAND(m,"stopIdleTimer",my_kvs_cmd_stopIdleTimer); KVSM_REGISTER_SIMPLE_COMMAND(m,"startIdleTimer",my_kvs_cmd_startIdleTimer); return true; |
