comparison mcabber/mcabber/commands.c @ 1749:7ee390513463

Use api version for module checks * Change module structures * Check for supported api versions at loading time * Add info command, description and module version fields
author Myhailo Danylenko <isbear@ukrpost.net>
date Sat, 13 Mar 2010 10:29:18 +0100
parents 5ef7629a96ff
children 106bbf7e97da
comparison
equal deleted inserted replaced
1748:51a23403cc80 1749:7ee390513463
492 scr_append_multiline(""); 492 scr_append_multiline("");
493 return 0; 493 return 0;
494 } 494 }
495 if (current_buddy) { 495 if (current_buddy) {
496 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) 496 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP)
497 do_group("toggle"); 497 do_group("toggle");
498 else { 498 else {
499 // Enter chat mode 499 // Enter chat mode
500 scr_set_chatmode(TRUE); 500 scr_set_chatmode(TRUE);
501 scr_ShowBuddyWindow(); 501 scr_ShowBuddyWindow();
502 } 502 }
2965 2965
2966 args = split_arg(arg, 2, 0); 2966 args = split_arg(arg, 2, 0);
2967 if (!args[0] || !strcmp(args[0], "list")) { 2967 if (!args[0] || !strcmp(args[0], "list")) {
2968 module_list_print(); 2968 module_list_print();
2969 } else { 2969 } else {
2970 const gchar *error; 2970 const gchar *error = NULL;
2971 const gchar *name = args[1]; 2971 const gchar *name = args[1];
2972 2972
2973 if (name && name[0] == '-' && name[1] == 'f') { 2973 if (name && name[0] == '-' && name[1] == 'f') {
2974 force = TRUE; 2974 force = TRUE;
2975 name +=2; 2975 name +=2;
2979 2979
2980 if (!strcmp(args[0], "load")) 2980 if (!strcmp(args[0], "load"))
2981 error = module_load(name, TRUE, force); 2981 error = module_load(name, TRUE, force);
2982 else if (!strcmp(args[0], "unload")) 2982 else if (!strcmp(args[0], "unload"))
2983 error = module_unload(name, TRUE, force); 2983 error = module_unload(name, TRUE, force);
2984 else if (!strcmp(args[0], "info"))
2985 module_info_print(name);
2984 else 2986 else
2985 error = "Unknown subcommand"; 2987 error = "Unknown subcommand";
2986 if (error) 2988 if (error)
2987 scr_LogPrint(LPRINT_LOGNORM, "Error: %s.", error); 2989 scr_LogPrint(LPRINT_LOGNORM, "Error: %s.", error);
2988 } 2990 }