[srvx-commits] CVS: services/src modcmd.c,1.61,1.62
Brought to you by:
entrope
From: Entrope <en...@us...> - 2003-08-04 02:05:33
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src Modified Files: modcmd.c Log Message: pass right set of options to svccmd_can_invoke() Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** modcmd.c 23 Jul 2003 02:58:08 -0000 1.61 --- modcmd.c 4 Aug 2003 02:05:30 -0000 1.62 *************** *** 708,712 **** channel = NULL; } ! perms = svccmd_can_invoke(user, service->bot, cmd, channel, (server_qualified ? SVCCMD_QUALIFIED : 0) | SVCCMD_DEBIT | SVCCMD_NOISY); if (!perms) return 0; if (argc < cmd->command->min_argc) { --- 708,712 ---- channel = NULL; } ! perms = svccmd_can_invoke(user, service->bot, cmd, channel, options); if (!perms) return 0; if (argc < cmd->command->min_argc) { *************** *** 1389,1393 **** if (argc < 2) { tbl.length = dict_size(modules) + 1; ! tbl.width = 4; tbl.flags = TABLE_PAD_LEFT; tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0])); --- 1389,1393 ---- if (argc < 2) { tbl.length = dict_size(modules) + 1; ! tbl.width = 3; tbl.flags = TABLE_PAD_LEFT; tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0])); *************** *** 1395,1400 **** tbl.contents[0][0] = "Module"; tbl.contents[0][1] = "Commands"; ! tbl.contents[0][2] = "Logfile"; ! tbl.contents[0][3] = "Helpfile"; for (ii=1, it=dict_first(modules); it; it=iter_next(it), ii++) { mod = iter_data(it); --- 1395,1399 ---- tbl.contents[0][0] = "Module"; tbl.contents[0][1] = "Commands"; ! tbl.contents[0][2] = "Helpfile"; for (ii=1, it=dict_first(modules); it; it=iter_next(it), ii++) { mod = iter_data(it); *************** *** 1402,1407 **** tbl.contents[ii][0] = mod->name; tbl.contents[ii][1] = strtab(dict_size(mod->commands)); ! tbl.contents[ii][2] = "(unknown)"; /* TODO: find logfile name */ ! tbl.contents[ii][3] = mod->helpfile_name ? mod->helpfile_name : "(none)"; } } else { --- 1401,1405 ---- tbl.contents[ii][0] = mod->name; tbl.contents[ii][1] = strtab(dict_size(mod->commands)); ! tbl.contents[ii][2] = mod->helpfile_name ? mod->helpfile_name : "(none)"; } } else { *************** *** 1841,1844 **** --- 1839,1854 ---- struct service *service; + db2 = database_get_data(db, "bots", RECDB_OBJECT); + for (it = dict_first(db2); it; it = iter_next(it)) { + if (service_find(iter_key(it))) { + continue; + } + rd = iter_data(it); + if (rd->type != RECDB_OBJECT) { + log_module(MAIN_LOG, LOG_ERROR, "Bad type for 'bots/%s' in modcmd db (expected object).", iter_key(it)); + continue; + } + /* TODO: create userNode and service for this bot */ + } db2 = database_get_data(db, "services", RECDB_OBJECT); if (!db2) { |