Changeset 66b9e36a
- Timestamp:
- 2010-05-08T21:52:25Z (14 years ago)
- Branches:
- master
- Children:
- eb37735
- Parents:
- e685657
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
re685657 r66b9e36a 158 158 gboolean (*part)( irc_channel_t *ic, const char *msg ); 159 159 gboolean (*topic)( irc_channel_t *ic, const char *new ); 160 gboolean (*invite)( irc_channel_t *ic, irc_user_t *iu ); 160 161 }; 161 162 -
irc_commands.c
re685657 r66b9e36a 370 370 } 371 371 372 #if 0373 372 static void irc_cmd_invite( irc_t *irc, char **cmd ) 374 373 { 375 char *nick = cmd[1], *channel = cmd[2]; 376 struct groupchat *c = irc_chat_by_channel( irc, channel ); 377 user_t *u = user_find( irc, nick ); 378 379 if( u && c && ( u->ic == c->ic ) ) 380 if( c->ic && c->ic->acc->prpl->chat_invite ) 381 { 382 c->ic->acc->prpl->chat_invite( c, u->handle, NULL ); 383 irc_send_num( irc, 341, "%s %s", nick, channel ); 384 return; 385 } 386 387 irc_send_num( irc, 482, "%s :Invite impossible; User/Channel non-existent or incompatible", channel ); 388 } 389 #endif 374 irc_channel_t *ic; 375 irc_user_t *iu; 376 377 if( ( iu = irc_user_by_name( irc, cmd[1] ) ) == NULL ) 378 { 379 irc_send_num( irc, 401, "%s :No such nick", cmd[1] ); 380 return; 381 } 382 else if( ( ic = irc_channel_by_name( irc, cmd[2] ) ) == NULL ) 383 { 384 irc_send_num( irc, 403, "%s :No such channel", cmd[2] ); 385 return; 386 } 387 388 if( ic->f->invite ) 389 ic->f->invite( ic, iu ); 390 else 391 irc_send_num( irc, 482, "%s :Can't invite people here", cmd[2] ); 392 } 390 393 391 394 static void irc_cmd_userhost( irc_t *irc, char **cmd ) … … 618 621 { "ison", 1, irc_cmd_ison, IRC_CMD_LOGGED_IN }, 619 622 { "watch", 1, irc_cmd_watch, IRC_CMD_LOGGED_IN }, 623 { "invite", 2, irc_cmd_invite, IRC_CMD_LOGGED_IN }, 620 624 #if 0 621 { "invite", 2, irc_cmd_invite, IRC_CMD_LOGGED_IN },622 625 { "notice", 1, irc_cmd_privmsg, IRC_CMD_LOGGED_IN }, 623 626 { "topic", 1, irc_cmd_topic, IRC_CMD_LOGGED_IN }, -
irc_im.c
re685657 r66b9e36a 413 413 } 414 414 415 static gboolean bee_irc_channel_chat_invite( irc_channel_t *ic, irc_user_t *iu ) 416 { 417 struct groupchat *c = ic->data; 418 419 if( iu->bu->ic != c->ic ) 420 irc_send_num( ic->irc, 482, "%s :Can't mix different IM networks in one groupchat", ic->name ); 421 else if( c->ic->acc->prpl->chat_invite ) 422 c->ic->acc->prpl->chat_invite( c, iu->bu->handle, NULL ); 423 else 424 irc_send_num( ic->irc, 482, "%s :IM protocol does not support room invitations", ic->name ); 425 426 return TRUE; 427 } 428 415 429 static const struct irc_channel_funcs irc_channel_im_chat_funcs = { 416 430 bee_irc_channel_chat_privmsg, … … 418 432 bee_irc_channel_chat_part, 419 433 bee_irc_channel_chat_topic, 434 bee_irc_channel_chat_invite, 420 435 }; 421 436
Note: See TracChangeset
for help on using the changeset viewer.