1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 23:06:39 +02:00

Fix bug #1080, changing core pseudo-client nicks in the config should register the change when the bots are brought back online, patch from Adam.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2310 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2009-06-03 20:29:33 +00:00
parent affc29aca5
commit 426f72117b
3 changed files with 56 additions and 0 deletions
+7
View File
@@ -1178,6 +1178,13 @@ typedef struct ircd_modes_ {
#define DEF_LANGUAGE LANG_EN_US
#define BI_PRIVATE 0x0001
#define BI_CHANSERV 0x0002
#define BI_BOTSERV 0x0004
#define BI_HOSTSERV 0x0008
#define BI_OPERSERV 0x0010
#define BI_MEMOSERV 0x0020
#define BI_NICKSERV 0x0040
#define BI_GLOBAL 0x0080
#define CUS_OP 0x0001
#define CUS_VOICE 0x0002
+30
View File
@@ -20,6 +20,21 @@ BotInfo::BotInfo(const char *nnick)
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
nbots++;
this->cmdTable = NULL;
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
this->flags |= BI_CHANSERV;
else if (s_BotServ && !stricmp(s_BotServ, nnick))
this->flags |= BI_BOTSERV;
else if (s_HostServ && !stricmp(s_BotServ, nnick))
this->flags |= BI_HOSTSERV;
else if (s_OperServ && !stricmp(s_OperServ, nnick))
this->flags |= BI_OPERSERV;
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
this->flags |= BI_MEMOSERV;
else if (s_NickServ && !stricmp(s_NickServ, nnick))
this->flags |= BI_NICKSERV;
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
this->flags |= BI_GLOBAL;
}
BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const char *nreal)
@@ -33,6 +48,21 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
nbots++;
this->cmdTable = NULL;
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
this->flags |= BI_CHANSERV;
else if (s_BotServ && !stricmp(s_BotServ, nnick))
this->flags |= BI_BOTSERV;
else if (s_HostServ && !stricmp(s_BotServ, nnick))
this->flags |= BI_HOSTSERV;
else if (s_OperServ && !stricmp(s_OperServ, nnick))
this->flags |= BI_OPERSERV;
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
this->flags |= BI_MEMOSERV;
else if (s_NickServ && !stricmp(s_NickServ, nnick))
this->flags |= BI_NICKSERV;
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
this->flags |= BI_GLOBAL;
}
BotInfo::~BotInfo()
+19
View File
@@ -493,6 +493,25 @@ void load_bs_dbase()
bi->created = tmp32;
SAFE(read_int16(&tmp16, f));
bi->chancount = tmp16;
/* Fixes bug #1080, services bot names may have been
* changed in the config and different from database
* names
*/
if (s_ChanServ && bi->flags & BI_CHANSERV && strcmp(bi->nick, s_ChanServ))
bi->ChangeNick(s_ChanServ);
else if (s_BotServ && bi->flags & BI_BOTSERV && strcmp(bi->nick, s_BotServ))
bi->ChangeNick(s_BotServ);
else if (s_HostServ && bi->flags & BI_HOSTSERV && strcmp(bi->nick, s_HostServ))
bi->ChangeNick(s_HostServ);
else if (s_OperServ && bi->flags & BI_OPERSERV && strcmp(bi->nick, s_OperServ))
bi->ChangeNick(s_OperServ);
else if (s_MemoServ && bi->flags & BI_MEMOSERV && strcmp(bi->nick, s_MemoServ))
bi->ChangeNick(s_MemoServ);
else if (s_NickServ && bi->flags & BI_NICKSERV && strcmp(bi->nick, s_NickServ))
bi->ChangeNick(s_NickServ);
else if (s_GlobalNoticer && bi->flags & BI_GLOBAL && strcmp(bi->nick, s_GlobalNoticer))
bi->ChangeNick(s_GlobalNoticer);
}
close_db(f);