diff --git a/ChangeLog b/ChangeLog index f9dd85f6f..1c2c9bcd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,8 @@ Version 0.3.5 (under dev!) * core: allow background for nick colors (using ":") * api: add new function buffer_match_list * aspell: fix spellers used after switch of window (bug #32811) +* irc: do not rejoin channels where /part has been issued before reconnection + to server (bug #33029) * irc: use nick color for users outside the channel * irc: replace options irc.color.nick_prefix_{op|halfop|voice|user} by a single option irc.color.nick_prefixes (task #10888) diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index a551b584e..8fd832432 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -260,6 +260,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type, new_channel->away_message = NULL; new_channel->has_quit_server = 0; new_channel->cycle = 0; + new_channel->part = 0; new_channel->display_creation_date = 0; new_channel->nick_completion_reset = 0; new_channel->pv_remote_nick_color = NULL; @@ -887,6 +888,8 @@ irc_channel_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_integer (ptr_item, "cycle", channel->cycle)) return 0; + if (!weechat_infolist_new_var_integer (ptr_item, "part", channel->part)) + return 0; if (!weechat_infolist_new_var_integer (ptr_item, "display_creation_date", channel->display_creation_date)) return 0; if (!weechat_infolist_new_var_integer (ptr_item, "nick_completion_reset", channel->nick_completion_reset)) @@ -955,6 +958,7 @@ irc_channel_print_log (struct t_irc_channel *channel) weechat_log_printf (" away_message . . . . . . : '%s'", channel->away_message); weechat_log_printf (" has_quit_server. . . . . : %d", channel->has_quit_server); weechat_log_printf (" cycle. . . . . . . . . . : %d", channel->cycle); + weechat_log_printf (" part . . . . . . . . . . : %d", channel->part); weechat_log_printf (" display_creation_date. . : %d", channel->display_creation_date); weechat_log_printf (" nick_completion_reset. . : %d", channel->nick_completion_reset); weechat_log_printf (" pv_remote_nick_color . . : '%s'", channel->pv_remote_nick_color); diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h index 4a77e45b6..d170a10ab 100644 --- a/src/plugins/irc/irc-channel.h +++ b/src/plugins/irc/irc-channel.h @@ -52,6 +52,7 @@ struct t_irc_channel int has_quit_server; /* =1 if nick has quit (pv only), to */ /* display message when he's back */ int cycle; /* currently cycling (/part + /join) */ + int part; /* /part done on channel? */ int display_creation_date; /* 1 for displaying creation date */ int nick_completion_reset; /* 1 for resetting nick completion */ /* there was some join/part on chan */ diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index a88306fc3..7e1b5f393 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -461,7 +461,11 @@ IRC_PROTOCOL_CALLBACK(join) pos_channel = (argv[2][0] == ':') ? argv[2] + 1 : argv[2]; ptr_channel = irc_channel_search (server, pos_channel); - if (!ptr_channel) + if (ptr_channel) + { + ptr_channel->part = 0; + } + else { /* * if someone else joins and channel is not opened, then just @@ -1272,6 +1276,8 @@ IRC_PROTOCOL_CALLBACK(part) { if (weechat_config_boolean (irc_config_look_part_closes_buffer)) weechat_buffer_close (ptr_channel->buffer); + else + ptr_channel->part = 1; } } else diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 94a5caac0..9fd26ea9b 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3499,7 +3499,8 @@ irc_server_autojoin_channels (struct t_irc_server *server) for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { - if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + if ((ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + && !ptr_channel->part) { if (ptr_channel->key) { diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index ec06283f2..bdf710c7a 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -416,6 +416,7 @@ irc_upgrade_read_cb (void *data, irc_upgrade_current_channel->away_message = strdup (str); irc_upgrade_current_channel->has_quit_server = weechat_infolist_integer (infolist, "has_quit_server"); irc_upgrade_current_channel->cycle = weechat_infolist_integer (infolist, "cycle"); + irc_upgrade_current_channel->part = weechat_infolist_integer (infolist, "part"); irc_upgrade_current_channel->display_creation_date = weechat_infolist_integer (infolist, "display_creation_date"); irc_upgrade_current_channel->nick_completion_reset = weechat_infolist_integer (infolist, "nick_completion_reset"); for (i = 0; i < 2; i++)