diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-11-09 00:02:25 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2005-11-09 00:02:25 +0100 |
commit | 9c62a7cd418e836664aeee7035a39278687f3a50 (patch) | |
tree | 56d7686ac1b7483e52e6cdf1ae8614b413c036a8 /irc.c | |
parent | b4a8cd8869262182e85b6112bf7a51ce216a5f2d (diff) |
Fix GLib errors when sending QUIT.
Allow sending QUIT before registering.
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -161,7 +161,7 @@ void irc_free(irc_t * irc) g_source_remove( irc->r_watch_source_id ); if( irc->w_watch_source_id > 0 ) g_source_remove( irc->w_watch_source_id ); - g_io_channel_close( irc->io_channel ); + g_io_channel_unref( irc->io_channel ); irc_connection_list = g_slist_remove( irc_connection_list, irc ); @@ -462,6 +462,12 @@ int irc_exec( irc_t *irc, char **cmd ) } return( 1 ); } + else if( g_strcasecmp( cmd[0], "QUIT" ) == 0 ) + { + irc_write( irc, "ERROR :%s%s", cmd[1]?"Quit: ":"", cmd[1]?cmd[1]:"Client Quit" ); + g_io_channel_close( irc->io_channel ); + return( 0 ); + } if( !irc->user || !irc->nick ) { @@ -636,12 +642,6 @@ int irc_exec( irc_t *irc, char **cmd ) irc_send( irc, cmd[1], cmd[2], ( g_strcasecmp( cmd[0], "NOTICE" ) == 0 ) ? IM_FLAG_AWAY : 0 ); } } - else if( g_strcasecmp( cmd[0], "QUIT" ) == 0 ) - { - irc_write( irc, "ERROR :%s%s", cmd[1]?"Quit: ":"", cmd[1]?cmd[1]:"Client Quit" ); - g_io_channel_close( irc->io_channel ); - return( 0 ); - } else if( g_strcasecmp( cmd[0], "WHO" ) == 0 ) { irc_who( irc, cmd[1] ); |