Example #1
0
void rehash()
{
  call_hook(HOOK_PRE_REHASH);
  noshare = 1;
  clear_userlist(userlist);
  noshare = 0;
  userlist = NULL;
  chanprog();
}
Example #2
0
static void rehash()
{
  call_hook(HOOK_PRE_REHASH);

  noshare = 1;
  clear_userlist(userlist);
  noshare = 0;

  userlist = NULL;

  readconfig();
  /* FIXME: We should really call post rehash here as well, instead of in readconfig(). */
}
Example #3
0
/* Reload the user file from disk
 */
void reload()
{
  if (!file_readable(userfile)) {
    putlog(LOG_MISC, "*", MISC_CANTRELOADUSER);
    return;
  }

  noshare = 1;
  clear_userlist(userlist);
  noshare = 0;
  userlist = NULL;
  if (!readuserfile(userfile, &userlist))
    fatal(MISC_MISSINGUSERF, 0);
  reaffirm_owners();
  check_tcl_event("userfile-loaded");
  call_hook(HOOK_READ_USERFILE);
}
Example #4
0
/* Reload the user file from disk
 */
void reload()
{
  FILE *f = fopen(userfile, "r");

  if (f == NULL) {
    putlog(LOG_MISC, "*", "Can't reload user file!");
    return;
  }
  fclose(f);
  noshare = 1;
  clear_userlist(userlist);
  noshare = 0;
  userlist = NULL;
  loading = 1;
  checkchans(0);
  if (!readuserfile(userfile, &userlist))
    fatal("User file is missing!", 0);

  /* ensure we did not lose our internal users */
  load_internal_users();
  /* make sure I am added and conf.bot->u is set */
  add_myself_to_userlist();

  if (conf.bot->localhub)
    add_child_bots();
  else if (!conf.bot->hub)
    add_localhub();

  /* Make sure no removed users/bots are still connected. */
  check_stale_dcc_users();

  for (tand_t* bot = tandbot; bot; bot = bot->next)
    bot->u = get_user_by_handle(userlist, bot->bot);

  /* I don't think these will ever be called anyway. */
  if (!conf.bot->hub) {
    Auth::FillUsers();
    check_hostmask();
  }

  checkchans(1);
  loading = 0;
  var_parse_my_botset();
  reaffirm_owners();
  hook_read_userfile();
}