Changeset 1f92a58 for root_commands.c
- Timestamp:
- 2010-04-10T02:27:50Z (15 years ago)
- Branches:
- master
- Children:
- 17a6ee9
- Parents:
- 57c96f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r57c96f7 r1f92a58 136 136 } 137 137 138 #if 0139 138 static void cmd_account( irc_t *irc, char **cmd ); 140 139 … … 162 161 irc->status |= USTATUS_IDENTIFIED; 163 162 irc_umode_set( irc, "+R", 1 ); 164 if( set_getbool( &irc-> set, "auto_connect" ) )163 if( set_getbool( &irc->b->set, "auto_connect" ) ) 165 164 cmd_account( irc, account_on ); 166 165 break; … … 202 201 storage_status_t status; 203 202 204 status = storage_remove (irc-> nick, cmd[1]);203 status = storage_remove (irc->user->nick, cmd[1]); 205 204 switch (status) { 206 205 case STORAGE_NO_SUCH_USER: … … 214 213 irc->status &= ~USTATUS_IDENTIFIED; 215 214 irc_umode_set( irc, "-R", 1 ); 216 irc_usermsg( irc, "Account `%s' removed", irc-> nick );215 irc_usermsg( irc, "Account `%s' removed", irc->user->nick ); 217 216 break; 218 217 default: … … 221 220 } 222 221 } 223 #endif 222 223 static void cmd_save( irc_t *irc, char **cmd ) 224 { 225 if( ( irc->status & USTATUS_IDENTIFIED ) == 0 ) 226 irc_usermsg( irc, "Please create an account first" ); 227 else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK ) 228 irc_usermsg( irc, "Configuration saved" ); 229 else 230 irc_usermsg( irc, "Configuration could not be saved!" ); 231 } 224 232 225 233 struct cmd_account_del_data … … 909 917 } 910 918 911 static void cmd_save( irc_t *irc, char **cmd )912 {913 if( ( irc->status & USTATUS_IDENTIFIED ) == 0 )914 irc_usermsg( irc, "Please create an account first" );915 else if( storage_save( irc, NULL, TRUE ) == STORAGE_OK )916 irc_usermsg( irc, "Configuration saved" );917 else918 irc_usermsg( irc, "Configuration could not be saved!" );919 }920 921 919 static void cmd_blist( irc_t *irc, char **cmd ) 922 920 { … … 984 982 } 985 983 986 static void cmd_nick( irc_t *irc, char **cmd )987 {988 account_t *a;989 990 if( !cmd[1] || !( a = account_get( irc, cmd[1] ) ) )991 {992 irc_usermsg( irc, "Invalid account");993 }994 else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) )995 {996 irc_usermsg( irc, "That account is not on-line" );997 }998 else if ( !cmd[2] )999 {1000 irc_usermsg( irc, "Your name is `%s'" , a->ic->displayname ? a->ic->displayname : "NULL" );1001 }1002 else if ( !a->prpl->set_my_name )1003 {1004 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );1005 }1006 else1007 {1008 irc_usermsg( irc, "Setting your name to `%s'", cmd[2] );1009 1010 a->prpl->set_my_name( a->ic, cmd[2] );1011 }1012 }1013 1014 984 static void cmd_qlist( irc_t *irc, char **cmd ) 1015 985 { … … 1030 1000 else 1031 1001 irc_usermsg( irc, "%d, BitlBee: %s", num, q->question ); 1032 }1033 1034 static void cmd_join_chat( irc_t *irc, char **cmd )1035 {1036 irc_usermsg( irc, "This command is now obsolete. "1037 "Please try the `chat' command instead." );1038 1002 } 1039 1003 … … 1216 1180 { "help", 0, cmd_help, 0 }, 1217 1181 { "account", 1, cmd_account, 0 }, 1218 #if 01219 1182 { "identify", 1, cmd_identify, 0 }, 1220 1183 { "register", 1, cmd_register, 0 }, 1221 1184 { "drop", 1, cmd_drop, 0 }, 1185 { "save", 0, cmd_save, 0 }, 1186 #if 0 1222 1187 { "add", 2, cmd_add, 0 }, 1223 1188 { "info", 1, cmd_info, 0 }, … … 1228 1193 { "block", 1, cmd_block, 0 }, 1229 1194 { "allow", 1, cmd_allow, 0 }, 1230 { "save", 0, cmd_save, 0 },1231 1195 { "set", 0, cmd_set, 0 }, 1232 1196 { "yes", 0, cmd_yesno, 0 },
Note: See TracChangeset
for help on using the changeset viewer.