Changes in root_commands.c [8365610:da3b536]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r8365610 rda3b536 57 57 s --; 58 58 } 59 else 60 { 61 break; 62 } 63 } 64 else if( *s == '\\' && ( ( !q && s[1] ) || ( q && q == s[1] ) ) ) 65 { 66 char *cpy; 67 68 for( cpy = s; *cpy; cpy ++ ) 69 cpy[0] = cpy[1]; 59 70 } 60 71 else if( *s == q ) … … 245 256 int i = 0; 246 257 258 if( strchr( irc->umode, 'b' ) ) 259 irc_usermsg( irc, "Account list:" ); 260 247 261 for( a = irc->accounts; a; a = a->next ) 248 262 { … … 347 361 { 348 362 account_t *a; 363 int add_for_real = 1; 364 365 if( g_strcasecmp( cmd[1], "-tmp" ) == 0 ) 366 { 367 add_for_real = 0; 368 cmd ++; /* So evil... :-D */ 369 } 349 370 350 371 if( !( a = account_get( irc, cmd[1] ) ) ) … … 376 397 } 377 398 } 378 a->gc->prpl->add_buddy( a->gc, cmd[2] ); 399 400 /* By making this optional, you can talk to people without having to 401 add them to your *real* (server-side) contact list. */ 402 if( add_for_real ) 403 a->gc->prpl->add_buddy( a->gc, cmd[2] ); 404 379 405 add_buddy( a->gc, NULL, cmd[2], cmd[2] ); 380 406 … … 484 510 account_t *a; 485 511 486 if( !cmd[2] ) 512 if( !cmd[2] && ( a = account_get( irc, cmd[1] ) ) && a->gc ) 513 { 514 char *format; 515 GSList *l; 516 517 if( strchr( irc->umode, 'b' ) != NULL ) 518 format = "%s\t%s"; 519 else 520 format = "%-32.32s %-16.16s"; 521 522 irc_usermsg( irc, format, "Handle", "Nickname" ); 523 for( l = a->gc->deny; l; l = l->next ) 524 { 525 user_t *u = user_findhandle( a->gc, l->data ); 526 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 527 } 528 irc_usermsg( irc, "End of list." ); 529 530 return; 531 } 532 else if( !cmd[2] ) 487 533 { 488 534 user_t *u = user_find( irc, cmd[1] ); … … 512 558 else 513 559 { 514 gc->prpl->rem_permit( gc, cmd[2] );515 gc->prpl->add_deny( gc, cmd[2] );516 irc_usermsg( irc, "Buddy `%s' moved from your permit- to your deny-list", cmd[2] );560 bim_rem_allow( gc, cmd[2] ); 561 bim_add_block( gc, cmd[2] ); 562 irc_usermsg( irc, "Buddy `%s' moved from your allow- to your block-list", cmd[2] ); 517 563 } 518 564 } … … 523 569 account_t *a; 524 570 525 if( !cmd[2] ) 571 if( !cmd[2] && ( a = account_get( irc, cmd[1] ) ) && a->gc ) 572 { 573 char *format; 574 GSList *l; 575 576 if( strchr( irc->umode, 'b' ) != NULL ) 577 format = "%s\t%s"; 578 else 579 format = "%-32.32s %-16.16s"; 580 581 irc_usermsg( irc, format, "Handle", "Nickname" ); 582 for( l = a->gc->deny; l; l = l->next ) 583 { 584 user_t *u = user_findhandle( a->gc, l->data ); 585 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 586 } 587 irc_usermsg( irc, "End of list." ); 588 589 return; 590 } 591 else if( !cmd[2] ) 526 592 { 527 593 user_t *u = user_find( irc, cmd[1] ); … … 551 617 else 552 618 { 553 gc->prpl->rem_deny( gc, cmd[2] );554 gc->prpl->add_permit( gc, cmd[2] );555 556 irc_usermsg( irc, "Buddy `%s' moved from your deny- to your permit-list", cmd[2] );619 bim_rem_block( gc, cmd[2] ); 620 bim_add_allow( gc, cmd[2] ); 621 622 irc_usermsg( irc, "Buddy `%s' moved from your block- to your allow-list", cmd[2] ); 557 623 } 558 624 } … … 635 701 int online = 0, away = 0, offline = 0; 636 702 user_t *u; 637 char s[64]; 703 char s[256]; 704 char *format; 638 705 int n_online = 0, n_away = 0, n_offline = 0; 639 706 … … 649 716 online = away = 1; 650 717 651 irc_usermsg( irc, "%-16.16s %-40.40s %s", "Nick", "User/Host/Network", "Status" ); 652 653 if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 654 { 655 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 656 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Online" ); 718 if( strchr( irc->umode, 'b' ) != NULL ) 719 format = "%s\t%s\t%s"; 720 else 721 format = "%-16.16s %-40.40s %s"; 722 723 irc_usermsg( irc, format, "Nick", "User/Host/Network", "Status" ); 724 725 for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 726 { 727 if( online == 1 ) 728 { 729 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 730 irc_usermsg( irc, format, u->nick, s, "Online" ); 731 } 732 657 733 n_online ++; 658 734 } 659 735 660 if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 661 { 662 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 663 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, u->away ); 736 for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 737 { 738 if( away == 1 ) 739 { 740 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 741 irc_usermsg( irc, format, u->nick, s, u->away ); 742 } 664 743 n_away ++; 665 744 } 666 745 667 if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 668 { 669 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 670 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Offline" ); 746 for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 747 { 748 if( offline == 1 ) 749 { 750 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 751 irc_usermsg( irc, format, u->nick, s, "Offline" ); 752 } 671 753 n_offline ++; 672 754 } … … 697 779 else 698 780 { 699 char utf8[1024];700 701 781 irc_usermsg( irc, "Setting your name to `%s'", cmd[2] ); 702 782 703 if( g_strncasecmp( set_getstr( irc, "charset" ), "none", 4 ) != 0 && 704 do_iconv( set_getstr( irc, "charset" ), "UTF-8", cmd[2], utf8, 0, 1024 ) != -1 ) 705 a->gc->prpl->set_info( a->gc, utf8 ); 706 else 707 a->gc->prpl->set_info( a->gc, cmd[2] ); 783 a->gc->prpl->set_info( a->gc, cmd[2] ); 708 784 } 709 785 }
Note: See TracChangeset
for help on using the changeset viewer.