summaryrefslogtreecommitdiff
path: root/src/modules/m_chanlog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_chanlog.cpp')
-rw-r--r--src/modules/m_chanlog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index a5fcbe5bf..480d169d6 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -26,18 +26,24 @@ class ChannelLogStream : public LogStream
virtual void OnLog(int loglevel, const std::string &type, const std::string &msg)
{
Channel *c = ServerInstance->FindChan(channel);
+ static bool Logging = false;
printf("I got called\n");
if (loglevel < this->loglvl)
return;
+ if (Logging)
+ return;
+
if (c)
{
+ Logging = true; // this avoids (rare chance) loops with logging server IO on networks
char buf[MAXBUF];
snprintf(buf, MAXBUF, "\2%s\2: %s", type.c_str(), msg.c_str());
c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name, buf);
ServerInstance->PI->SendChannelPrivmsg(c, 0, buf);
+ Logging = false;
}
}
};