mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Don't set channel->server = NULL when disconnecting, so scripts can still
use it in eg. "channel destroyed". Patch by Qrczak git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2648 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
dc4b7456dc
commit
bfae72766e
@ -64,7 +64,7 @@ void channel_destroy(CHANNEL_REC *channel)
|
||||
channel->destroying = TRUE;
|
||||
|
||||
channels = g_slist_remove(channels, channel);
|
||||
if (channel->server != NULL)
|
||||
if (!channel->server->disconnected)
|
||||
channel->server->channels = g_slist_remove(channel->server->channels, channel);
|
||||
signal_emit("channel destroyed", 1, channel);
|
||||
|
||||
|
@ -331,7 +331,6 @@ static int server_remove_channels(SERVER_REC *server)
|
||||
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
|
||||
CHANNEL_REC *channel = tmp->data;
|
||||
|
||||
channel->server = NULL;
|
||||
channel_destroy(channel);
|
||||
found = TRUE;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ static void signal_channel_destroyed(CHANNEL_REC *channel)
|
||||
window_item_destroy((WI_ITEM_REC *) channel);
|
||||
|
||||
if (channel->joined && !channel->left &&
|
||||
channel->server != NULL) {
|
||||
!channel->server->disconnected) {
|
||||
/* kicked out from channel */
|
||||
window_bind_add(window, channel->server->tag,
|
||||
channel->name);
|
||||
|
@ -162,7 +162,7 @@ static void sig_remove_rejoin(IRC_CHANNEL_REC *channel)
|
||||
{
|
||||
REJOIN_REC *rec;
|
||||
|
||||
if (!IS_IRC_CHANNEL(channel) || channel->server == NULL)
|
||||
if (!IS_IRC_CHANNEL(channel))
|
||||
return;
|
||||
|
||||
rec = rejoin_find(channel->server, channel->name);
|
||||
|
@ -132,7 +132,7 @@ static void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
|
||||
{
|
||||
g_return_if_fail(channel != NULL);
|
||||
|
||||
if (IS_IRC_CHANNEL(channel) && channel->server != NULL &&
|
||||
if (IS_IRC_CHANNEL(channel) && !channel->server->disconnected &&
|
||||
!channel->synced)
|
||||
query_remove_all(channel);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ static void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
|
||||
if (!IS_IRC_CHANNEL(channel))
|
||||
return;
|
||||
|
||||
if (channel->server != NULL && !channel->left && !channel->kicked) {
|
||||
if (!channel->server->disconnected && !channel->left && !channel->kicked) {
|
||||
/* destroying channel record without actually
|
||||
having left the channel yet */
|
||||
signal_emit("command part", 3, "", channel->server, channel);
|
||||
|
Loading…
Reference in New Issue
Block a user