From c61c4838e05c729c33e214688cb3bbb4c869ddcb Mon Sep 17 00:00:00 2001 From: Noldor Date: Thu, 5 Jul 2007 16:04:08 +0000 Subject: added $my.serverIsIPV6() function git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@653 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/my/libkvimy.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/modules') 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: + $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 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; -- cgit v1.3.1-10-gc9f91