Changeset 003a12b for irc_commands.c
- Timestamp:
- 2010-04-14T13:35:41Z (14 years ago)
- Branches:
- master
- Children:
- 4c3519a
- Parents:
- d7d677d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_commands.c
rd7d677d r003a12b 384 384 irc_send_num( irc, 482, "%s :Invite impossible; User/Channel non-existent or incompatible", channel ); 385 385 } 386 #endif 386 387 387 388 static void irc_cmd_userhost( irc_t *irc, char **cmd ) 388 389 { 389 user_t *u;390 390 int i; 391 391 … … 397 397 398 398 for( i = 1; cmd[i]; i ++ ) 399 if( ( u = user_find( irc, cmd[i] ) ) ) 400 { 401 if( u->online && u->away ) 402 irc_send_num( irc, 302, ":%s=-%s@%s", u->nick, u->user, u->host ); 403 else 404 irc_send_num( irc, 302, ":%s=+%s@%s", u->nick, u->user, u->host ); 405 } 399 { 400 irc_user_t *iu = irc_user_by_name( irc, cmd[i] ); 401 402 if( iu ) 403 irc_send_num( irc, 302, ":%s=%c%s@%s", iu->nick, 404 irc_user_get_away( iu ) ? '-' : '+', 405 iu->user, iu->host ); 406 } 406 407 } 407 408 408 409 static void irc_cmd_ison( irc_t *irc, char **cmd ) 409 410 { 410 user_t *u;411 411 char buff[IRC_MAX_LINE]; 412 412 int lenleft, i; … … 424 424 while( *this ) 425 425 { 426 irc_user_t *iu; 427 426 428 if( ( next = strchr( this, ' ' ) ) ) 427 429 *next = 0; 428 430 429 if( ( u = user_find( irc, this ) ) && u->online ) 430 { 431 lenleft -= strlen( u->nick ) + 1; 431 if( ( iu = irc_user_by_name( irc, this ) ) && 432 iu->bu && iu->bu->flags & BEE_USER_ONLINE ) 433 { 434 lenleft -= strlen( iu->nick ) + 1; 432 435 433 436 if( lenleft < 0 ) 434 437 break; 435 438 436 strcat( buff, u->nick );439 strcat( buff, iu->nick ); 437 440 strcat( buff, " " ); 438 441 } … … 470 473 { 471 474 char *nick; 472 user_t *u;475 irc_user_t *iu; 473 476 474 477 if( !cmd[i][0] || !cmd[i][1] ) … … 478 481 nick_lc( nick ); 479 482 480 u = user_find( irc, nick );483 iu = irc_user_by_name( irc, nick ); 481 484 482 485 if( cmd[i][0] == '+' ) … … 485 488 g_hash_table_insert( irc->watches, nick, nick ); 486 489 487 if( u && u->online ) 488 irc_send_num( irc, 604, "%s %s %s %d :%s", u->nick, u->user, u->host, (int) time( NULL ), "is online" ); 490 if( iu && iu->bu && iu->bu->flags & BEE_USER_ONLINE ) 491 irc_send_num( irc, 604, "%s %s %s %d :%s", iu->nick, iu->user, 492 iu->host, (int) time( NULL ), "is online" ); 489 493 else 490 irc_send_num( irc, 605, "%s %s %s %d :%s", nick, "*", "*", (int) time( NULL ), "is offline" ); 494 irc_send_num( irc, 605, "%s %s %s %d :%s", nick, "*", "*", 495 (int) time( NULL ), "is offline" ); 491 496 } 492 497 else if( cmd[i][0] == '-' ) … … 505 510 } 506 511 512 #if 0 507 513 static void irc_cmd_topic( irc_t *irc, char **cmd ) 508 514 { … … 610 616 { "version", 0, irc_cmd_version, IRC_CMD_LOGGED_IN }, 611 617 { "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN }, 612 { "oper", 2, irc_cmd_oper, IRC_CMD_LOGGED_IN }, 618 { "userhost", 1, irc_cmd_userhost, IRC_CMD_LOGGED_IN }, 619 { "ison", 1, irc_cmd_ison, IRC_CMD_LOGGED_IN }, 620 { "watch", 1, irc_cmd_watch, IRC_CMD_LOGGED_IN }, 613 621 #if 0 614 622 { "invite", 2, irc_cmd_invite, IRC_CMD_LOGGED_IN }, 615 623 { "notice", 1, irc_cmd_privmsg, IRC_CMD_LOGGED_IN }, 616 { "userhost", 1, irc_cmd_userhost, IRC_CMD_LOGGED_IN },617 { "ison", 1, irc_cmd_ison, IRC_CMD_LOGGED_IN },618 { "watch", 1, irc_cmd_watch, IRC_CMD_LOGGED_IN },619 624 { "topic", 1, irc_cmd_topic, IRC_CMD_LOGGED_IN }, 620 625 #endif 626 { "oper", 2, irc_cmd_oper, IRC_CMD_LOGGED_IN }, 621 627 { "die", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, 622 628 { "deaf", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
Note: See TracChangeset
for help on using the changeset viewer.