summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/plugins-interface.c15
-rw-r--r--src/plugins/plugins.c4
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c4
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c1
-rw-r--r--src/plugins/scripts/python/weechat-python.c6
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby.c2
-rw-r--r--src/plugins/weechat-plugin.h1
7 files changed, 25 insertions, 8 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index c54caac70..b1bb6414c 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -833,7 +833,7 @@ weechat_plugin_set_config (t_weechat_plugin *plugin, char *option, char *value)
{
strncpy (server_name, option, pos - option);
server_name[pos - option] = '\0';
- ptr_server = server_search (server_name);
+ ptr_server = irc_server_search (server_name);
free (server_name);
if (ptr_server)
return (config_set_server_value (ptr_server, pos + 1, value) == 0);
@@ -899,8 +899,8 @@ weechat_plugin_set_plugin_config (t_weechat_plugin *plugin, char *option, char *
/*
* weechat_plugin_get_server_info: get list of server info
- * WARNING: caller has to free structure returned
- * by this function after use
+ * WARNING: caller has to free structure returned
+ * by this function after use
*/
t_plugin_server_info *
@@ -945,6 +945,7 @@ weechat_plugin_get_server_info (t_weechat_plugin *plugin)
new_server_info->ssl_connected = ptr_server->ssl_connected;
new_server_info->nick = (ptr_server->nick) ? strdup (ptr_server->nick) : strdup ("");
new_server_info->nick_modes = (ptr_server->nick_modes) ? strdup (ptr_server->nick_modes) : strdup ("");
+ new_server_info->prefix = (ptr_server->prefix) ? strdup (ptr_server->prefix) : strdup ("");
new_server_info->is_away = ptr_server->is_away;
new_server_info->away_time = ptr_server->away_time;
new_server_info->lag = ptr_server->lag;
@@ -1005,6 +1006,8 @@ weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info
free (server_info->nick);
if (server_info->nick_modes)
free (server_info->nick_modes);
+ if (server_info->prefix)
+ free (server_info->prefix);
new_server_info = server_info->next_server;
free (server_info);
server_info = new_server_info;
@@ -1027,7 +1030,7 @@ weechat_plugin_get_channel_info (t_weechat_plugin *plugin, char *server)
if (!plugin || !server || !server[0])
return NULL;
- ptr_server = server_search (server);
+ ptr_server = irc_server_search (server);
if (!ptr_server)
return NULL;
@@ -1111,11 +1114,11 @@ weechat_plugin_get_nick_info (t_weechat_plugin *plugin, char *server, char *chan
if (!plugin || !server || !server[0] || !channel || !channel[0])
return NULL;
- ptr_server = server_search (server);
+ ptr_server = irc_server_search (server);
if (!ptr_server)
return NULL;
- ptr_channel = channel_search (ptr_server, channel);
+ ptr_channel = irc_channel_search (ptr_server, channel);
if (!ptr_channel)
return NULL;
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index 5650b6d10..2013965a9 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -90,7 +90,7 @@ plugin_find_server_channel (char *server, char *channel,
{
if (server && server[0])
{
- (*ptr_server) = server_search (server);
+ (*ptr_server) = irc_server_search (server);
if (!(*ptr_server))
return -1;
}
@@ -104,7 +104,7 @@ plugin_find_server_channel (char *server, char *channel,
if (channel && channel[0])
{
if ((*ptr_server))
- (*ptr_channel) = channel_search ((*ptr_server), channel);
+ (*ptr_channel) = irc_channel_search ((*ptr_server), channel);
if (!(*ptr_channel))
return -1;
}
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 6526507ec..01d28a898 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -1731,6 +1731,10 @@ weechat_lua_get_server_info (lua_State *L)
lua_pushstring (lua_current_interpreter, "nick_modes");
lua_pushstring (lua_current_interpreter, ptr_server->nick_modes);
lua_rawset (lua_current_interpreter, -3);
+
+ lua_pushstring (lua_current_interpreter, "prefix");
+ lua_pushstring (lua_current_interpreter, ptr_server->prefix);
+ lua_rawset (lua_current_interpreter, -3);
lua_pushstring (lua_current_interpreter, "away_time");
lua_pushstring (lua_current_interpreter, timebuffer);
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 66418273f..3015de34f 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -1483,6 +1483,7 @@ static XS (XS_weechat_get_server_info)
hv_store (server_hash_member, "ssl_connected", 13, newSViv (ptr_server->ssl_connected), 0);
hv_store (server_hash_member, "nick", 4, newSVpv (ptr_server->nick, 0), 0);
hv_store (server_hash_member, "nick_modes", 10, newSVpv (ptr_server->nick_modes, 0), 0);
+ hv_store (server_hash_member, "prefix", 6, newSVpv (ptr_server->prefix, 0), 0);
hv_store (server_hash_member, "away_time", 9, newSVpv (timebuffer, 0), 0);
hv_store (server_hash_member, "lag", 3, newSViv (ptr_server->lag), 0);
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index ca73eafb4..ff0e69485 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -1612,6 +1612,12 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
PyDict_SetItem(server_hash_member, key, value);
Py_DECREF (key);
Py_DECREF (value);
+
+ key = Py_BuildValue("s", "prefix");
+ value = Py_BuildValue("s", ptr_server->prefix);
+ PyDict_SetItem(server_hash_member, key, value);
+ Py_DECREF (key);
+ Py_DECREF (value);
key = Py_BuildValue("s", "away_time");
value = Py_BuildValue("s", timebuffer);
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c
index acd35fc3e..233ac0091 100644
--- a/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/src/plugins/scripts/ruby/weechat-ruby.c
@@ -1707,6 +1707,8 @@ weechat_ruby_get_server_info (VALUE class)
rb_str_new2(ptr_server->nick));
rb_hash_aset (server_hash_member, rb_str_new2("nick_modes"),
rb_str_new2(ptr_server->nick_modes));
+ rb_hash_aset (server_hash_member, rb_str_new2("prefix"),
+ rb_str_new2(ptr_server->prefix));
rb_hash_aset (server_hash_member, rb_str_new2("away_time"),
rb_str_new2(timebuffer));
rb_hash_aset (server_hash_member, rb_str_new2("lag"),
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 12bae1ed1..827ca5890 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -107,6 +107,7 @@ struct t_plugin_server_info
int ssl_connected; /* = 1 if connected with SSL */
char *nick; /* current nickname */
char *nick_modes; /* nick modes */
+ char *prefix; /* nick prefix allowed */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */