mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 20:36:38 +02:00
Fix IRC /server command, fix bugs with IRC servers options, remove temporary server feature
This commit is contained in:
@@ -1478,6 +1478,42 @@ weechat_lua_api_config_option_set (lua_State *L)
|
||||
LUA_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_lua_api_config_option_unset: unset an option
|
||||
*/
|
||||
|
||||
static int
|
||||
weechat_lua_api_config_option_unset (lua_State *L)
|
||||
{
|
||||
const char *option;
|
||||
int n, rc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) L;
|
||||
|
||||
if (!lua_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_unset");
|
||||
LUA_RETURN_INT(0);
|
||||
}
|
||||
|
||||
option = NULL;
|
||||
|
||||
n = lua_gettop (lua_current_interpreter);
|
||||
|
||||
if (n < 1)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_unset");
|
||||
LUA_RETURN_INT(0);
|
||||
}
|
||||
|
||||
option = lua_tostring (lua_current_interpreter, -1);
|
||||
|
||||
rc = weechat_config_option_unset (script_str2ptr (option));
|
||||
|
||||
LUA_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_lua_api_config_option_rename: rename an option
|
||||
*/
|
||||
@@ -4950,6 +4986,7 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
|
||||
{ "config_string_to_boolean", &weechat_lua_api_config_string_to_boolean },
|
||||
{ "config_option_reset", &weechat_lua_api_config_option_reset },
|
||||
{ "config_option_set", &weechat_lua_api_config_option_set },
|
||||
{ "config_option_unset", &weechat_lua_api_config_option_unset },
|
||||
{ "config_option_rename", &weechat_lua_api_config_option_rename },
|
||||
{ "config_boolean", &weechat_lua_api_config_boolean },
|
||||
{ "config_integer", &weechat_lua_api_config_integer },
|
||||
|
||||
@@ -1233,6 +1233,37 @@ static XS (XS_weechat_config_option_set)
|
||||
PERL_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat::config_option_unset: unset an option
|
||||
*/
|
||||
|
||||
static XS (XS_weechat_config_option_unset)
|
||||
{
|
||||
int rc;
|
||||
char *option;
|
||||
dXSARGS;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) cv;
|
||||
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_unset");
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_unset");
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
option = SvPV (ST (0), PL_na);
|
||||
rc = weechat_config_option_unset (script_str2ptr (option));
|
||||
|
||||
PERL_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat::config_option_rename: rename an option
|
||||
*/
|
||||
@@ -3878,6 +3909,7 @@ weechat_perl_api_init (pTHX)
|
||||
newXS ("weechat::config_string_to_boolean", XS_weechat_config_string_to_boolean, "weechat");
|
||||
newXS ("weechat::config_option_reset", XS_weechat_config_option_reset, "weechat");
|
||||
newXS ("weechat::config_option_set", XS_weechat_config_option_set, "weechat");
|
||||
newXS ("weechat::config_option_unset", XS_weechat_config_option_unset, "weechat");
|
||||
newXS ("weechat::config_option_rename", XS_weechat_config_option_rename, "weechat");
|
||||
newXS ("weechat::config_boolean", XS_weechat_config_boolean, "weechat");
|
||||
newXS ("weechat::config_integer", XS_weechat_config_integer, "weechat");
|
||||
|
||||
@@ -1302,6 +1302,38 @@ weechat_python_api_config_option_set (PyObject *self, PyObject *args)
|
||||
PYTHON_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_config_option_unset: unset an option
|
||||
*/
|
||||
|
||||
static PyObject *
|
||||
weechat_python_api_config_option_unset (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *option;
|
||||
int rc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) self;
|
||||
|
||||
if (!python_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_unset");
|
||||
PYTHON_RETURN_INT(0);
|
||||
}
|
||||
|
||||
option = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "s", &option))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_unset");
|
||||
PYTHON_RETURN_INT(0);
|
||||
}
|
||||
|
||||
rc = weechat_config_option_unset (script_str2ptr (option));
|
||||
|
||||
PYTHON_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_api_config_option_rename: rename an option
|
||||
*/
|
||||
@@ -4121,6 +4153,7 @@ PyMethodDef weechat_python_funcs[] =
|
||||
{ "config_string_to_boolean", &weechat_python_api_config_string_to_boolean, METH_VARARGS, "" },
|
||||
{ "config_option_reset", &weechat_python_api_config_option_reset, METH_VARARGS, "" },
|
||||
{ "config_option_set", &weechat_python_api_config_option_set, METH_VARARGS, "" },
|
||||
{ "config_option_unset", &weechat_python_api_config_option_unset, METH_VARARGS, "" },
|
||||
{ "config_option_rename", &weechat_python_api_config_option_rename, METH_VARARGS, "" },
|
||||
{ "config_boolean", &weechat_python_api_config_boolean, METH_VARARGS, "" },
|
||||
{ "config_integer", &weechat_python_api_config_integer, METH_VARARGS, "" },
|
||||
|
||||
@@ -1509,6 +1509,42 @@ weechat_ruby_api_config_option_set (VALUE class, VALUE option, VALUE new_value,
|
||||
RUBY_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_ruby_api_config_option_unset: unset an option
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_config_option_unset (VALUE class, VALUE option)
|
||||
{
|
||||
char *c_option;
|
||||
int rc;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) class;
|
||||
|
||||
if (!ruby_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("config_option_unset");
|
||||
RUBY_RETURN_INT(0);
|
||||
}
|
||||
|
||||
c_option = NULL;
|
||||
|
||||
if (NIL_P (option))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_option_unset");
|
||||
RUBY_RETURN_INT(0);
|
||||
}
|
||||
|
||||
Check_Type (option, T_STRING);
|
||||
|
||||
c_option = STR2CSTR (option);
|
||||
|
||||
rc = weechat_config_option_unset (script_str2ptr (c_option));
|
||||
|
||||
RUBY_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_ruby_api_config_option_rename: rename an option
|
||||
*/
|
||||
@@ -4756,6 +4792,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
|
||||
rb_define_module_function (ruby_mWeechat, "config_string_to_boolean", &weechat_ruby_api_config_string_to_boolean, 1);
|
||||
rb_define_module_function (ruby_mWeechat, "config_option_reset", &weechat_ruby_api_config_option_reset, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "config_option_set", &weechat_ruby_api_config_option_set, 3);
|
||||
rb_define_module_function (ruby_mWeechat, "config_option_unset", &weechat_ruby_api_config_option_unset, 1);
|
||||
rb_define_module_function (ruby_mWeechat, "config_option_rename", &weechat_ruby_api_config_option_rename, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "config_boolean", &weechat_ruby_api_config_boolean, 1);
|
||||
rb_define_module_function (ruby_mWeechat, "config_integer", &weechat_ruby_api_config_integer, 1);
|
||||
|
||||
Reference in New Issue
Block a user