1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

irc: add option irc.network.alternate_nick to disable dynamic nick generation when all nicks are already in use on server (task #12281)

This commit is contained in:
Nils Görs
2012-11-02 17:51:12 +01:00
committed by Sebastien Helleu
parent 8b52fc90d5
commit b1005fc23e
20 changed files with 126 additions and 16 deletions
+9
View File
@@ -120,6 +120,7 @@ struct t_config_option *irc_config_color_topic_new;
/* IRC config, network section */
struct t_config_option *irc_config_network_alternate_nick;
struct t_config_option *irc_config_network_autoreconnect_delay_growing;
struct t_config_option *irc_config_network_autoreconnect_delay_max;
struct t_config_option *irc_config_network_colors_receive;
@@ -2471,6 +2472,14 @@ irc_config_init ()
return 0;
}
irc_config_network_alternate_nick = weechat_config_new_option (
irc_config_file, ptr_section,
"alternate_nick", "boolean",
N_("get an alternate nick when the nick is already used on server: add "
"some \"_\" until the nick has a length of 9, and then replace last "
"char (or the two last chars) by a number from 1 to 99, until we "
"find a nick not used on server"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_autoreconnect_delay_growing = weechat_config_new_option (
irc_config_file, ptr_section,
"autoreconnect_delay_growing", "integer",
+1
View File
@@ -149,6 +149,7 @@ extern struct t_config_option *irc_config_color_reason_quit;
extern struct t_config_option *irc_config_color_topic_old;
extern struct t_config_option *irc_config_color_topic_new;
extern struct t_config_option *irc_config_network_alternate_nick;
extern struct t_config_option *irc_config_network_autoreconnect_delay_growing;
extern struct t_config_option *irc_config_network_autoreconnect_delay_max;
extern struct t_config_option *irc_config_network_colors_receive;
+7 -4
View File
@@ -551,10 +551,13 @@ irc_server_get_alternate_nick (struct t_irc_server *server)
return nick;
}
/*
* we have tried all nicks in list, then use main nick
* and we will add "_" and then number if needed
*/
/* now we have tried all nicks in list */
/* if alternate nick is disabled, just return NULL */
if (!weechat_config_boolean (irc_config_network_alternate_nick))
return NULL;
/* use main nick and we will add "_" and then number if needed */
server->nick_alternate_number = 0;
snprintf (nick, sizeof (nick), "%s", server->nicks_array[0]);
}