diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-08 13:13:23 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-08 13:13:23 +0100 | 
| commit | bfb99eebd101fff1e15783c8fe4f00398c8052b3 (patch) | |
| tree | 6bbf75f4de24435304d5055234953900008b076b | |
| parent | a87754b68bb1eb07397d71a93ffcb0f3fc089266 (diff) | |
Allow leaving groupchat channels.
| -rw-r--r-- | irc.h | 3 | ||||
| -rw-r--r-- | irc_channel.c | 4 | ||||
| -rw-r--r-- | irc_im.c | 14 | 
3 files changed, 20 insertions, 1 deletions
| @@ -152,6 +152,9 @@ typedef struct irc_channel  struct irc_channel_funcs  {  	gboolean (*privmsg)( irc_channel_t *ic, const char *msg ); +	gboolean (*join)( irc_channel_t *ic ); +	gboolean (*part)( irc_channel_t *ic, const char *msg ); +	gboolean (*topic)( irc_channel_t *ic, const char *new );  };  typedef enum diff --git a/irc_channel.c b/irc_channel.c index 63c46d95..c8ee7a92 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -122,7 +122,11 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu )  		irc_send_part( ic, iu, "" );  	if( iu == ic->irc->user ) +	{  		ic->flags &= ~IRC_CHANNEL_JOINED; +		if( ic->f->part ) +			ic->f->part( ic, NULL ); +	}  	return 1;  } @@ -338,7 +338,6 @@ static gboolean bee_irc_chat_remove_user( bee_t *bee, struct groupchat *c, bee_u  }  /* IRC->IM */ -  static gboolean bee_irc_channel_chat_privmsg( irc_channel_t *ic, const char *msg )  {  	struct groupchat *c = ic->data; @@ -349,8 +348,21 @@ static gboolean bee_irc_channel_chat_privmsg( irc_channel_t *ic, const char *msg  } +static gboolean bee_irc_channel_chat_part( irc_channel_t *ic, const char *msg ) +{ +	struct groupchat *c = ic->data; +	 +	if( c->ic->acc->prpl->chat_leave ) +		c->ic->acc->prpl->chat_leave( c ); +	 +	return TRUE; +	 +} +  static const struct irc_channel_funcs irc_channel_im_chat_funcs = {  	bee_irc_channel_chat_privmsg, +	NULL, +	bee_irc_channel_chat_part,  }; | 
