diff options
| author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:11 +0000 |
|---|---|---|
| committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:11 +0000 |
| commit | 914e0359e0225f84698990117b45f8218a788983 (patch) | |
| tree | f907f0d74ea7e74f7966c97f5b2e8a1716cd991e /src/core | |
| parent | 56084dce3308e25b5e48d6b7a3fd7eeb45f694e8 (diff) | |
Move stuff to a bots class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1224 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/bs_bot.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index f35e55152..17f237be6 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -18,7 +18,6 @@ int do_bot(User * u); int delbot(BotInfo * bi); void myBotServHelp(User * u); -void change_bot_nick(BotInfo * bi, char *newnick); /** * Create the command, and tell anope about it. @@ -150,7 +149,7 @@ int do_bot(User * u) return MOD_CONT; } - bi = makebot(nick); + bi = new BotInfo(nick); if (!bi) { notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); return MOD_CONT; @@ -277,7 +276,7 @@ int do_bot(User * u) } if (strcmp(nick, bi->nick)) - change_bot_nick(bi, nick); + bi->ChangeNick(nick); if (user && strcmp(user, bi->user)) { free(bi->user); @@ -303,7 +302,7 @@ int do_bot(User * u) anope_cmd_bot_nick(bi->nick, bi->user, bi->host, bi->real, ircd->botserv_bot_mode); - bot_rejoin_all(bi); + bi->RejoinAll(); } notice_lang(s_BotServ, u, BOT_BOT_CHANGED, oldnick, bi->nick, @@ -361,18 +360,3 @@ int delbot(BotInfo * bi) return 1; } -void change_bot_nick(BotInfo * bi, char *newnick) -{ - if (bi->next) - bi->next->prev = bi->prev; - if (bi->prev) - bi->prev->next = bi->next; - else - botlists[tolower(*bi->nick)] = bi->next; - - if (bi->nick) - free(bi->nick); - bi->nick = sstrdup(newnick); - - insert_bot(bi); -} |
