1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 14:03:12 +02:00

Fixed attaching to events in db_mysql & possibly having ChannelInfo::WhoSends return NULL if there really are *no* bots

This commit is contained in:
Adam
2011-08-18 00:47:34 -04:00
parent 487d828fa0
commit ff7479f437
5 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ class DBMySQL : public Module
/* HostServ */
I_OnSetVhost, I_OnDeleteVhost
};
ModuleManager::Attach(i, this, 40);
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
EventReturn OnLoadDatabase()
+2 -2
View File
@@ -79,9 +79,9 @@ class BahamutIRCdProto : public IRCDProto
void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
if (Capab.HasFlag(CAPAB_TSMODE))
send_cmd(source->nick, "MODE %s %ld %s", dest->name.c_str(), static_cast<long>(dest->creation_time), buf.c_str());
send_cmd(source ? source->nick : Config->ServerName, "MODE %s %ld %s", dest->name.c_str(), static_cast<long>(dest->creation_time), buf.c_str());
else
send_cmd(source->nick, "MODE %s %s", dest->name.c_str(), buf.c_str());
send_cmd(source ? source->nick : Config->ServerName, "MODE %s %s", dest->name.c_str(), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
+1 -1
View File
@@ -127,7 +127,7 @@ class InspIRCdProto : public IRCDProto
void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(source ? source->nick : Config->OperServ, "FMODE %s %u %s", dest->name.c_str(), static_cast<unsigned>(dest->creation_time), buf.c_str());
send_cmd(source ? source->nick : Config->ServerName, "FMODE %s %u %s", dest->name.c_str(), static_cast<unsigned>(dest->creation_time), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
+1 -4
View File
@@ -184,10 +184,7 @@ class PlexusProto : public IRCDProto
void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
{
if (bi)
send_cmd(bi->GetUID(), "MODE %s %s", dest->name.c_str(), buf.c_str());
else
send_cmd(Config->Numeric, "MODE %s %s", dest->name.c_str(), buf.c_str());
send_cmd(bi ? bi->GetUID() : Config->Numeric, "MODE %s %s", dest->name.c_str(), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
+4 -2
View File
@@ -132,7 +132,7 @@ class UnrealIRCdProto : public IRCDProto
void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(source->nick, "G %s %s", dest->name.c_str(), buf.c_str());
send_cmd(source ? source->nick : Config->ServerName, "G %s %s", dest->name.c_str(), buf.c_str());
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
@@ -341,7 +341,9 @@ class UnrealIRCdProto : public IRCDProto
* so we will join and part us now
*/
BotInfo *bi = c->ci->WhoSends();
if (c->FindUser(bi) == NULL)
if (bi == NULL)
;
else if (c->FindUser(bi) == NULL)
{
bi->Join(c);
bi->Part(c);