diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:13 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:13 +0000 |
commit | 0aad26dd768e9a9aa38f0981b268f09d78f4bb61 (patch) | |
tree | 73fc4906a21ee0901507c8131d9ddcedd72bdf19 /src/bots.cpp | |
parent | 82dcf8a39876553f6b7f5e0b4119e409b3f566aa (diff) |
Store UID for services pseudoclients inside BotInfo. This will be used instead of struct Uid in the future. Remove seperate introduction of Service, make a BotInfo for all of them. XXX: no idea at all if this will work.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1270 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 2cd4a10fd..f58858d48 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -15,10 +15,26 @@ BotInfo::BotInfo(const char *nnick) { this->nick = sstrdup(nnick); this->lastmsg = time(NULL); + this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet? + new_uid(nnick, (char *)this->uid.c_str()); // XXX: this is required because we still pass nick prefix to protocol modules, DO AWAY WITH IT. insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. nbots++; } +BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const char *nreal) +{ + this->nick = sstrdup(nnick); + this->user = sstrdup(nuser); + this->host = sstrdup(nhost); + this->real = sstrdup(nreal); + this->lastmsg = time(NULL); + this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet? + new_uid(nnick, (char *)this->uid.c_str()); // XXX: this is required because we still pass nick prefix to protocol modules, DO AWAY WITH IT. + insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. + nbots++; +} + + void BotInfo::ChangeNick(const char *newnick) { if (this->next) |