diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-09 00:43:13 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-09 00:43:13 +0100 |
commit | 46d215d562f8e1aba2b24e2d1feab27337956d50 (patch) | |
tree | d2c4edcb1c8ca69e78402dc955de3b118686f515 /irc_channel.c | |
parent | d7db3468f95d6b8ed2a161c71cb5b6ab1a7b5895 (diff) |
Allow moving contacts around between groups. Works with at least Jabber,
will check the others now.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c index c676afe6..54e68577 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -358,6 +358,26 @@ static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) return TRUE; } +static gboolean control_channel_invite( irc_channel_t *ic, irc_user_t *iu ) +{ + struct irc_control_channel *icc = ic->data; + bee_user_t *bu = iu->bu; + + if( bu == NULL ) + return FALSE; + + if( icc->type != IRC_CC_TYPE_GROUP ) + { + irc_send_num( ic->irc, 482, "%s :Invitations are only possible to fill_by=group channels", ic->name ); + return FALSE; + } + + bu->ic->acc->prpl->add_buddy( bu->ic, bu->handle, + icc->group ? icc->group->name : NULL ); + + return TRUE; +} + 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 ); @@ -455,7 +475,7 @@ static const struct irc_channel_funcs control_channel_funcs = { NULL, NULL, NULL, - NULL, + control_channel_invite, control_channel_init, control_channel_free, |