Changeset 2272cb3
- Timestamp:
- 2010-04-20T23:11:32Z (15 years ago)
- Branches:
- master
- Children:
- a4cdf43
- Parents:
- 9d4352c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r9d4352c r2272cb3 717 717 return strcmp( irc->channel, new_name ) == 0 ? new_name : SET_INVALID; 718 718 } 719 #endif 719 720 720 721 static void cmd_block( irc_t *irc, char **cmd ) … … 723 724 account_t *a; 724 725 725 if( !cmd[2] && ( a = account_get( irc , cmd[1] ) ) && a->ic )726 if( !cmd[2] && ( a = account_get( irc->b, cmd[1] ) ) && a->ic ) 726 727 { 727 728 char *format; … … 736 737 for( l = a->ic->deny; l; l = l->next ) 737 738 { 738 user_t *u = user_findhandle( a->ic, l->data ); 739 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 739 bee_user_t *bu = bee_user_by_handle( irc->b, a->ic, l->data ); 740 irc_user_t *iu = bu ? bu->ui_data : NULL; 741 irc_usermsg( irc, format, l->data, iu ? iu->nick : "(none)" ); 740 742 } 741 743 irc_usermsg( irc, "End of list." ); … … 745 747 else if( !cmd[2] ) 746 748 { 747 user_t *u = user_find( irc, cmd[1] );748 if( ! u || !u->ic)749 irc_user_t *iu = irc_user_by_name( irc, cmd[1] ); 750 if( !iu || !iu->bu ) 749 751 { 750 752 irc_usermsg( irc, "Nick `%s' does not exist", cmd[1] ); 751 753 return; 752 754 } 753 ic = u->ic;754 cmd[2] = u->handle;755 } 756 else if( !( a = account_get( irc , cmd[1] ) ) )755 ic = iu->bu->ic; 756 cmd[2] = iu->bu->handle; 757 } 758 else if( !( a = account_get( irc->b, cmd[1] ) ) ) 757 759 { 758 760 irc_usermsg( irc, "Invalid account" ); … … 782 784 account_t *a; 783 785 784 if( !cmd[2] && ( a = account_get( irc , cmd[1] ) ) && a->ic )786 if( !cmd[2] && ( a = account_get( irc->b, cmd[1] ) ) && a->ic ) 785 787 { 786 788 char *format; … … 795 797 for( l = a->ic->permit; l; l = l->next ) 796 798 { 797 user_t *u = user_findhandle( a->ic, l->data ); 798 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 799 bee_user_t *bu = bee_user_by_handle( irc->b, a->ic, l->data ); 800 irc_user_t *iu = bu ? bu->ui_data : NULL; 801 irc_usermsg( irc, format, l->data, iu ? iu->nick : "(none)" ); 799 802 } 800 803 irc_usermsg( irc, "End of list." ); … … 804 807 else if( !cmd[2] ) 805 808 { 806 user_t *u = user_find( irc, cmd[1] );807 if( ! u || !u->ic)809 irc_user_t *iu = irc_user_by_name( irc, cmd[1] ); 810 if( !iu || !iu->bu ) 808 811 { 809 812 irc_usermsg( irc, "Nick `%s' does not exist", cmd[1] ); 810 813 return; 811 814 } 812 ic = u->ic;813 cmd[2] = u->handle;814 } 815 else if( !( a = account_get( irc , cmd[1] ) ) )815 ic = iu->bu->ic; 816 cmd[2] = iu->bu->handle; 817 } 818 else if( !( a = account_get( irc->b, cmd[1] ) ) ) 816 819 { 817 820 irc_usermsg( irc, "Invalid account" ); … … 836 839 } 837 840 } 838 #endif839 841 840 842 static void cmd_yesno( irc_t *irc, char **cmd ) … … 1164 1166 { "account", 1, cmd_account, 0 }, 1165 1167 { "add", 2, cmd_add, 0 }, 1168 { "allow", 1, cmd_allow, 0 }, 1166 1169 { "blist", 0, cmd_blist, 0 }, 1170 { "block", 1, cmd_block, 0 }, 1167 1171 { "drop", 1, cmd_drop, 0 }, 1168 1172 { "ft", 0, cmd_transfer, 0 }, … … 1180 1184 { "yes", 0, cmd_yesno, 0 }, 1181 1185 #if 0 1182 { "allow", 1, cmd_allow, 0 },1183 { "block", 1, cmd_block, 0 },1184 1186 { "chat", 1, cmd_chat, 0 }, 1185 1187 #endif
Note: See TracChangeset
for help on using the changeset viewer.