Changeset 81186cab for irc_commands.c
- Timestamp:
- 2010-04-13T11:38:41Z (14 years ago)
- Branches:
- master
- Children:
- 21c87a7
- Parents:
- 573dab0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_commands.c
r573dab0 r81186cab 352 352 353 353 #if 0 354 //#if 0355 354 static void irc_cmd_oper( irc_t *irc, char **cmd ) 356 355 { … … 524 523 } 525 524 } 525 #endif 526 526 527 527 static void irc_cmd_away( irc_t *irc, char **cmd ) 528 528 { 529 user_t *u = user_find( irc, irc->nick ); 530 char *away = cmd[1]; 531 532 if( !u ) return; 533 534 if( away && *away ) 535 { 529 char *set; 530 531 if( cmd[1] && *cmd[1] ) 532 { 533 char away[strlen(cmd[1])+1]; 536 534 int i, j; 537 535 538 536 /* Copy away string, but skip control chars. Mainly because 539 537 Jabber really doesn't like them. */ 540 u->away = g_malloc( strlen( away ) + 1 ); 541 for( i = j = 0; away[i]; i ++ ) 542 if( ( u->away[j] = away[i] ) >= ' ' ) 538 for( i = j = 0; cmd[1][i]; i ++ ) 539 if( ( away[j] = cmd[1][i] ) >= ' ' ) 543 540 j ++; 544 u->away[j] = 0; 545 546 irc_send_num( irc, 306, ":You're now away: %s", u->away ); 547 /* irc_umode_set( irc, irc->myhost, "+a" ); */ 548 } 549 else 550 { 551 if( u->away ) g_free( u->away ); 552 u->away = NULL; 553 /* irc_umode_set( irc, irc->myhost, "-a" ); */ 541 away[j] = '\0'; 542 543 irc_send_num( irc, 306, ":You're now away: %s", away ); 544 set = away; 545 } 546 else 547 { 554 548 irc_send_num( irc, 305, ":Welcome back" ); 555 } 556 557 set_setstr( &irc->set, "away", u->away ); 558 } 559 549 set = NULL; 550 } 551 552 set_setstr( &irc->b->set, "away", set ); 553 } 554 555 #if 0 560 556 static void irc_cmd_version( irc_t *irc, char **cmd ) 561 557 { … … 613 609 { "nickserv", 1, irc_cmd_nickserv, IRC_CMD_LOGGED_IN }, 614 610 { "ns", 1, irc_cmd_nickserv, IRC_CMD_LOGGED_IN }, 611 { "away", 0, irc_cmd_away, IRC_CMD_LOGGED_IN }, 615 612 #if 0 616 613 { "oper", 2, irc_cmd_oper, IRC_CMD_LOGGED_IN }, … … 621 618 { "watch", 1, irc_cmd_watch, IRC_CMD_LOGGED_IN }, 622 619 { "topic", 1, irc_cmd_topic, IRC_CMD_LOGGED_IN }, 623 { "away", 0, irc_cmd_away, IRC_CMD_LOGGED_IN },624 620 { "version", 0, irc_cmd_version, IRC_CMD_LOGGED_IN }, 625 621 { "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN },
Note: See TracChangeset
for help on using the changeset viewer.