From 18da20bf7690ca3c1e9cf4b70c2749a11c75b339 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 6 Jun 2010 01:33:33 +0100 Subject: Added /part msgs, and the ability to silently remove users from channels (when sending a /quit instead, for example). --- irc_channel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'irc_channel.c') diff --git a/irc_channel.c b/irc_channel.c index bceb067c..b3904d22 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -80,7 +80,7 @@ int irc_channel_free( irc_channel_t *ic ) irc_t *irc = ic->irc; if( ic->flags & IRC_CHANNEL_JOINED ) - irc_channel_del_user( ic, irc->user ); + irc_channel_del_user( ic, irc->user, FALSE, "Cleaning up channel" ); irc->channels = g_slist_remove( irc->channels, ic ); while( ic->users ) @@ -141,7 +141,7 @@ int irc_channel_add_user( irc_channel_t *ic, irc_user_t *iu ) return 1; } -int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu ) +int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu, gboolean silent, const char *msg ) { irc_channel_user_t *icu; @@ -151,8 +151,8 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu ) ic->users = g_slist_remove( ic->users, icu ); g_free( icu ); - if( ic->flags & IRC_CHANNEL_JOINED ) - irc_send_part( ic, iu, "" ); + if( ic->flags & IRC_CHANNEL_JOINED && !silent ) + irc_send_part( ic, iu, msg ); if( iu == ic->irc->user ) ic->flags &= ~IRC_CHANNEL_JOINED; -- cgit v1.2.3