Changeset 6e9ae72 for root_commands.c
- Timestamp:
- 2011-12-17T13:50:01Z (12 years ago)
- Branches:
- master
- Children:
- 18c6d36
- Parents:
- 87dddee (diff), 17f057d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r87dddee r6e9ae72 42 42 if( cmd[blaat] == NULL ) \ 43 43 { \ 44 irc_ usermsg( irc, "Not enough parameters given (need %d).", x ); \44 irc_rootmsg( irc, "Not enough parameters given (need %d).", x ); \ 45 45 return y; \ 46 46 } \ … … 69 69 } 70 70 71 irc_ usermsg( irc, "Unknown command: %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[0] );71 irc_rootmsg( irc, "Unknown command: %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[0] ); 72 72 } 73 73 … … 90 90 if( s ) 91 91 { 92 irc_ usermsg( irc, "%s", s );92 irc_rootmsg( irc, "%s", s ); 93 93 g_free( s ); 94 94 } 95 95 else 96 96 { 97 irc_ usermsg( irc, "Error opening helpfile." );97 irc_rootmsg( irc, "Error opening helpfile." ); 98 98 } 99 99 } … … 110 110 if( irc->status & USTATUS_IDENTIFIED ) 111 111 { 112 irc_ usermsg( irc, "You're already logged in." );112 irc_rootmsg( irc, "You're already logged in." ); 113 113 return; 114 114 } … … 128 128 else if( irc->b->accounts != NULL ) 129 129 { 130 irc_ usermsg( irc,130 irc_rootmsg( irc, 131 131 "You're trying to identify yourself, but already have " 132 132 "at least one IM account set up. " … … 138 138 if( password == NULL ) 139 139 { 140 irc_ usermsg( irc, "About to identify, use /OPER to enter the password" );140 irc_rootmsg( irc, "About to identify, use /OPER to enter the password" ); 141 141 irc->status |= OPER_HACK_IDENTIFY; 142 142 return; … … 150 150 switch (status) { 151 151 case STORAGE_INVALID_PASSWORD: 152 irc_ usermsg( irc, "Incorrect password" );152 irc_rootmsg( irc, "Incorrect password" ); 153 153 break; 154 154 case STORAGE_NO_SUCH_USER: 155 irc_ usermsg( irc, "The nick is (probably) not registered" );155 irc_rootmsg( irc, "The nick is (probably) not registered" ); 156 156 break; 157 157 case STORAGE_OK: 158 irc_ usermsg( irc, "Password accepted%s",158 irc_rootmsg( irc, "Password accepted%s", 159 159 load ? ", settings and accounts loaded" : "" ); 160 160 irc_setpass( irc, password ); … … 192 192 case STORAGE_OTHER_ERROR: 193 193 default: 194 irc_ usermsg( irc, "Unknown error while loading configuration" );194 irc_rootmsg( irc, "Unknown error while loading configuration" ); 195 195 break; 196 196 } … … 215 215 if( global.conf->authmode == AUTHMODE_REGISTERED ) 216 216 { 217 irc_ usermsg( irc, "This server does not allow registering new accounts" );217 irc_rootmsg( irc, "This server does not allow registering new accounts" ); 218 218 return; 219 219 } … … 221 221 if( cmd[1] == NULL ) 222 222 { 223 irc_ usermsg( irc, "About to register, use /OPER to enter the password" );223 irc_rootmsg( irc, "About to register, use /OPER to enter the password" ); 224 224 irc->status |= OPER_HACK_REGISTER; 225 225 return; … … 228 228 switch( storage_save( irc, cmd[1], FALSE ) ) { 229 229 case STORAGE_ALREADY_EXISTS: 230 irc_ usermsg( irc, "Nick is already registered" );230 irc_rootmsg( irc, "Nick is already registered" ); 231 231 break; 232 232 233 233 case STORAGE_OK: 234 irc_ usermsg( irc, "Account successfully created" );234 irc_rootmsg( irc, "Account successfully created" ); 235 235 irc_setpass( irc, cmd[1] ); 236 236 irc->status |= USTATUS_IDENTIFIED; … … 245 245 246 246 default: 247 irc_ usermsg( irc, "Error registering" );247 irc_rootmsg( irc, "Error registering" ); 248 248 break; 249 249 } … … 257 257 switch (status) { 258 258 case STORAGE_NO_SUCH_USER: 259 irc_ usermsg( irc, "That account does not exist" );259 irc_rootmsg( irc, "That account does not exist" ); 260 260 break; 261 261 case STORAGE_INVALID_PASSWORD: 262 irc_ usermsg( irc, "Password invalid" );262 irc_rootmsg( irc, "Password invalid" ); 263 263 break; 264 264 case STORAGE_OK: … … 266 266 irc->status &= ~USTATUS_IDENTIFIED; 267 267 irc_umode_set( irc, "-R", 1 ); 268 irc_ usermsg( irc, "Account `%s' removed", irc->user->nick );268 irc_rootmsg( irc, "Account `%s' removed", irc->user->nick ); 269 269 break; 270 270 default: 271 irc_ usermsg( irc, "Error: `%d'", status );271 irc_rootmsg( irc, "Error: `%d'", status ); 272 272 break; 273 273 } … … 277 277 { 278 278 if( ( irc->status & USTATUS_IDENTIFIED ) == 0 ) 279 irc_ usermsg( irc, "Please create an account first" );279 irc_rootmsg( irc, "Please create an account first" ); 280 280 else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK ) 281 irc_ usermsg( irc, "Configuration saved" );282 else 283 irc_ usermsg( irc, "Configuration could not be saved!" );281 irc_rootmsg( irc, "Configuration saved" ); 282 else 283 irc_rootmsg( irc, "Configuration could not be saved!" ); 284 284 } 285 285 … … 290 290 291 291 if( ( val = set_getstr( head, key ) ) ) 292 irc_ usermsg( irc, "%s = `%s'", key, val );292 irc_rootmsg( irc, "%s = `%s'", key, val ); 293 293 else if( !( set = set_find( head, key ) ) ) 294 294 { 295 irc_ usermsg( irc, "Setting `%s' does not exist.", key );295 irc_rootmsg( irc, "Setting `%s' does not exist.", key ); 296 296 if( *head == irc->b->set ) 297 irc_ usermsg( irc, "It might be an account or channel setting. "297 irc_rootmsg( irc, "It might be an account or channel setting. " 298 298 "See \x02help account set\x02 and \x02help channel set\x02." ); 299 299 } 300 300 else if( set->flags & SET_PASSWORD ) 301 irc_ usermsg( irc, "%s = `********' (hidden)", key );302 else 303 irc_ usermsg( irc, "%s is empty", key );301 irc_rootmsg( irc, "%s = `********' (hidden)", key ); 302 else 303 irc_rootmsg( irc, "%s is empty", key ); 304 304 } 305 305 … … 344 344 feedback. */ 345 345 if( st ) 346 irc_ usermsg( irc, "Setting changed successfully" );346 irc_rootmsg( irc, "Setting changed successfully" ); 347 347 else 348 irc_ usermsg( irc, "Failed to change setting" );348 irc_rootmsg( irc, "Failed to change setting" ); 349 349 } 350 350 else … … 362 362 while( s ) 363 363 { 364 if( !( s->flags & SET_HIDDEN) )364 if( set_isvisible( s ) ) 365 365 cmd_showset( irc, &s, s->key ); 366 366 s = s->next; … … 377 377 if( a->ic && s && s->flags & ACC_SET_OFFLINE_ONLY ) 378 378 { 379 irc_ usermsg( irc, "This setting can only be changed when the account is %s-line", "off" );379 irc_rootmsg( irc, "This setting can only be changed when the account is %s-line", "off" ); 380 380 return 0; 381 381 } 382 382 else if( !a->ic && s && s->flags & ACC_SET_ONLINE_ONLY ) 383 383 { 384 irc_ usermsg( irc, "This setting can only be changed when the account is %s-line", "on" );384 irc_rootmsg( irc, "This setting can only be changed when the account is %s-line", "on" ); 385 385 return 0; 386 386 } … … 396 396 if( global.conf->authmode == AUTHMODE_REGISTERED && !( irc->status & USTATUS_IDENTIFIED ) ) 397 397 { 398 irc_ usermsg( irc, "This server only accepts registered users" );398 irc_rootmsg( irc, "This server only accepts registered users" ); 399 399 return; 400 400 } … … 413 413 if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 414 414 { 415 irc_ usermsg( irc, "Enter password for account %s(%s)"416 "first (use /OPER)", a-> prpl->name, a->user);415 irc_rootmsg( irc, "Enter password for account %s " 416 "first (use /OPER)", a->tag ); 417 417 return; 418 418 } … … 425 425 if( prpl == NULL ) 426 426 { 427 irc_ usermsg( irc, "Unknown protocol" );427 irc_rootmsg( irc, "Unknown protocol" ); 428 428 return; 429 429 } … … 431 431 for( a = irc->b->accounts; a; a = a->next ) 432 432 if( a->prpl == prpl && prpl->handle_cmp( a->user, cmd[3] ) == 0 ) 433 irc_ usermsg( irc, "Warning: You already have an account with "433 irc_rootmsg( irc, "Warning: You already have an account with " 434 434 "protocol `%s' and username `%s'. Are you accidentally " 435 435 "trying to add it twice?", prpl->name, cmd[3] ); … … 438 438 if( cmd[5] ) 439 439 { 440 irc_ usermsg( irc, "Warning: Passing a servername/other flags to `account add' "440 irc_rootmsg( irc, "Warning: Passing a servername/other flags to `account add' " 441 441 "is now deprecated. Use `account set' instead." ); 442 442 set_setstr( &a->set, "server", cmd[5] ); 443 443 } 444 444 445 irc_usermsg( irc, "Account successfully added%s", cmd[4] ? "" : 445 irc_rootmsg( irc, "Account successfully added with tag %s%s", 446 a->tag, cmd[4] ? "" : 446 447 ", now use /OPER to enter the password" ); 447 448 … … 453 454 454 455 if( strchr( irc->umode, 'b' ) ) 455 irc_ usermsg( irc, "Account list:" );456 irc_rootmsg( irc, "Account list:" ); 456 457 457 458 for( a = irc->b->accounts; a; a = a->next ) … … 468 469 con = ""; 469 470 470 irc_ usermsg( irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con );471 irc_rootmsg( irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con ); 471 472 472 473 i ++; 473 474 } 474 irc_ usermsg( irc, "End of account list" );475 irc_rootmsg( irc, "End of account list" ); 475 476 476 477 return; … … 484 485 if ( irc->b->accounts ) 485 486 { 486 irc_ usermsg( irc, "Trying to get all accounts connected..." );487 irc_rootmsg( irc, "Trying to get all accounts connected..." ); 487 488 488 489 for( a = irc->b->accounts; a; a = a->next ) … … 490 491 { 491 492 if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 492 irc_ usermsg( irc, "Enter password for account %s(%s)"493 "first (use /OPER)", a-> prpl->name, a->user);493 irc_rootmsg( irc, "Enter password for account %s " 494 "first (use /OPER)", a->tag ); 494 495 else 495 496 account_on( irc->b, a ); … … 498 499 else 499 500 { 500 irc_ usermsg( irc, "No accounts known. Use `account add' to add one." );501 irc_rootmsg( irc, "No accounts known. Use `account add' to add one." ); 501 502 } 502 503 … … 505 506 else if( len >= 2 && g_strncasecmp( cmd[1], "off", len ) == 0 ) 506 507 { 507 irc_ usermsg( irc, "Deactivating all active (re)connections..." );508 irc_rootmsg( irc, "Deactivating all active (re)connections..." ); 508 509 509 510 for( a = irc->b->accounts; a; a = a->next ) … … 530 531 ( a = account_get( irc->b, cmd[1] ) ) == NULL ) 531 532 { 532 irc_ usermsg( irc, "Could not find account `%s'. Note that the syntax "533 irc_rootmsg( irc, "Could not find account `%s'. Note that the syntax " 533 534 "of the account command changed, see \x02help account\x02.", cmd[1] ); 534 535 … … 540 541 if( a->ic ) 541 542 { 542 irc_ usermsg( irc, "Account is still logged in, can't delete" );543 irc_rootmsg( irc, "Account is still logged in, can't delete" ); 543 544 } 544 545 else 545 546 { 546 547 account_del( irc->b, a ); 547 irc_ usermsg( irc, "Account deleted" );548 irc_rootmsg( irc, "Account deleted" ); 548 549 } 549 550 } … … 551 552 { 552 553 if( a->ic ) 553 irc_ usermsg( irc, "Account already online" );554 irc_rootmsg( irc, "Account already online" ); 554 555 else if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 555 irc_ usermsg( irc, "Enter password for account %s(%s)"556 "first (use /OPER)", a-> prpl->name, a->user);556 irc_rootmsg( irc, "Enter password for account %s " 557 "first (use /OPER)", a->tag ); 557 558 else 558 559 account_on( irc->b, a ); … … 567 568 { 568 569 cancel_auto_reconnect( a ); 569 irc_ usermsg( irc, "Reconnect cancelled" );570 } 571 else 572 { 573 irc_ usermsg( irc, "Account already offline" );570 irc_rootmsg( irc, "Reconnect cancelled" ); 571 } 572 else 573 { 574 irc_rootmsg( irc, "Account already offline" ); 574 575 } 575 576 } … … 580 581 else 581 582 { 582 irc_ usermsg( irc, "Unknown command: %s [...] %s. Please use \x02help commands\x02 to get a list of available commands.", "account", cmd[2] );583 irc_rootmsg( irc, "Unknown command: %s [...] %s. Please use \x02help commands\x02 to get a list of available commands.", "account", cmd[2] ); 583 584 } 584 585 } … … 597 598 598 599 if( strchr( irc->umode, 'b' ) ) 599 irc_ usermsg( irc, "Channel list:" );600 irc_rootmsg( irc, "Channel list:" ); 600 601 601 602 for( l = irc->channels; l; l = l->next ) … … 603 604 irc_channel_t *ic = l->data; 604 605 605 irc_ usermsg( irc, "%2d. %s, %s channel%s", i, ic->name,606 irc_rootmsg( irc, "%2d. %s, %s channel%s", i, ic->name, 606 607 set_getstr( &ic->set, "type" ), 607 608 ic->flags & IRC_CHANNEL_JOINED ? " (joined)" : "" ); … … 609 610 i ++; 610 611 } 611 irc_ usermsg( irc, "End of channel list" );612 irc_rootmsg( irc, "End of channel list" ); 612 613 613 614 return; … … 623 624 cmd_set_real( irc, cmd + 1, &ic->set, NULL ); 624 625 else 625 irc_ usermsg( irc, "Could not find channel `%s'", cmd[1] );626 irc_rootmsg( irc, "Could not find channel `%s'", cmd[1] ); 626 627 627 628 return; … … 640 641 ic != ic->irc->default_channel ) 641 642 { 642 irc_ usermsg( irc, "Channel %s deleted.", ic->name );643 irc_rootmsg( irc, "Channel %s deleted.", ic->name ); 643 644 irc_channel_free( ic ); 644 645 } 645 646 else 646 irc_ usermsg( irc, "Couldn't remove channel (main channel %s or "647 irc_rootmsg( irc, "Couldn't remove channel (main channel %s or " 647 648 "channels you're still in cannot be deleted).", 648 649 irc->default_channel->name ); … … 650 651 else 651 652 { 652 irc_ usermsg( irc, "Unknown command: %s [...] %s. Please use \x02help commands\x02 to get a list of available commands.", "channel", cmd[1] );653 irc_rootmsg( irc, "Unknown command: %s [...] %s. Please use \x02help commands\x02 to get a list of available commands.", "channel", cmd[1] ); 653 654 } 654 655 } … … 668 669 if( !( a = account_get( irc->b, cmd[1] ) ) ) 669 670 { 670 irc_ usermsg( irc, "Invalid account" );671 irc_rootmsg( irc, "Invalid account" ); 671 672 return; 672 673 } 673 674 else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) ) 674 675 { 675 irc_ usermsg( irc, "That account is not on-line" );676 irc_rootmsg( irc, "That account is not on-line" ); 676 677 return; 677 678 } … … 681 682 if( !nick_ok( cmd[3] ) ) 682 683 { 683 irc_ usermsg( irc, "The requested nick `%s' is invalid", cmd[3] );684 irc_rootmsg( irc, "The requested nick `%s' is invalid", cmd[3] ); 684 685 return; 685 686 } 686 687 else if( irc_user_by_name( irc, cmd[3] ) ) 687 688 { 688 irc_ usermsg( irc, "The requested nick `%s' already exists", cmd[3] );689 irc_rootmsg( irc, "The requested nick `%s' already exists", cmd[3] ); 689 690 return; 690 691 } … … 704 705 strcmp( s, "group" ) == 0 && 705 706 ( group = set_getstr( &ic->set, "group" ) ) ) 706 irc_ usermsg( irc, "Adding `%s' to contact list (group %s)",707 irc_rootmsg( irc, "Adding `%s' to contact list (group %s)", 707 708 cmd[2], group ); 708 709 else 709 irc_ usermsg( irc, "Adding `%s' to contact list", cmd[2] );710 irc_rootmsg( irc, "Adding `%s' to contact list", cmd[2] ); 710 711 711 712 a->prpl->add_buddy( a->ic, cmd[2], group ); … … 720 721 if( ( bu = bee_user_new( irc->b, a->ic, cmd[2], BEE_USER_LOCAL ) ) && 721 722 ( iu = bu->ui_data ) ) 722 irc_ usermsg( irc, "Temporarily assigned nickname `%s' "723 irc_rootmsg( irc, "Temporarily assigned nickname `%s' " 723 724 "to contact `%s'", iu->nick, cmd[2] ); 724 725 } … … 734 735 if( !( iu = irc_user_by_name( irc, cmd[1] ) ) || !( bu = iu->bu ) ) 735 736 { 736 irc_ usermsg( irc, "Buddy `%s' not found", cmd[1] );737 irc_rootmsg( irc, "Buddy `%s' not found", cmd[1] ); 737 738 return; 738 739 } … … 744 745 bee_user_free( irc->b, bu ); 745 746 746 irc_ usermsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] );747 irc_rootmsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] ); 747 748 g_free( s ); 748 749 … … 760 761 if( !iu || !iu->bu ) 761 762 { 762 irc_ usermsg( irc, "Nick `%s' does not exist", cmd[1] );763 irc_rootmsg( irc, "Nick `%s' does not exist", cmd[1] ); 763 764 return; 764 765 } … … 768 769 else if( !( a = account_get( irc->b, cmd[1] ) ) ) 769 770 { 770 irc_ usermsg( irc, "Invalid account" );771 irc_rootmsg( irc, "Invalid account" ); 771 772 return; 772 773 } 773 774 else if( !( ( ic = a->ic ) && ( a->ic->flags & OPT_LOGGED_IN ) ) ) 774 775 { 775 irc_ usermsg( irc, "That account is not on-line" );776 irc_rootmsg( irc, "That account is not on-line" ); 776 777 return; 777 778 } … … 779 780 if( !ic->acc->prpl->get_info ) 780 781 { 781 irc_ usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );782 irc_rootmsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); 782 783 } 783 784 else … … 796 797 if( iu == NULL ) 797 798 { 798 irc_ usermsg( irc, "Nick `%s' does not exist", cmd[1] );799 irc_rootmsg( irc, "Nick `%s' does not exist", cmd[1] ); 799 800 } 800 801 else if( del ) … … 802 803 if( iu->bu ) 803 804 bee_irc_user_nick_reset( iu ); 804 irc_ usermsg( irc, "Nickname reset to `%s'", iu->nick );805 irc_rootmsg( irc, "Nickname reset to `%s'", iu->nick ); 805 806 } 806 807 else if( iu == irc->user ) 807 808 { 808 irc_ usermsg( irc, "Use /nick to change your own nickname" );809 irc_rootmsg( irc, "Use /nick to change your own nickname" ); 809 810 } 810 811 else if( !nick_ok( cmd[2] ) ) 811 812 { 812 irc_ usermsg( irc, "Nick `%s' is invalid", cmd[2] );813 irc_rootmsg( irc, "Nick `%s' is invalid", cmd[2] ); 813 814 } 814 815 else if( ( old = irc_user_by_name( irc, cmd[2] ) ) && old != iu ) 815 816 { 816 irc_ usermsg( irc, "Nick `%s' already exists", cmd[2] );817 irc_rootmsg( irc, "Nick `%s' already exists", cmd[2] ); 817 818 } 818 819 else … … 820 821 if( !irc_user_set_nick( iu, cmd[2] ) ) 821 822 { 822 irc_ usermsg( irc, "Error while changing nick" );823 irc_rootmsg( irc, "Error while changing nick" ); 823 824 return; 824 825 } … … 836 837 } 837 838 838 irc_ usermsg( irc, "Nick successfully changed" );839 irc_rootmsg( irc, "Nick successfully changed" ); 839 840 } 840 841 } … … 869 870 format = "%-32.32s %-16.16s"; 870 871 871 irc_ usermsg( irc, format, "Handle", "Nickname" );872 irc_rootmsg( irc, format, "Handle", "Nickname" ); 872 873 for( l = a->ic->deny; l; l = l->next ) 873 874 { 874 875 bee_user_t *bu = bee_user_by_handle( irc->b, a->ic, l->data ); 875 876 irc_user_t *iu = bu ? bu->ui_data : NULL; 876 irc_ usermsg( irc, format, l->data, iu ? iu->nick : "(none)" );877 } 878 irc_ usermsg( irc, "End of list." );877 irc_rootmsg( irc, format, l->data, iu ? iu->nick : "(none)" ); 878 } 879 irc_rootmsg( irc, "End of list." ); 879 880 880 881 return; … … 885 886 if( !iu || !iu->bu ) 886 887 { 887 irc_ usermsg( irc, "Nick `%s' does not exist", cmd[1] );888 irc_rootmsg( irc, "Nick `%s' does not exist", cmd[1] ); 888 889 return; 889 890 } … … 893 894 else if( !( a = account_get( irc->b, cmd[1] ) ) ) 894 895 { 895 irc_ usermsg( irc, "Invalid account" );896 irc_rootmsg( irc, "Invalid account" ); 896 897 return; 897 898 } 898 899 else if( !( ( ic = a->ic ) && ( a->ic->flags & OPT_LOGGED_IN ) ) ) 899 900 { 900 irc_ usermsg( irc, "That account is not on-line" );901 irc_rootmsg( irc, "That account is not on-line" ); 901 902 return; 902 903 } … … 904 905 if( !ic->acc->prpl->add_deny || !ic->acc->prpl->rem_permit ) 905 906 { 906 irc_ usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );907 irc_rootmsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); 907 908 } 908 909 else … … 910 911 imc_rem_allow( ic, cmd[2] ); 911 912 imc_add_block( ic, cmd[2] ); 912 irc_ usermsg( irc, "Buddy `%s' moved from allow- to block-list", cmd[2] );913 irc_rootmsg( irc, "Buddy `%s' moved from allow- to block-list", cmd[2] ); 913 914 } 914 915 } … … 929 930 format = "%-32.32s %-16.16s"; 930 931 931 irc_ usermsg( irc, format, "Handle", "Nickname" );932 irc_rootmsg( irc, format, "Handle", "Nickname" ); 932 933 for( l = a->ic->permit; l; l = l->next ) 933 934 { 934 935 bee_user_t *bu = bee_user_by_handle( irc->b, a->ic, l->data ); 935 936 irc_user_t *iu = bu ? bu->ui_data : NULL; 936 irc_ usermsg( irc, format, l->data, iu ? iu->nick : "(none)" );937 } 938 irc_ usermsg( irc, "End of list." );937 irc_rootmsg( irc, format, l->data, iu ? iu->nick : "(none)" ); 938 } 939 irc_rootmsg( irc, "End of list." ); 939 940 940 941 return; … … 945 946 if( !iu || !iu->bu ) 946 947 { 947 irc_ usermsg( irc, "Nick `%s' does not exist", cmd[1] );948 irc_rootmsg( irc, "Nick `%s' does not exist", cmd[1] ); 948 949 return; 949 950 } … … 953 954 else if( !( a = account_get( irc->b, cmd[1] ) ) ) 954 955 { 955 irc_ usermsg( irc, "Invalid account" );956 irc_rootmsg( irc, "Invalid account" ); 956 957 return; 957 958 } 958 959 else if( !( ( ic = a->ic ) && ( a->ic->flags & OPT_LOGGED_IN ) ) ) 959 960 { 960 irc_ usermsg( irc, "That account is not on-line" );961 irc_rootmsg( irc, "That account is not on-line" ); 961 962 return; 962 963 } … … 964 965 if( !ic->acc->prpl->rem_deny || !ic->acc->prpl->add_permit ) 965 966 { 966 irc_ usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );967 irc_rootmsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); 967 968 } 968 969 else … … 971 972 imc_add_allow( ic, cmd[2] ); 972 973 973 irc_ usermsg( irc, "Buddy `%s' moved from block- to allow-list", cmd[2] );974 irc_rootmsg( irc, "Buddy `%s' moved from block- to allow-list", cmd[2] ); 974 975 } 975 976 } … … 998 999 if( ( ++times >= 3 ) ) 999 1000 { 1000 irc_ usermsg( irc, "%s", msg[rand()%(sizeof(msg)/sizeof(char*))] );1001 irc_rootmsg( irc, "%s", msg[rand()%(sizeof(msg)/sizeof(char*))] ); 1001 1002 last_irc = NULL; 1002 1003 times = 0; … … 1011 1012 } 1012 1013 1013 irc_ usermsg( irc, "Did I ask you something?" );1014 irc_rootmsg( irc, "Did I ask you something?" ); 1014 1015 return; 1015 1016 } … … 1021 1022 if( sscanf( cmd[1], "%d", &numq ) != 1 ) 1022 1023 { 1023 irc_ usermsg( irc, "Invalid query number" );1024 irc_rootmsg( irc, "Invalid query number" ); 1024 1025 return; 1025 1026 } … … 1031 1032 if( !q ) 1032 1033 { 1033 irc_ usermsg( irc, "Uhm, I never asked you something like that..." );1034 irc_rootmsg( irc, "Uhm, I never asked you something like that..." ); 1034 1035 return; 1035 1036 } … … 1071 1072 format = "%-16.16s %-40.40s %s"; 1072 1073 1073 irc_ usermsg( irc, format, "Nick", "Handle/Account", "Status" );1074 irc_rootmsg( irc, format, "Nick", "Handle/Account", "Status" ); 1074 1075 1075 1076 if( irc->root->last_channel && … … 1093 1094 g_snprintf( st, sizeof( st ) - 1, "Online (%s)", bu->status_msg ); 1094 1095 1095 g_snprintf( s, sizeof( s ) - 1, "%s %s (%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user);1096 irc_ usermsg( irc, format, iu->nick, s, st );1096 g_snprintf( s, sizeof( s ) - 1, "%s %s", bu->handle, bu->ic->acc->tag ); 1097 irc_rootmsg( irc, format, iu->nick, s, st ); 1097 1098 } 1098 1099 … … 1111 1112 if( away == 1 ) 1112 1113 { 1113 g_snprintf( s, sizeof( s ) - 1, "%s %s (%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user);1114 irc_ usermsg( irc, format, iu->nick, s, irc_user_get_away( iu ) );1114 g_snprintf( s, sizeof( s ) - 1, "%s %s", bu->handle, bu->ic->acc->tag ); 1115 irc_rootmsg( irc, format, iu->nick, s, irc_user_get_away( iu ) ); 1115 1116 } 1116 1117 n_away ++; … … 1128 1129 if( offline == 1 ) 1129 1130 { 1130 g_snprintf( s, sizeof( s ) - 1, "%s %s (%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user);1131 irc_ usermsg( irc, format, iu->nick, s, "Offline" );1131 g_snprintf( s, sizeof( s ) - 1, "%s %s", bu->handle, bu->ic->acc->tag ); 1132 irc_rootmsg( irc, format, iu->nick, s, "Offline" ); 1132 1133 } 1133 1134 n_offline ++; 1134 1135 } 1135 1136 1136 irc_ usermsg( irc, "%d buddies (%d available, %d away, %d offline)", n_online + n_away + n_offline, n_online, n_away, n_offline );1137 irc_rootmsg( irc, "%d buddies (%d available, %d away, %d offline)", n_online + n_away + n_offline, n_online, n_away, n_offline ); 1137 1138 } 1138 1139 … … 1144 1145 if( !q ) 1145 1146 { 1146 irc_ usermsg( irc, "There are no pending questions." );1147 return; 1148 } 1149 1150 irc_ usermsg( irc, "Pending queries:" );1147 irc_rootmsg( irc, "There are no pending questions." ); 1148 return; 1149 } 1150 1151 irc_rootmsg( irc, "Pending queries:" ); 1151 1152 1152 1153 for( num = 0; q; q = q->next, num ++ ) 1153 1154 if( q->ic ) /* Not necessary yet, but it might come later */ 1154 irc_ usermsg( irc, "%d, %s(%s): %s", num, q->ic->acc->prpl->name, q->ic->acc->user, q->question );1155 else 1156 irc_ usermsg( irc, "%d, BitlBee: %s", num, q->question );1155 irc_rootmsg( irc, "%d, %s: %s", num, q->ic->acc->tag, q->question ); 1156 else 1157 irc_rootmsg( irc, "%d, BitlBee: %s", num, q->question ); 1157 1158 } 1158 1159 … … 1170 1171 if( !( acc = account_get( irc->b, cmd[2] ) ) ) 1171 1172 { 1172 irc_ usermsg( irc, "Invalid account" );1173 irc_rootmsg( irc, "Invalid account" ); 1173 1174 return; 1174 1175 } 1175 1176 else if( !acc->prpl->chat_join ) 1176 1177 { 1177 irc_ usermsg( irc, "Named chatrooms not supported on that account." );1178 irc_rootmsg( irc, "Named chatrooms not supported on that account." ); 1178 1179 return; 1179 1180 } … … 1205 1206 set_setstr( &ic->set, "room", cmd[3] ) ) 1206 1207 { 1207 irc_ usermsg( irc, "Chatroom successfully added." );1208 irc_rootmsg( irc, "Chatroom successfully added." ); 1208 1209 } 1209 1210 else … … 1212 1213 irc_channel_free( ic ); 1213 1214 1214 irc_ usermsg( irc, "Could not add chatroom." );1215 irc_rootmsg( irc, "Could not add chatroom." ); 1215 1216 } 1216 1217 g_free( channel ); … … 1227 1228 if( !iu->bu->ic->acc->prpl->chat_with( iu->bu->ic, iu->bu->handle ) ) 1228 1229 { 1229 irc_ usermsg( irc, "(Possible) failure while trying to open "1230 irc_rootmsg( irc, "(Possible) failure while trying to open " 1230 1231 "a groupchat with %s.", iu->nick ); 1231 1232 } … … 1233 1234 else 1234 1235 { 1235 irc_ usermsg( irc, "Can't open a groupchat with %s.", cmd[2] );1236 irc_rootmsg( irc, "Can't open a groupchat with %s.", cmd[2] ); 1236 1237 } 1237 1238 } … … 1240 1241 g_strcasecmp( cmd[1], "del" ) == 0 ) 1241 1242 { 1242 irc_ usermsg( irc, "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command." );1243 irc_rootmsg( irc, "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command." ); 1243 1244 cmd_channel( irc, cmd ); 1244 1245 } 1245 1246 else 1246 1247 { 1247 irc_ usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] );1248 irc_rootmsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); 1248 1249 } 1249 1250 } … … 1260 1261 1261 1262 if( strchr( irc->umode, 'b' ) ) 1262 irc_ usermsg( irc, "Group list:" );1263 irc_rootmsg( irc, "Group list:" ); 1263 1264 1264 1265 for( l = irc->b->groups; l; l = l->next ) 1265 1266 { 1266 1267 bee_group_t *bg = l->data; 1267 irc_ usermsg( irc, "%d. %s", n ++, bg->name );1268 } 1269 irc_ usermsg( irc, "End of group list" );1270 } 1271 else 1272 { 1273 irc_ usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "group", cmd[1] );1268 irc_rootmsg( irc, "%d. %s", n ++, bg->name ); 1269 } 1270 irc_rootmsg( irc, "End of group list" ); 1271 } 1272 else 1273 { 1274 irc_rootmsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "group", cmd[1] ); 1274 1275 } 1275 1276 } … … 1284 1285 if( !files ) 1285 1286 { 1286 irc_ usermsg( irc, "No pending transfers" );1287 irc_rootmsg( irc, "No pending transfers" ); 1287 1288 return; 1288 1289 } … … 1305 1306 case LIST: 1306 1307 if ( file->status == FT_STATUS_LISTENING ) 1307 irc_ usermsg( irc,1308 irc_rootmsg( irc, 1308 1309 "Pending file(id %d): %s (Listening...)", file->local_id, file->file_name); 1309 1310 else … … 1314 1315 kb_per_s = file->bytes_transferred / 1024 / diff; 1315 1316 1316 irc_ usermsg( irc,1317 irc_rootmsg( irc, 1317 1318 "Pending file(id %d): %s (%10zd/%zd kb, %d kb/s)", file->local_id, file->file_name, 1318 1319 file->bytes_transferred/1024, file->file_size/1024, kb_per_s); … … 1322 1323 if( file->status == FT_STATUS_LISTENING ) 1323 1324 { 1324 irc_ usermsg( irc, "Rejecting file transfer for %s", file->file_name );1325 irc_rootmsg( irc, "Rejecting file transfer for %s", file->file_name ); 1325 1326 imcb_file_canceled( file->ic, file, "Denied by user" ); 1326 1327 } … … 1329 1330 if( file->local_id == fid ) 1330 1331 { 1331 irc_ usermsg( irc, "Canceling file transfer for %s", file->file_name );1332 irc_rootmsg( irc, "Canceling file transfer for %s", file->file_name ); 1332 1333 imcb_file_canceled( file->ic, file, "Canceled by user" ); 1333 1334 } … … 1339 1340 static void cmd_nick( irc_t *irc, char **cmd ) 1340 1341 { 1341 irc_ usermsg( irc, "This command is deprecated. Try: account %s set display_name", cmd[1] );1342 irc_rootmsg( irc, "This command is deprecated. Try: account %s set display_name", cmd[1] ); 1342 1343 } 1343 1344 … … 1354 1355 1355 1356 if( msg ) 1356 irc_ usermsg( irc, "%s: This seems to be your first time using this "1357 irc_rootmsg( irc, "%s: This seems to be your first time using this " 1357 1358 "this version of BitlBee. Here's a list of new " 1358 1359 "features you may like to know about:\n\n%s\n",
Note: See TracChangeset
for help on using the changeset viewer.