aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-28 18:40:47 -0500
committerjgeboski <jgeboski@gmail.com>2015-01-29 14:24:17 -0500
commit7821ee89fef7bae353b06fc4c23f3ab23093e5cc (patch)
treef406d02909d53bd8023a3653018ce9d95e38aea6 /irc_im.c
parent7b8238d0c9f409deaa15147bc76fc77101cb52c3 (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_im.c')
-rw-r--r--irc_im.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/irc_im.c b/irc_im.c
index 9f4fd83c..810d82be 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -971,6 +971,23 @@ static gboolean bee_irc_channel_chat_invite( irc_channel_t *ic, irc_user_t *iu )
return TRUE;
}
+static void bee_irc_channel_chat_kick( irc_channel_t *ic, irc_user_t *iu, const char *msg )
+{
+ struct groupchat *c = ic->data;
+ bee_user_t *bu = iu->bu;
+
+ if( ( c == NULL ) || ( bu == NULL ) )
+ return;
+
+ if( !c->ic->acc->prpl->chat_kick )
+ {
+ irc_send_num( ic->irc, 482, "%s :IM protocol does not support room kicking", ic->name );
+ return;
+ }
+
+ c->ic->acc->prpl->chat_kick( c, iu->bu->handle, msg );
+}
+
static char *set_eval_room_account( set_t *set, char *value );
static char *set_eval_chat_type( set_t *set, char *value );
@@ -1055,6 +1072,7 @@ const struct irc_channel_funcs irc_channel_im_chat_funcs = {
bee_irc_channel_chat_part,
bee_irc_channel_chat_topic,
bee_irc_channel_chat_invite,
+ bee_irc_channel_chat_kick,
bee_irc_channel_init,
bee_irc_channel_free,