Changeset 7821ee8 for irc_channel.c


Ignore:
Timestamp:
2015-01-29T19:24:17Z (5 years ago)
Author:
jgeboski <jgeboski@…>
Branches:
master
Children:
e41cc40
Parents:
7b8238d
git-author:
jgeboski <jgeboski@…> (28-01-15 23:40:47)
git-committer:
jgeboski <jgeboski@…> (29-01-15 19:24:17)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    r7b8238d r7821ee8  
    626626}
    627627
     628static void control_channel_kick( irc_channel_t *ic, irc_user_t *iu, const char *msg )
     629{
     630        struct irc_control_channel *icc = ic->data;
     631        bee_user_t *bu = iu->bu;
     632       
     633        if( bu == NULL )
     634                return;
     635       
     636        if( icc->type != IRC_CC_TYPE_GROUP )
     637        {
     638                irc_send_num( ic->irc, 482, "%s :Kicks are only possible to fill_by=group channels", ic->name );
     639                return;
     640        }
     641       
     642        bu->ic->acc->prpl->remove_buddy( bu->ic, bu->handle,
     643                                         icc->group ? icc->group->name : NULL );
     644}
     645
    628646static char *set_eval_by_account( set_t *set, char *value );
    629647static char *set_eval_fill_by( set_t *set, char *value );
     
    844862        NULL,
    845863        control_channel_invite,
     864        control_channel_kick,
    846865       
    847866        control_channel_init,
Note: See TracChangeset for help on using the changeset viewer.