summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/bahamut.c19
-rw-r--r--src/protocol/inspircd11.c58
-rw-r--r--src/protocol/inspircd12.cpp60
-rw-r--r--src/protocol/ratbox.c25
-rw-r--r--src/protocol/unreal32.c60
5 files changed, 89 insertions, 133 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index d3c92df86..4462ee4eb 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -129,9 +129,7 @@ void bahamut_cmd_capab()
call on this function */
void bahamut_cmd_chghost(const char *nick, const char *vhost)
{
- if (debug) {
- alog("debug: This IRCD does not support vhosting");
- }
+ Alog(LOG_DEBUG) << "This IRCD does not support vhosting";
}
@@ -408,8 +406,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
User *u = finduser(source);
if (!u)
{
- if (debug)
- alog("debug: SJOIN for nonexistant user %s on %s", source, c->name.c_str());
+ Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << source << " on " << c->name;
}
else
{
@@ -449,7 +446,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
- alog("Recieved unknown mode prefix %c in SJOIN string", buf[0]);
+ Alog() << "Recieved unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -459,8 +456,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
- if (debug)
- alog("debug: SJOIN for nonexistant user %s on %s", buf.c_str(), c->name.c_str());
+ Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -743,11 +739,8 @@ int anope_event_ping(const char *source, int ac, const char **av)
int anope_event_error(const char *source, int ac, const char **av)
{
- if (ac >= 1) {
- if (debug) {
- alog("debug: %s", av[0]);
- }
- }
+ if (ac >= 1)
+ Alog(LOG_DEBUG) << av[0];
return MOD_CONT;
}
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index 85612f010..ffd34cb8f 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -446,8 +446,7 @@ int anope_event_fmode(const char *source, int ac, const char **av)
if (n != 1) {
newav[o] = av[n];
o++;
- if (debug)
- alog("Param: %s", newav[o - 1]);
+ Alog(LOG_DEBUG) << "Param: " << newav[o - 1];
}
n++;
}
@@ -519,7 +518,7 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
if (cm)
{
- alog("Recieved unknown mode prefix %c in FJOIN string", buf[0]);
+ Alog() << "Recieved unknown mode prefix " << buf[0] << " in FJOIN string";
continue;
}
@@ -529,8 +528,7 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
- if (debug)
- alog("debug: FJOIN for nonexistant user %s on %s", buf.c_str(), c->name.c_str());
+ Alog(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -612,11 +610,9 @@ int anope_event_topic(const char *source, int ac, const char **av)
Channel *c = findchan(av[0]);
time_t topic_time = time(NULL);
- if (!c) {
- if (debug) {
- alog("debug: TOPIC %s for nonexistent channel %s",
- merge_args(ac - 1, av + 1), av[0]);
- }
+ if (!c)
+ {
+ Alog(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -720,10 +716,9 @@ int anope_event_setname(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETNAME for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -739,10 +734,9 @@ int anope_event_chgname(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: FNAME for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "FNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -758,10 +752,9 @@ int anope_event_setident(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETIDENT for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -777,10 +770,9 @@ int anope_event_chgident(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(av[0]);
- if (!u) {
- if (debug) {
- alog("debug: CHGIDENT for nonexistent user %s", av[0]);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -796,10 +788,9 @@ int anope_event_sethost(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETHOST for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -850,10 +841,9 @@ int anope_event_chghost(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: FHOST for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "FHOST for nonexistent user " << source;
return MOD_CONT;
}
diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp
index f7f57971e..9762d115f 100644
--- a/src/protocol/inspircd12.cpp
+++ b/src/protocol/inspircd12.cpp
@@ -496,8 +496,7 @@ int anope_event_fmode(const char *source, int ac, const char **av)
if (n != 1) {
newav[o] = av[n];
o++;
- if (debug)
- alog("Param: %s", newav[o - 1]);
+ Alog(LOG_DEBUG) << "Param: " << newav[o - 1];
}
n++;
}
@@ -582,7 +581,7 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
buf.erase(buf.begin());
if (!cm)
{
- alog("Recieved unknown mode prefix %c in FJOIN string", buf[0]);
+ Alog() << "Recieved unknown mode prefix " << buf[0] << " in FJOIN string";
continue;
}
@@ -593,8 +592,7 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
User *u = find_byuid(buf);
if (!u)
{
- if (debug)
- alog("debug: FJOIN for nonexistant user %s on %s", buf.c_str(), c->name.c_str());
+ Alog(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -685,11 +683,9 @@ int anope_event_topic(const char *source, int ac, const char **av)
time_t topic_time = time(NULL);
User *u = find_byuid(source);
- if (!c) {
- if (debug) {
- alog("debug: TOPIC %s for nonexistent channel %s",
- merge_args(ac - 1, av + 1), av[0]);
- }
+ if (!c)
+ {
+ Alog(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -769,10 +765,9 @@ int anope_event_setname(const char *source, int ac, const char **av)
User *u;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETNAME for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -785,10 +780,9 @@ int anope_event_chgname(const char *source, int ac, const char **av)
User *u;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: FNAME for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "FNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -801,10 +795,9 @@ int anope_event_setident(const char *source, int ac, const char **av)
User *u;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETIDENT for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -817,10 +810,9 @@ int anope_event_chgident(const char *source, int ac, const char **av)
User *u;
u = finduser(av[0]);
- if (!u) {
- if (debug) {
- alog("debug: CHGIDENT for nonexistent user %s", av[0]);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -833,10 +825,9 @@ int anope_event_sethost(const char *source, int ac, const char **av)
User *u;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETHOST for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -913,10 +904,9 @@ int anope_event_chghost(const char *source, int ac, const char **av)
User *u;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: FHOST for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "FHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -1173,7 +1163,7 @@ int anope_event_endburst(const char *source, int ac, const char **av)
u->RemoveMode(findbot(Config.s_NickServ), UMODE_REGISTERED);
}
- alog("Processed ENDBURST for %s", s->name);
+ Alog() << "Processed ENDBURST for " << s->name;
finish_sync(s, 1);
return MOD_CONT;
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index 46431c38c..1fc7122e2 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -410,7 +410,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
- alog("Recieved unknown mode prefix %c in SJOIN string", buf[0]);
+ Alog() << "Recieved unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -420,8 +420,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
User *u = find_byuid(buf);
if (!u)
{
- if (debug)
- alog("debug: SJOIN for nonexistant user %s on %s", buf.c_str(), c->name.c_str());
+ Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -534,10 +533,7 @@ int anope_event_topic(const char *source, int ac, const char **av)
time_t topic_time = time(NULL);
if (!c) {
- if (debug) {
- alog("debug: TOPIC %s for nonexistent channel %s",
- merge_args(ac - 1, av + 1), av[0]);
- }
+ Alog(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -582,11 +578,9 @@ int anope_event_tburst(const char *source, int ac, const char **av)
c = findchan(av[0]);
topic_time = strtol(av[1], NULL, 10);
- if (!c) {
- if (debug) {
- alog("debug: TOPIC %s for nonexistent channel %s",
- merge_args(ac - 1, av + 1), av[0]);
- }
+ if (!c)
+ {
+ Alog(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
if (setter)
delete [] setter;
return MOD_CONT;
@@ -876,11 +870,8 @@ int anope_event_bmask(const char *source, int ac, const char **av)
int anope_event_error(const char *source, int ac, const char **av)
{
- if (ac >= 1) {
- if (debug) {
- alog("debug: %s", av[0]);
- }
- }
+ if (ac >= 1)
+ Alog(LOG_DEBUG) << av[0];
return MOD_CONT;
}
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index e2b66b2ea..ee906b1b8 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -662,10 +662,9 @@ int anope_event_setname(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETNAME for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -681,10 +680,9 @@ int anope_event_chgname(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(av[0]);
- if (!u) {
- if (debug) {
- alog("debug: CHGNAME for nonexistent user %s", av[0]);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "CHGNAME for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -700,10 +698,9 @@ int anope_event_setident(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETIDENT for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -718,10 +715,9 @@ int anope_event_chgident(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(av[0]);
- if (!u) {
- if (debug) {
- alog("debug: CHGIDENT for nonexistent user %s", av[0]);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -737,10 +733,9 @@ int anope_event_sethost(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(source);
- if (!u) {
- if (debug) {
- alog("debug: SETHOST for nonexistent user %s", source);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -856,10 +851,9 @@ int anope_event_chghost(const char *source, int ac, const char **av)
return MOD_CONT;
u = finduser(av[0]);
- if (!u) {
- if (debug) {
- alog("debug: CHGHOST for nonexistent user %s", av[0]);
- }
+ if (!u)
+ {
+ Alog(LOG_DEBUG) << "debug: CHGHOST for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -917,15 +911,14 @@ int anope_event_whois(const char *source, int ac, const char **av)
int anope_event_error(const char *source, int ac, const char **av)
{
- if (av[0]) {
- if (debug) {
- alog("debug: %s", av[0]);
- }
- if(strstr(av[0],"No matching link configuration")!=0) {
- alog("Error: Your IRCD's link block may not setup correctly, please check unrealircd.conf");
- }
+ if (av[0])
+ {
+ Alog(LOG_DEBUG) << av[0];
+ if(strstr(av[0],"No matching link configuration")!=0)
+ Alog() << "Error: Your IRCD's link block may not setup correctly, please check unrealircd.conf";
}
return MOD_CONT;
+
}
int anope_event_sdesc(const char *source, int ac, const char **av)
@@ -1063,7 +1056,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
- alog("Recieved unknown mode prefix %c in SJOIN string", buf[0]);
+ Alog() << "Recieved unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -1073,8 +1066,7 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
- if (debug)
- alog("debug: SJOIN for nonexistant user %s on %s", buf.c_str(), c->name.c_str());
+ Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}