1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 04:26:38 +02:00

Move some stuff to BotInfo methods.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1232 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:11 +00:00
parent 76cc8d0462
commit c4d520b465
6 changed files with 43 additions and 25 deletions
+29
View File
@@ -45,3 +45,32 @@ void BotInfo::RejoinAll()
if (ci->bi == this && ci->c && (ci->c->usercount >= BSMinUsers))
bot_join(ci);
}
void BotInfo::Assign(User *u, ChannelInfo *ci)
{
if (ci->bi)
{
if (u)
ci->bi->UnAssign(u, ci);
else
ci->bi->UnAssign(NULL, ci);
}
ci->bi = this;
this->chancount++;
if (ci->c && ci->c->usercount >= BSMinUsers)
bot_join(ci);
}
void BotInfo::UnAssign(User *u, ChannelInfo *ci)
{
send_event(EVENT_BOT_UNASSIGN, 2, ci->name, ci->bi->nick);
if (u && ci->c && ci->c->usercount >= BSMinUsers)
anope_cmd_part(ci->bi->nick, ci->name, "UNASSIGN from %s", u->nick);
ci->bi->chancount--;
ci->bi = NULL;
}