X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/c0b25bda9a29a60510da1ff9102134f29fab8418..a45e6ec72a6e2d09a5a777978fa653ff7c97db60:/src/nickserv.c?ds=sidebyside diff --git a/src/nickserv.c b/src/nickserv.c index fe50e2c..619e61e 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -565,23 +565,30 @@ free_handle_info(void *vhi) static void set_user_handle_info(struct userNode *user, struct handle_info *hi, int stamp); static void -nickserv_unregister_handle(struct handle_info *hi, struct userNode *notify) +nickserv_unregister_handle(struct handle_info *hi, struct userNode *notify, struct userNode *bot) { unsigned int n; + struct userNode *uNode; for (n=0; nusers) + while (hi->users) { + if (nickserv_conf.sync_log) { + uNode = GetUserH(hi->users->nick); + if (uNode) + irc_delete(uNode); + } set_user_handle_info(hi->users, NULL, 0); + } if (notify) { if (nickserv_conf.disable_nicks) - send_message(notify, nickserv, "NSMSG_UNREGISTER_SUCCESS", hi->handle); + send_message(notify, bot, "NSMSG_UNREGISTER_SUCCESS", hi->handle); else - send_message(notify, nickserv, "NSMSG_UNREGISTER_NICKS_SUCCESS", hi->handle); + send_message(notify, bot, "NSMSG_UNREGISTER_NICKS_SUCCESS", hi->handle); } if (nickserv_conf.sync_log) - SyncLog("UNREGISTER %s", hi->handle); + SyncLog("UNREGISTER %s", hi->handle); dict_remove(nickserv_handle_dict, hi->handle); } @@ -906,6 +913,17 @@ apply_fakehost(struct handle_info *handle) assign_fakehost(target, fake, 1); } +void send_func_list(struct userNode *user) +{ + unsigned int n; + struct handle_info *old_info; + + old_info = user->handle_info; + + for (n=0; nnick)) { for (n=0; nloc = 1; if (hi) { struct nick_info *ni; @@ -1330,7 +1349,7 @@ static NICKSERV_FUNC(cmd_register) if (nickserv_conf.sync_log) { cryptpass(password, syncpass); /* - * An 0 is only sent if theres no email address. Thios should only happen if email functions are + * An 0 is only sent if theres no email address. Thios should only happen if email functions are * disabled which they wont be for us. Email Required MUST be set on if you are using this. * -SiRVulcaN */ @@ -1601,6 +1620,7 @@ static NICKSERV_FUNC(cmd_nickinfo) static NICKSERV_FUNC(cmd_rename_handle) { struct handle_info *hi; + struct userNode *uNode; char msgbuf[MAXLEN], *old_handle; unsigned int nn; @@ -1627,6 +1647,15 @@ static NICKSERV_FUNC(cmd_rename_handle) for (nn=0; nnhandle_info->handle, old_handle, hi->handle); + + + if (nickserv_conf.sync_log) { + for (uNode = hi->users; uNode; uNode = uNode->next_authed) + irc_rename(uNode, hi->handle); + + SyncLog("RENAME %s %s", hi->handle); + } + reply("NSMSG_HANDLE_CHANGED", old_handle, hi->handle); global_message(MESSAGE_RECIPIENT_STAFF, msgbuf); free(old_handle); @@ -2857,7 +2886,7 @@ static NICKSERV_FUNC(cmd_unregister) passwd = argv[1]; argv[1] = "****"; if (checkpass(passwd, hi->passwd)) { - nickserv_unregister_handle(hi, user); + nickserv_unregister_handle(hi, user, cmd->parent->bot); return 1; } else { log_module(NS_LOG, LOG_INFO, "Account '%s' tried to unregister with the wrong password.", hi->handle); @@ -2873,7 +2902,7 @@ static NICKSERV_FUNC(cmd_ounregister) NICKSERV_MIN_PARMS(2); if (!(hi = get_victim_oper(user, argv[1]))) return 0; - nickserv_unregister_handle(hi, user); + nickserv_unregister_handle(hi, user, cmd->parent->bot); return 1; } @@ -3152,7 +3181,7 @@ static NICKSERV_FUNC(cmd_merge) global_message(MESSAGE_RECIPIENT_STAFF, buffer); /* Unregister the "from" handle. */ - nickserv_unregister_handle(hi_from, NULL); + nickserv_unregister_handle(hi_from, NULL, cmd->parent->bot); return 1; } @@ -3375,7 +3404,7 @@ static void search_unregister_func (struct userNode *source, struct handle_info *match) { if (oper_has_access(source, nickserv, match->opserv_level, 0)) - nickserv_unregister_handle(match, source); + nickserv_unregister_handle(match, source, nickserv); // XXX nickserv hard coded } static int @@ -3670,7 +3699,7 @@ expire_handles(UNUSED_ARG(void *data)) expiry = hi->channels ? nickserv_conf.handle_expire_delay : nickserv_conf.nochan_handle_expire_delay; if ((now - hi->lastseen) > expiry) { log_module(NS_LOG, LOG_INFO, "Expiring account %s for inactivity.", hi->handle); - nickserv_unregister_handle(hi, NULL); + nickserv_unregister_handle(hi, NULL, NULL); } }