diff options
author | jgeboski <jgeboski@gmail.com> | 2015-01-28 18:40:47 -0500 |
---|---|---|
committer | jgeboski <jgeboski@gmail.com> | 2015-01-29 14:24:17 -0500 |
commit | 7821ee89fef7bae353b06fc4c23f3ab23093e5cc (patch) | |
tree | f406d02909d53bd8023a3653018ce9d95e38aea6 /irc_channel.c | |
parent | 7b8238d0c9f409deaa15147bc76fc77101cb52c3 (diff) |
irc_commands: implemented KICK support
With similar commands being supported, such as INVITE, the KICK command
should be supported as well. The key motivation behind supporting KICK
is having for having a way to remove users from group chats. As of now,
there is no way for a bitlbee user to remove a user from a group chat.
With no current KICK implementation, it made using this command a prime
candidate for the UI side of this implementation. In addition, the KICK
command has been supported in the control channel as well. This is to
keep the INVITE/KICK pair consistent.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index b8763ce3..4fe0fad4 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -625,6 +625,24 @@ static gboolean control_channel_invite( irc_channel_t *ic, irc_user_t *iu ) return TRUE; } +static void control_channel_kick( irc_channel_t *ic, irc_user_t *iu, const char *msg ) +{ + struct irc_control_channel *icc = ic->data; + bee_user_t *bu = iu->bu; + + if( bu == NULL ) + return; + + if( icc->type != IRC_CC_TYPE_GROUP ) + { + irc_send_num( ic->irc, 482, "%s :Kicks are only possible to fill_by=group channels", ic->name ); + return; + } + + bu->ic->acc->prpl->remove_buddy( bu->ic, bu->handle, + icc->group ? icc->group->name : NULL ); +} + static char *set_eval_by_account( set_t *set, char *value ); static char *set_eval_fill_by( set_t *set, char *value ); static char *set_eval_by_group( set_t *set, char *value ); @@ -843,6 +861,7 @@ static const struct irc_channel_funcs control_channel_funcs = { NULL, NULL, control_channel_invite, + control_channel_kick, control_channel_init, control_channel_free, |