irc: don't close channel buffer on second /part when option irc.look.part_closes_buffer is off (closes #313)

(cherry picked from commit 1a68242f95383e8bbaa500c9bc9447c3ce9af8ff)
This commit is contained in:
Sébastien Helleu 2015-01-24 09:37:47 +01:00
parent 0796f343ee
commit b35873fc3e
2 changed files with 13 additions and 5 deletions

View File

@ -19,6 +19,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: fix crash when a root bar has conditions different from
active/inactive/nicklist (closes #317)
* irc: don't close channel buffer on second /part when option
irc.look.part_closes_buffer is off (closes #313)
* irc: fix /join on a channel buffer opened with autojoin but which failed to
join
* irc: send QUIT to server and no PART for channels when the server buffer

View File

@ -3650,6 +3650,7 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
{
if (irc_channel_is_channel (ptr_server, argv[1]))
{
ptr_channel = irc_channel_search (ptr_server, argv[1]);
channel_name = argv[1];
pos_args = argv_eol[2];
}
@ -3679,15 +3680,20 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
weechat_prefix ("error"), IRC_PLUGIN_NAME, "part");
return WEECHAT_RC_OK;
}
if (!ptr_channel->nicks)
{
weechat_buffer_close (ptr_channel->buffer);
return WEECHAT_RC_OK;
}
channel_name = ptr_channel->name;
pos_args = NULL;
}
if (ptr_channel && !ptr_channel->nicks)
{
if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|| weechat_config_boolean (irc_config_look_part_closes_buffer))
{
weechat_buffer_close (ptr_channel->buffer);
}
return WEECHAT_RC_OK;
}
irc_command_part_channel (ptr_server, channel_name, pos_args);
return WEECHAT_RC_OK;