summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/plugins/irc/irc-server.c9
-rw-r--r--src/plugins/irc/irc-server.h2
-rw-r--r--src/plugins/irc/irc.c3
4 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5310beba5..13158e3bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,8 @@ Version 0.3.7 (under dev!)
* core: fix compilation error with "pid_t" on Mac OS X (bug #34639)
* core: enable background process under Cygwin to connect to servers, fix
reconnection problem (bug #34626)
+* irc: auto-connect to servers created with "irc://" on command line but not
+ other servers if "-a" ("--no-connect") is given
* guile: new script plugin for scheme (task #7289)
* ruby: fix crash when reloading ruby plugin (bug #34474)
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index d4ce9ae41..eb76285e5 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -3497,17 +3497,22 @@ irc_server_reconnect (struct t_irc_server *server)
/*
* irc_server_auto_connect: auto-connect to servers (called at startup)
+ * if auto_connect = 1, auto connect to all servers
+ * with flag "autoconnect"
+ * = 0, auto connect to temp servers
+ * only (created with "irc://..")
*/
void
-irc_server_auto_connect ()
+irc_server_auto_connect (int auto_connect)
{
struct t_irc_server *ptr_server;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
- if (IRC_SERVER_OPTION_BOOLEAN(ptr_server, IRC_SERVER_OPTION_AUTOCONNECT))
+ if ((auto_connect || ptr_server->temp_server)
+ && (IRC_SERVER_OPTION_BOOLEAN(ptr_server, IRC_SERVER_OPTION_AUTOCONNECT)))
{
if (!irc_server_connect (ptr_server))
irc_server_reconnect_schedule (ptr_server);
diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h
index 14c58802d..86f5254bf 100644
--- a/src/plugins/irc/irc-server.h
+++ b/src/plugins/irc/irc-server.h
@@ -250,7 +250,7 @@ extern struct t_irc_server *irc_server_search (const char *server_name);
extern void irc_server_set_buffer_title (struct t_irc_server *server);
extern struct t_gui_buffer *irc_server_create_buffer (struct t_irc_server *server);
extern int irc_server_connect (struct t_irc_server *server);
-extern void irc_server_auto_connect ();
+extern void irc_server_auto_connect (int auto_connect);
extern void irc_server_autojoin_channels ();
extern int irc_server_recv_cb (void *data, int fd);
extern int irc_server_timer_sasl_cb (void *data, int remaining_calls);
diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c
index 0703273a8..3ebaacd1b 100644
--- a/src/plugins/irc/irc.c
+++ b/src/plugins/irc/irc.c
@@ -233,8 +233,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
}
else
{
- if (auto_connect)
- irc_server_auto_connect ();
+ irc_server_auto_connect (auto_connect);
}
irc_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,