From 4d8e3b847d4ecd532643d5cb0925a2d701c84b23 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 30 May 2014 20:56:40 -0400 Subject: Fix f627a3bacd0d058e94260dac1555790cafd9a926, really make BotInfo::Part fire events like the normal user part message does --- src/bots.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bots.cpp b/src/bots.cpp index 16e6a1cf9..85e605f21 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -213,11 +213,16 @@ void BotInfo::Part(Channel *c, const Anope::string &reason) if (c->FindUser(this) == NULL) return; + FOREACH_MOD(OnPrePartChannel, (this, c)); + IRCD->SendPart(this, c, "%s", !reason.empty() ? reason.c_str() : ""); + Anope::string cname = c->name; + Reference cref = c; + c->DeleteUser(this); - FOREACH_MOD(OnPartChannel, (this, c, c->name, reason)); + FOREACH_MOD(OnPartChannel, (this, cref, cname, reason)); } void BotInfo::OnMessage(User *u, const Anope::string &message) -- cgit