Changeset c05eb5b
- Timestamp:
- 2008-09-29T21:53:05Z (16 years ago)
- Branches:
- master
- Children:
- de49316
- Parents:
- fb98634
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
rfb98634 rc05eb5b 260 260 261 261 typedef set_t** (*cmd_set_findhead)( irc_t*, char* ); 262 263 static int cmd_set_real( irc_t *irc, char **cmd, cmd_set_findhead findhead ) 262 typedef int (*cmd_set_checkflags)( irc_t*, set_t *set ); 263 264 static int cmd_set_real( irc_t *irc, char **cmd, cmd_set_findhead findhead, cmd_set_checkflags checkflags ) 264 265 { 265 266 char *set_full = NULL, *set_name = NULL, *tmp; … … 308 309 int st; 309 310 310 /* 311 FIXME: Make these work again. Probably a gross hack. 312 313 if( a->ic && s && s->flags & ACC_SET_OFFLINE_ONLY ) 314 { 315 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "off" ); 311 if( checkflags && checkflags( irc, s ) == 0 ) 316 312 return 0; 317 }318 else if( !a->ic && s && s->flags & ACC_SET_ONLINE_ONLY )319 {320 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "on" );321 return 0;322 }323 */324 313 325 314 if( g_strncasecmp( cmd[1], "-del", 4 ) == 0 ) … … 365 354 else 366 355 return NULL; 356 } 357 358 static int cmd_account_set_checkflags( irc_t *irc, set_t *s ) 359 { 360 account_t *a = s->data; 361 362 if( a->ic && s && s->flags & ACC_SET_OFFLINE_ONLY ) 363 { 364 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "off" ); 365 return 0; 366 } 367 else if( !a->ic && s && s->flags & ACC_SET_ONLINE_ONLY ) 368 { 369 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "on" ); 370 return 0; 371 } 372 373 return 1; 367 374 } 368 375 … … 535 542 MIN_ARGS( 2 ); 536 543 537 cmd_set_real( irc, cmd + 1, cmd_account_set_findhead );544 cmd_set_real( irc, cmd + 1, cmd_account_set_findhead, cmd_account_set_checkflags ); 538 545 } 539 546 else … … 869 876 static void cmd_set( irc_t *irc, char **cmd ) 870 877 { 871 cmd_set_real( irc, cmd, NULL );878 cmd_set_real( irc, cmd, NULL, NULL ); 872 879 } 873 880 … … 1066 1073 else if( g_strcasecmp( cmd[1], "set" ) == 0 ) 1067 1074 { 1068 cmd_set_real( irc, cmd + 1, cmd_chat_set_findhead );1075 cmd_set_real( irc, cmd + 1, cmd_chat_set_findhead, NULL ); 1069 1076 } 1070 1077 else if( g_strcasecmp( cmd[1], "del" ) == 0 )
Note: See TracChangeset
for help on using the changeset viewer.