1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 17:43:13 +02:00

I don't think this OnBotKick to hold channels is necessary anymore as Sync should cover everything now, and this causes weird things when the last user in a channel kicks themselves out using the bot. Also handle users rejoining a channel while its held better.

This commit is contained in:
Adam
2013-12-31 15:35:15 -05:00
parent 6124af68cc
commit 6e6543d3ed
2 changed files with 13 additions and 19 deletions
+6 -19
View File
@@ -68,12 +68,17 @@ class ChanServCore : public Module, public ChanServService
inhabit.Unset(c);
/* In the event we don't part */
c->RemoveMode(NULL, "SECRET");
c->RemoveMode(NULL, "INVITE");
if (!c->ci || !c->ci->bi)
{
if (ChanServ)
ChanServ->Part(c);
}
else
/* If someone has rejoined this channel in the meantime, don't part the bot */
else if (c->users.size() <= 1)
c->ci->bi->Part(c);
}
};
@@ -308,24 +313,6 @@ class ChanServCore : public Module, public ChanServService
{
this->Hold(c);
}
c->CheckModes();
}
EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason)
{
/* If the channel isn't syncing and doesn't have any users, join ChanServ
* Note that the user AND POSSIBLY the botserv bot exist here
* ChanServ always enforces channels like this to keep people from deleting bots etc
* that are holding channels.
*/
if (c->ci && c->users.size() == (c->ci->bi && c->FindUser(c->ci->bi) ? 2 : 1) && !inhabit.HasExt(c) && !c->syncing)
{
/* Join ChanServ and set a timer for this channel to part ChanServ later */
this->Hold(c);
}
return EVENT_CONTINUE;
}
void OnLog(Log *l) anope_override
+7
View File
@@ -150,7 +150,14 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
/* the channel is synced when the netmerge is complete */
Server *src = source.GetServer() ? source.GetServer() : Me;
if (src && src->IsSynced())
{
c->Sync();
if (c->CheckDelete())
delete c;
else
c->CheckModes();
}
}
}