summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-channel.c72
-rw-r--r--src/plugins/irc/irc-channel.h5
-rw-r--r--src/plugins/irc/irc-command.c6
-rw-r--r--src/plugins/irc/irc-config.c22
-rw-r--r--src/plugins/irc/irc-display.c3
-rw-r--r--src/plugins/irc/irc-server.c76
-rw-r--r--src/plugins/irc/irc-server.h4
7 files changed, 8 insertions, 180 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 8e73d57d1..38f68b503 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -107,7 +107,6 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
new_channel->last_nick = NULL;
new_channel->buffer = new_buffer;
new_channel->nicks_speaking = NULL;
- //new_buffer->notify_level = irc_channel_get_notify_level (server, new_channel);
/* add new channel to channels list */
new_channel->prev_channel = server->last_channel;
@@ -329,77 +328,6 @@ irc_channel_set_away (struct t_irc_channel *channel, const char *nick, int is_aw
}
/*
- * irc_channel_get_notify_level: get channel notify level
- */
-
-int
-irc_channel_get_notify_level (struct t_irc_server *server,
- struct t_irc_channel *channel)
-{
- (void) server;
- (void) channel;
- /*char *name, *pos, *pos2;
- int server_default_notify, notify;
-
- if ((!server) || (!channel))
- return GUI_NOTIFY_LEVEL_DEFAULT;
-
- if ((!server->notify_levels) || (!server->notify_levels[0]))
- return GUI_NOTIFY_LEVEL_DEFAULT;
-
- server_default_notify = irc_server_get_default_notify_level (server);
- if ((channel->type != IRC_CHANNEL_TYPE_CHANNEL)
- && (server_default_notify == 1))
- server_default_notify = 2;
-
- name = malloc (strlen (channel->name) + 2);
- strcpy (name, channel->name);
- strcat (name, ":");
- pos = strstr (server->notify_levels, name);
- free (name);
- if (!pos)
- return server_default_notify;
-
- pos2 = pos + strlen (channel->name);
- if (pos2[0] != ':')
- return server_default_notify;
- pos2++;
- if (!pos2[0])
- return server_default_notify;
-
- notify = (int)(pos2[0] - '0');
- if ((notify >= GUI_NOTIFY_LEVEL_MIN) && (notify <= GUI_NOTIFY_LEVEL_MAX))
- return notify;
-
- return server_default_notify;
- */
- return 0;
-}
-
-/*
- * irc_channel_set_notify_level: set channel notify level
- */
-
-void
-irc_channel_set_notify_level (struct t_irc_server *server,
- struct t_irc_channel *channel, int notify)
-{
- (void) server;
- (void) channel;
- (void) notify;
-
- /*char level_string[2];
-
- if ((!server) || (!channel))
- return;
-
- level_string[0] = notify + '0';
- level_string[1] = '\0';
- config_option_list_set (&(server->notify_levels), channel->name, level_string);
- */
-}
-
-/*
* irc_channel_add_nick_speaking: add a nick speaking on a channel
*/
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index ac8a268f3..6a1cf4ef0 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -73,11 +73,6 @@ extern void irc_channel_check_away (struct t_irc_server *server,
struct t_irc_channel *channel, int force);
extern void irc_channel_set_away (struct t_irc_channel *channel, const char *nick,
int is_away);
-extern int irc_channel_get_notify_level (struct t_irc_server *server,
- struct t_irc_channel *channel);
-extern void irc_channel_set_notify_level (struct t_irc_server *server,
- struct t_irc_channel *channel,
- int notify);
extern void irc_channel_add_nick_speaking (struct t_irc_channel *channel,
const char *nick);
extern void irc_channel_print_log (struct t_irc_channel *channel);
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index a2ab247d4..ed400f85a 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -619,8 +619,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
server_tmp.command,
1, /* command_delay */
server_tmp.autojoin,
- 1, /* autorejoin */
- NULL);
+ 1); /* autorejoin */
if (ptr_server)
{
weechat_printf (NULL,
@@ -2777,8 +2776,7 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
server_tmp.command,
1, /* command_delay */
server_tmp.autojoin,
- 1, /* autorejoin */
- NULL);
+ 1); /* autorejoin */
if (new_server)
{
weechat_printf (NULL,
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index f028642d5..f2f6d1960 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -35,7 +35,7 @@
char *irc_config_server_option_string[IRC_CONFIG_NUM_SERVER_OPTIONS] =
{ "autoconnect", "autoreconnect", "autoreconnect_delay", "addresses", "ipv6",
"ssl", "password", "nicks", "username", "realname", "local_hostname",
- "command", "command_delay", "autojoin", "autorejoin", "notify_levels"
+ "command", "command_delay", "autojoin", "autorejoin"
};
char *irc_config_server_option_default[IRC_CONFIG_NUM_SERVER_OPTIONS] =
{ "off", "on", "30", "", "off", "off", "", "", "", "", "", "", "0", "",
@@ -224,15 +224,6 @@ irc_config_change_log ()
}
/*
- * irc_config_change_notify_levels: called when notify level is changed
- */
-
-void
-irc_config_change_notify_levels ()
-{
-}
-
-/*
* irc_config_server_default_change_cb: callback called when a default server
* option is modified
*/
@@ -663,17 +654,6 @@ irc_config_server_new_option (struct t_config_file *config_file,
callback_change, callback_change_data,
callback_delete, callback_delete_data);
break;
- case IRC_CONFIG_SERVER_NOTIFY_LEVELS:
- new_option = weechat_config_new_option (
- config_file, section,
- option_name, "string",
- N_("comma separated list of notify levels for channels of this server "
- "(format: #channel:1,..), a channel name '*' is reserved for "
- "server default notify level"),
- NULL, 0, 0, value, NULL, NULL,
- callback_change, callback_change_data,
- callback_delete, callback_delete_data);
- break;
case IRC_CONFIG_NUM_SERVER_OPTIONS:
break;
}
diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c
index e34835561..d59440b3d 100644
--- a/src/plugins/irc/irc-display.c
+++ b/src/plugins/irc/irc-display.c
@@ -221,9 +221,6 @@ irc_display_server (struct t_irc_server *server, int with_detail)
weechat_printf (NULL, " autojoin . . . . . : %s",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
- weechat_printf (NULL, " notify_levels . . . : %s",
- (server->notify_levels && server->notify_levels[0]) ?
- server->notify_levels : "");
}
else
{
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 89d6d54ea..c0739c9f0 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -209,11 +209,6 @@ irc_server_set_with_option (struct t_irc_server *server,
case IRC_CONFIG_SERVER_AUTOREJOIN:
server->autorejoin = weechat_config_integer (option);
break;
- case IRC_CONFIG_SERVER_NOTIFY_LEVELS:
- if (server->notify_levels)
- free (server->notify_levels);
- server->notify_levels = strdup (weechat_config_string (option));
- break;
case IRC_CONFIG_NUM_SERVER_OPTIONS:
break;
}
@@ -270,7 +265,6 @@ irc_server_init (struct t_irc_server *server)
server->command_delay = IRC_CONFIG_SERVER_DEFAULT_COMMAND_DELAY;
server->autojoin = NULL;
server->autorejoin = IRC_CONFIG_SERVER_DEFAULT_AUTOREJOIN;
- server->notify_levels = NULL;
/* internal vars */
server->reloaded_from_config = 0;
@@ -597,8 +591,6 @@ irc_server_free_data (struct t_irc_server *server)
free (server->command);
if (server->autojoin)
free (server->autojoin);
- if (server->notify_levels)
- free (server->notify_levels);
if (server->unterminated_message)
free (server->unterminated_message);
if (server->nick)
@@ -672,7 +664,7 @@ irc_server_new (const char *name, int autoconnect, int autoreconnect,
int ipv6, int ssl, const char *password, const char *nicks,
const char *username, const char *realname, const char *local_hostname,
const char *command, int command_delay, const char *autojoin,
- int autorejoin, const char *notify_levels)
+ int autorejoin)
{
struct t_irc_server *new_server;
@@ -684,15 +676,14 @@ irc_server_new (const char *name, int autoconnect, int autoreconnect,
weechat_log_printf ("Creating new server (name:%s, addresses:%s, "
"pwd:%s, nicks:%s, username:%s, realname:%s, "
"local_hostname: %s, command:%s, autojoin:%s, "
- "autorejoin:%s, notify_levels:%s)",
+ "autorejoin:%s)",
name, addresses, (password) ? password : "",
(nicks) ? nicks : "", (username) ? username : "",
(realname) ? realname : "",
(local_hostname) ? local_hostname : "",
(command) ? command : "",
(autojoin) ? autojoin : "",
- (autorejoin) ? "on" : "off",
- (notify_levels) ? notify_levels : "");
+ (autorejoin) ? "on" : "off");
}
new_server = irc_server_alloc (name);
@@ -720,8 +711,6 @@ irc_server_new (const char *name, int autoconnect, int autoreconnect,
new_server->autojoin =
(autojoin) ? strdup (autojoin) : NULL;
new_server->autorejoin = autorejoin;
- new_server->notify_levels =
- (notify_levels) ? strdup (notify_levels) : NULL;
}
else
return NULL;
@@ -760,8 +749,7 @@ irc_server_duplicate (struct t_irc_server *server, const char *new_name)
server->command,
server->command_delay,
server->autojoin,
- server->autorejoin,
- server->notify_levels);
+ server->autorejoin);
return new_server;
}
@@ -2312,61 +2300,6 @@ irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away)
}
/*
- * irc_server_get_default_notify_level: get default notify level for server
- */
-
-int
-irc_server_get_default_notify_level (struct t_irc_server *server)
-{
- (void) server;
-
- /*int notify, value;
- char *pos;
-
- notify = GUI_NOTIFY_LEVEL_DEFAULT;
-
- if (!server || !server->notify_levels)
- return notify;
-
- pos = strstr (server->notify_levels, "*:");
- if (pos)
- {
- pos += 2;
- if (pos[0])
- {
- value = (int)(pos[0] - '0');
- if ((value >= GUI_NOTIFY_LEVEL_MIN)
- && (value <= GUI_NOTIFY_LEVEL_MAX))
- notify = value;
- }
- }
-
- return notify;*/
- return 0;
-}
-
-/*
- * irc_server_set_default_notify_level: set default notify level for server
- */
-
-void
-irc_server_set_default_notify_level (struct t_irc_server *server, int notify)
-{
- (void) server;
- (void) notify;
-
- /*char level_string[2];
-
- if (server)
- {
- level_string[0] = notify + '0';
- level_string[1] = '\0';
- config_option_list_set (&(server->notify_levels), "*", level_string);
- }
- */
-}
-
-/*
* irc_server_xfer_send_ready_cb: callback called when user send (file or chat)
* to someone and that xfer plugin successfully
* initialized xfer and is ready for sending
@@ -2586,7 +2519,6 @@ irc_server_print_log ()
weechat_log_printf (" command_delay . . . : %d", ptr_server->command_delay);
weechat_log_printf (" autojoin. . . . . . : '%s'", ptr_server->autojoin);
weechat_log_printf (" autorejoin. . . . . : %d", ptr_server->autorejoin);
- weechat_log_printf (" notify_levels . . . : %s", ptr_server->notify_levels);
weechat_log_printf (" reloaded_from_config: %d", ptr_server->reloaded_from_config);
weechat_log_printf (" addresses_count . . : %d", ptr_server->addresses_count);
weechat_log_printf (" addresses_array . . : 0x%x", ptr_server->addresses_array);
diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h
index 66fdb90ce..0271eb418 100644
--- a/src/plugins/irc/irc-server.h
+++ b/src/plugins/irc/irc-server.h
@@ -74,7 +74,6 @@ struct t_irc_server
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
- char *notify_levels; /* channels notify levels */
/* internal vars */
int reloaded_from_config; /* 1 if reloaded from config file */
@@ -154,8 +153,7 @@ extern struct t_irc_server *irc_server_new (const char *name, int autoconnect,
const char *username, const char *realname,
const char *hostname, const char *command,
int command_delay, const char *autojoin,
- int autorejoin,
- const char *notify_levels);
+ int autorejoin);
extern struct t_irc_server *irc_server_duplicate (struct t_irc_server *server,
const char *new_name);
extern int irc_server_rename (struct t_irc_server *server, const char *new_name);