Changeset 7821ee8
- Timestamp:
- 2015-01-29T19:24:17Z (10 years ago)
- 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)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r7b8238d r7821ee8 188 188 gboolean (*topic)( irc_channel_t *ic, const char *new_topic ); 189 189 gboolean (*invite)( irc_channel_t *ic, irc_user_t *iu ); 190 void (*kick)( irc_channel_t *ic, irc_user_t *iu, const char *msg ); 190 191 191 192 gboolean (*_init)( irc_channel_t *ic ); -
irc_channel.c
r7b8238d r7821ee8 626 626 } 627 627 628 static 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 628 646 static char *set_eval_by_account( set_t *set, char *value ); 629 647 static char *set_eval_fill_by( set_t *set, char *value ); … … 844 862 NULL, 845 863 control_channel_invite, 864 control_channel_kick, 846 865 847 866 control_channel_init, -
irc_commands.c
r7b8238d r7821ee8 498 498 else if( ic->f->invite( ic, iu ) ) 499 499 irc_send_num( irc, 341, "%s %s", iu->nick, ic->name ); 500 } 501 502 static void irc_cmd_kick( irc_t *irc, char **cmd ) 503 { 504 irc_channel_t *ic; 505 irc_user_t *iu; 506 507 if( ( iu = irc_user_by_name( irc, cmd[2] ) ) == NULL ) 508 { 509 irc_send_num( irc, 401, "%s :No such nick", cmd[2] ); 510 return; 511 } 512 else if( ( ic = irc_channel_by_name( irc, cmd[1] ) ) == NULL ) 513 { 514 irc_send_num( irc, 403, "%s :No such channel", cmd[1] ); 515 return; 516 } 517 else if( !ic->f->kick ) 518 { 519 irc_send_num( irc, 482, "%s :Can't kick people here", cmd[1] ); 520 return; 521 } 522 523 ic->f->kick( ic, iu, cmd[3] ? cmd[3] : NULL ); 500 524 } 501 525 … … 746 770 { "watch", 1, irc_cmd_watch, IRC_CMD_LOGGED_IN }, 747 771 { "invite", 2, irc_cmd_invite, IRC_CMD_LOGGED_IN }, 772 { "kick", 2, irc_cmd_kick, IRC_CMD_LOGGED_IN }, 748 773 { "topic", 1, irc_cmd_topic, IRC_CMD_LOGGED_IN }, 749 774 { "oper", 2, irc_cmd_oper, IRC_CMD_LOGGED_IN }, -
irc_im.c
r7b8238d r7821ee8 972 972 } 973 973 974 static void bee_irc_channel_chat_kick( irc_channel_t *ic, irc_user_t *iu, const char *msg ) 975 { 976 struct groupchat *c = ic->data; 977 bee_user_t *bu = iu->bu; 978 979 if( ( c == NULL ) || ( bu == NULL ) ) 980 return; 981 982 if( !c->ic->acc->prpl->chat_kick ) 983 { 984 irc_send_num( ic->irc, 482, "%s :IM protocol does not support room kicking", ic->name ); 985 return; 986 } 987 988 c->ic->acc->prpl->chat_kick( c, iu->bu->handle, msg ); 989 } 990 974 991 static char *set_eval_room_account( set_t *set, char *value ); 975 992 static char *set_eval_chat_type( set_t *set, char *value ); … … 1056 1073 bee_irc_channel_chat_topic, 1057 1074 bee_irc_channel_chat_invite, 1075 bee_irc_channel_chat_kick, 1058 1076 1059 1077 bee_irc_channel_init, -
protocols/nogaim.h
r7b8238d r7821ee8 213 213 */ 214 214 void (* chat_invite) (struct groupchat *, char *who, char *message); 215 /* This is called when the user uses the /kick IRC command. 216 * - 'who' is a handle to kick 217 * - 'message' is a kick message or NULL 218 */ 219 void (* chat_kick) (struct groupchat *, char *who, const char *message); 215 220 /* This is called when the user uses the /part IRC command in a group 216 221 * chat. You just should tell the user about it, nothing more. */
Note: See TracChangeset
for help on using the changeset viewer.