mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 23:36:37 +02:00
irc: remove channel from autojoin option when manually closing a buffer
This commit is contained in:
@@ -29,6 +29,7 @@ Bug fixes::
|
||||
|
||||
* core: fix bad window size on startup with some terminals like https://github.com/kovidgoyal/kitty[kitty] (issue #1769)
|
||||
* buflist: fix memory leak when reading config and changing option buflist.look.sort
|
||||
* irc: remove channel from autojoin option when manually closing a buffer with `/buffer close` or `/close`
|
||||
* irc: fix add of channel to autojoin option when joining a channel with a buffer still opened
|
||||
* relay: fix save of channels in autojoin option when JOIN and PART commands are received from an IRC relay client (issue #1771)
|
||||
* trigger: add `${buffer.notify} > 0` in conditions of default trigger "beep"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "irc-channel.h"
|
||||
#include "irc-command.h"
|
||||
#include "irc-config.h"
|
||||
#include "irc-join.h"
|
||||
#include "irc-raw.h"
|
||||
#include "irc-server.h"
|
||||
|
||||
@@ -181,6 +182,20 @@ irc_buffer_close_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (ptr_channel)
|
||||
{
|
||||
/*
|
||||
* remove channel from autojoin if autojoin_dynamic is set,
|
||||
* still connected to server and not quitting/upgrading WeeChat
|
||||
*/
|
||||
if (ptr_server
|
||||
&& IRC_SERVER_OPTION_BOOLEAN(ptr_server,
|
||||
IRC_SERVER_OPTION_AUTOJOIN_DYNAMIC)
|
||||
&& ptr_server->is_connected
|
||||
&& !irc_signal_quit_received
|
||||
&& !irc_signal_upgrade_received)
|
||||
{
|
||||
irc_join_remove_channel_from_autojoin (ptr_server,
|
||||
ptr_channel->name);
|
||||
}
|
||||
/* send PART for channel if its buffer is closed */
|
||||
if ((ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
&& (ptr_channel->nicks))
|
||||
|
||||
@@ -58,7 +58,8 @@ struct t_weechat_plugin *weechat_irc_plugin = NULL;
|
||||
|
||||
struct t_hook *irc_hook_timer = NULL;
|
||||
|
||||
int irc_signal_upgrade_received = 0; /* signal "upgrade" received ? */
|
||||
int irc_signal_quit_received = 0; /* signal "quit" received? */
|
||||
int irc_signal_upgrade_received = 0; /* signal "upgrade" received? */
|
||||
|
||||
|
||||
/*
|
||||
@@ -77,6 +78,8 @@ irc_signal_quit_cb (const void *pointer, void *data,
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
irc_signal_quit_received = 1;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
extern struct t_weechat_plugin *weechat_irc_plugin;
|
||||
|
||||
extern int irc_signal_quit_received;
|
||||
extern int irc_signal_upgrade_received;
|
||||
|
||||
#endif /* WEECHAT_PLUGIN_IRC_H */
|
||||
|
||||
Reference in New Issue
Block a user