summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-08 18:59:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-08 18:59:13 +0000
commitfea1a27cb96a114f698eedcf90401b78406108fb (patch)
tree194649decb5d88184149307571bba6873537853d /src/modules
parenta7543c881be4c900b68a54714de7c1e677acbb09 (diff)
WHEEEEE!!!!!
All of: Write(), WriteTo(), WriteFrom(), WriteServ() are now methods of userrec. Write_NoFormat(), WriteTo_NoFormat(), WriteFrom_NoFormat(), WriteServ_NoFormat() are now std::string-taking overloaded methods of the functions above All modules updated to use new syntax, my fingers hurt :( git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4798 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp2
-rw-r--r--src/modules/extra/m_sqloper.cpp6
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp2
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp2
-rw-r--r--src/modules/m_alias.cpp4
-rw-r--r--src/modules/m_antibear.cpp4
-rw-r--r--src/modules/m_blockamsg.cpp2
-rw-r--r--src/modules/m_blockcaps.cpp2
-rw-r--r--src/modules/m_blockcolor.cpp2
-rw-r--r--src/modules/m_botmode.cpp2
-rw-r--r--src/modules/m_cban.cpp10
-rw-r--r--src/modules/m_chanfilter.cpp10
-rw-r--r--src/modules/m_chanprotect.cpp30
-rw-r--r--src/modules/m_check.cpp40
-rw-r--r--src/modules/m_chghost.cpp4
-rw-r--r--src/modules/m_chgident.cpp4
-rw-r--r--src/modules/m_conn_waitpong.cpp4
-rw-r--r--src/modules/m_denychans.cpp2
-rw-r--r--src/modules/m_filter.cpp2
-rw-r--r--src/modules/m_globalload.cpp8
-rw-r--r--src/modules/m_helpop.cpp8
-rw-r--r--src/modules/m_hostchange.cpp2
-rw-r--r--src/modules/m_ident.cpp8
-rw-r--r--src/modules/m_joinflood.cpp6
-rw-r--r--src/modules/m_kicknorejoin.cpp2
-rw-r--r--src/modules/m_knock.cpp8
-rw-r--r--src/modules/m_messageflood.cpp4
-rw-r--r--src/modules/m_nicklock.cpp6
-rw-r--r--src/modules/m_noctcp.cpp2
-rw-r--r--src/modules/m_noinvite.cpp2
-rw-r--r--src/modules/m_nokicks.cpp2
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_nonotice.cpp2
-rw-r--r--src/modules/m_operchans.cpp2
-rw-r--r--src/modules/m_operlevels.cpp4
-rw-r--r--src/modules/m_opermd5.cpp2
-rw-r--r--src/modules/m_opermotd.cpp8
-rw-r--r--src/modules/m_opersha256.cpp2
-rw-r--r--src/modules/m_park.cpp24
-rw-r--r--src/modules/m_randquote.cpp4
-rw-r--r--src/modules/m_redirect.cpp8
-rw-r--r--src/modules/m_remove.cpp10
-rw-r--r--src/modules/m_restrictchans.cpp2
-rw-r--r--src/modules/m_restrictmsg.cpp2
-rw-r--r--src/modules/m_safelist.cpp8
-rw-r--r--src/modules/m_sajoin.cpp4
-rw-r--r--src/modules/m_sanick.cpp2
-rw-r--r--src/modules/m_sapart.cpp2
-rw-r--r--src/modules/m_saquit.cpp2
-rw-r--r--src/modules/m_securelist.cpp6
-rw-r--r--src/modules/m_services.cpp12
-rw-r--r--src/modules/m_services_account.cpp8
-rw-r--r--src/modules/m_sethost.cpp4
-rw-r--r--src/modules/m_setident.cpp2
-rw-r--r--src/modules/m_setidle.cpp4
-rw-r--r--src/modules/m_showwhois.cpp2
-rw-r--r--src/modules/m_silence.cpp10
-rw-r--r--src/modules/m_spanningtree.cpp60
-rw-r--r--src/modules/m_spy.cpp16
-rw-r--r--src/modules/m_ssl_dummy.cpp2
-rw-r--r--src/modules/m_sslmodes.cpp4
-rw-r--r--src/modules/m_swhois.cpp2
-rw-r--r--src/modules/m_timedbans.cpp10
-rw-r--r--src/modules/m_tline.cpp4
-rw-r--r--src/modules/m_uninvite.cpp14
-rw-r--r--src/modules/m_userip.cpp2
-rw-r--r--src/modules/m_vhost.cpp4
-rw-r--r--src/modules/m_watch.cpp28
68 files changed, 238 insertions, 238 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index a658a60b6..26d231b14 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -135,7 +135,7 @@ class ModuleFilterPCRE : public Module
Srv->SendOpers(std::string("Filter: ")+std::string(user->nick)+
std::string(" had their notice filtered, target was ")+
target+": "+reason);
- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+
+ user->WriteServ("NOTICE "+std::string(user->nick)+
" :Your notice has been filtered and opers notified: "+reason);
}
Srv->Log(DEFAULT,std::string("Filter: ")+std::string(user->nick)+
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index bb6718313..3e91959b8 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -179,7 +179,7 @@ public:
* "insufficient awesomeness" (invalid credentials) error
*/
- WriteServ(user->fd, "491 %s :Invalid oper credentials", user->nick);
+ user->WriteServ( "491 %s :Invalid oper credentials", user->nick);
WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s!", user->nick, user->ident, user->host);
log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host);
}
@@ -192,7 +192,7 @@ public:
*/
log(DEBUG, "Query failed: %s", res->error.Str());
- WriteServ(user->fd, "491 %s :Invalid oper credentials", user->nick);
+ user->WriteServ( "491 %s :Invalid oper credentials", user->nick);
WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s! (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str());
log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host);
}
@@ -236,7 +236,7 @@ public:
strlcpy(user->oper, type.c_str(), NICKMAX-1);
WriteOpers("*** %s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str());
- WriteServ(user->fd,"381 %s :You are now an IRC operator of type %s", user->nick, type.c_str());
+ user->WriteServ("381 %s :You are now an IRC operator of type %s", user->nick, type.c_str());
if (!user->modes[UM_OPERATOR])
user->Oper();
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index ce9099d53..216c69c25 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -463,7 +463,7 @@ class ModuleSSLGnuTLS : public Module
// Bugfix, only send this numeric for *our* SSL users
if(dest->GetExt("ssl", dummy) || (IS_LOCAL(dest) && isin(dest->GetPort(), listenports)))
{
- WriteServ(source->fd, "320 %s %s :is using a secure connection", source->nick, dest->nick);
+ source->WriteServ("320 %s %s :is using a secure connection", source->nick, dest->nick);
}
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index c9b9d42aa..29b97ba9a 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -535,7 +535,7 @@ class ModuleSSLOpenSSL : public Module
// Bugfix, only send this numeric for *our* SSL users
if(dest->GetExt("ssl", dummy) || (IS_LOCAL(dest) && isin(dest->GetPort(), listenports)))
{
- WriteServ(source->fd, "320 %s %s :is using a secure connection", source->nick, dest->nick);
+ source->WriteServ("320 %s %s :is using a secure connection", source->nick, dest->nick);
}
}
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 93df8e031..6ee50ea07 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -108,7 +108,7 @@ class ModuleAlias : public Module
u = Srv->FindNick(Aliases[i].requires);
if (!u)
{
- Srv->SendServ(user->fd,"401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is currently unavailable. Please try again later.");
+ user->WriteServ("401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is currently unavailable. Please try again later.");
return 1;
}
}
@@ -117,7 +117,7 @@ class ModuleAlias : public Module
if (!Srv->IsUlined(u->server))
{
Srv->SendOpers("*** NOTICE -- Service "+Aliases[i].requires+" required by alias "+std::string(Aliases[i].text.c_str())+" is not on a u-lined server, possibly underhanded antics detected!");
- Srv->SendServ(user->fd,"401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is an imposter! Please inform an IRC operator as soon as possible.");
+ user->WriteServ("401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is an imposter! Please inform an IRC operator as soon as possible.");
return 1;
}
}
diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp
index 5d5b818f7..d43db5292 100644
--- a/src/modules/m_antibear.cpp
+++ b/src/modules/m_antibear.cpp
@@ -50,8 +50,8 @@ class ModuleAntiBear : public Module
virtual void OnUserRegister(userrec* user)
{
- WriteServ(user->fd,"439 %s :This server has anti-spambot mechanisms enabled.", user->nick);
- WriteServ(user->fd,"931 %s :Malicious bots, spammers, and other automated systems of dubious origin are NOT welcome here.", user->nick);
+ user->WriteServ("439 %s :This server has anti-spambot mechanisms enabled.", user->nick);
+ user->WriteServ("931 %s :Malicious bots, spammers, and other automated systems of dubious origin are NOT welcome here.", user->nick);
}
};
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index b46da5527..2d946fedb 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -143,7 +143,7 @@ public:
if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS)
userrec::QuitUser(user, "Global message (/amsg or /ame) detected");
else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
- WriteServ(user->fd, "NOTICE %s :Global message (/amsg or /ame) detected", user->nick);
+ user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick);
return 1;
}
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index a15cc67c5..93daeef61 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -90,7 +90,7 @@ public:
}
}
- WriteServ(user->fd, "404 %s %s :Can't send all-CAPS to channel (+P set)", user->nick, c->name);
+ user->WriteServ( "404 %s %s :Can't send all-CAPS to channel (+P set)", user->nick, c->name);
return 1;
}
}
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index 4f3e04106..6c987611c 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -95,7 +95,7 @@ class ModuleBlockColour : public Module
case 21:
case 22:
case 31:
- WriteServ(user->fd,"404 %s %s :Can't send colours to channel (+c set)",user->nick, c->name);
+ user->WriteServ("404 %s %s :Can't send colours to channel (+c set)",user->nick, c->name);
return 1;
break;
}
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp
index 57ab1e91c..1d3d22575 100644
--- a/src/modules/m_botmode.cpp
+++ b/src/modules/m_botmode.cpp
@@ -89,7 +89,7 @@ class ModuleBotMode : public Module
{
if (dst->IsModeSet('B'))
{
- Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
+ src->WriteServ("335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
}
}
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 7d834db66..3313b47f5 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -84,7 +84,7 @@ class cmd_cban : public command_t
if (parameters[0] == iter->chname)
{
unsigned long remaining = (iter->set_on + iter->length) - TIME;
- WriteServ(user->fd, "386 %s %s :Removed CBAN with %lu seconds left before expiry (%s)", user->nick, iter->chname.c_str(), remaining, iter->reason.c_str());
+ user->WriteServ( "386 %s %s :Removed CBAN with %lu seconds left before expiry (%s)", user->nick, iter->chname.c_str(), remaining, iter->reason.c_str());
cbans.erase(iter);
break;
}
@@ -107,18 +107,18 @@ class cmd_cban : public command_t
if(length > 0)
{
- WriteServ(user->fd, "385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
+ user->WriteServ( "385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str());
}
else
{
- WriteServ(user->fd, "385 %s %s :Added permenant channel ban (%s)", user->nick, parameters[0], reason.c_str());
+ user->WriteServ( "385 %s %s :Added permenant channel ban (%s)", user->nick, parameters[0], reason.c_str());
WriteOpers("*** %s added permenant channel ban on %s (%s)", user->nick, parameters[0], reason.c_str());
}
}
else
{
- WriteServ(user->fd, "403 %s %s :Invalid channel name", user->nick, parameters[0]);
+ user->WriteServ( "403 %s %s :Invalid channel name", user->nick, parameters[0]);
}
}
}
@@ -168,7 +168,7 @@ class ModuleCBan : public Module
if(iter->chname == cname && !user->modes[UM_OPERATOR])
{
// Channel is banned.
- WriteServ(user->fd, "384 %s %s :Cannot join channel, CBANed (%s)", user->nick, cname, iter->reason.c_str());
+ user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick, cname, iter->reason.c_str());
WriteOpers("*** %s tried to join %s which is CBANed (%s)", user->nick, cname, iter->reason.c_str());
return 1;
}
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index eae5ba843..31a30de0e 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -37,7 +37,7 @@ class ChanFilter : public ListModeBase
{
if (word.length() > 35)
{
- WriteServ(user->fd, "935 %s %s %s :word is too long for censor list",user->nick, chan->name,word.c_str());
+ user->WriteServ( "935 %s %s %s :word is too long for censor list",user->nick, chan->name,word.c_str());
return false;
}
@@ -46,18 +46,18 @@ class ChanFilter : public ListModeBase
virtual bool TellListTooLong(userrec* user, chanrec* chan, std::string &word)
{
- WriteServ(user->fd,"939 %s %s %s :Channel spamfilter list is full",user->nick, chan->name, word.c_str());
+ user->WriteServ("939 %s %s %s :Channel spamfilter list is full",user->nick, chan->name, word.c_str());
return true;
}
virtual void TellAlreadyOnList(userrec* user, chanrec* chan, std::string &word)
{
- WriteServ(user->fd,"937 %s %s :The word %s is already on the spamfilter list",user->nick, chan->name,word.c_str());
+ user->WriteServ("937 %s %s :The word %s is already on the spamfilter list",user->nick, chan->name,word.c_str());
}
virtual void TellNotSet(userrec* user, chanrec* chan, std::string &word)
{
- WriteServ(user->fd,"938 %s %s :No such spamfilter word is set",user->nick, chan->name);
+ user->WriteServ("938 %s %s :No such spamfilter word is set",user->nick, chan->name);
}
};
@@ -110,7 +110,7 @@ class ModuleChanFilter : public Module
{
if (line.find(i->mask.c_str()) != std::string::npos)
{
- WriteServ(user->fd,"936 %s %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name, i->mask.c_str());
+ user->WriteServ("936 %s %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name, i->mask.c_str());
return 1;
}
}
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index a4bbeee14..85e8d4a78 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -117,7 +117,7 @@ class ChanFounder : public ModeHandler
else
{
// whoops, someones being naughty!
- WriteServ(source->fd,"468 %s %s :Only servers may set channel mode +q",source->nick, channel->name);
+ source->WriteServ("468 %s %s :Only servers may set channel mode +q",source->nick, channel->name);
parameter = "";
return MODEACTION_DENY;
}
@@ -131,10 +131,10 @@ class ChanFounder : public ModeHandler
{
if (cl[i]->GetExt(founder, dummyptr))
{
- WriteServ(user->fd,"386 %s %s %s",user->nick, channel->name,cl[i]->nick);
+ user->WriteServ("386 %s %s %s",user->nick, channel->name,cl[i]->nick);
}
}
- WriteServ(user->fd,"387 %s %s :End of channel founder list",user->nick, channel->name);
+ user->WriteServ("387 %s %s :End of channel founder list",user->nick, channel->name);
}
};
@@ -220,7 +220,7 @@ class ChanProtect : public ModeHandler
else
{
// bzzzt, wrong answer!
- WriteServ(source->fd,"482 %s %s :You are not a channel founder",source->nick, channel->name);
+ source->WriteServ("482 %s %s :You are not a channel founder",source->nick, channel->name);
return MODEACTION_DENY;
}
}
@@ -233,10 +233,10 @@ class ChanProtect : public ModeHandler
{
if (cl[i]->GetExt(protect,dummyptr))
{
- WriteServ(user->fd,"388 %s %s %s",user->nick, channel->name,cl[i]->nick);
+ user->WriteServ("388 %s %s %s",user->nick, channel->name,cl[i]->nick);
}
}
- WriteServ(user->fd,"389 %s %s :End of channel protected user list",user->nick, channel->name);
+ user->WriteServ("389 %s %s :End of channel protected user list",user->nick, channel->name);
}
};
@@ -317,7 +317,7 @@ class ModuleChanProtect : public Module
// Change requested by katsklaw... when the first in is set to get founder,
// to make it clearer that +q has been given, send that one user the +q notice
// so that their client's syncronization and their sanity are left intact.
- WriteServ(user->fd,"MODE %s +q %s",channel->name,user->nick);
+ user->WriteServ("MODE %s +q %s",channel->name,user->nick);
if (user->Extend("cm_founder_"+std::string(channel->name),fakevalue))
{
Srv->Log(DEBUG,"Marked user "+std::string(user->nick)+" as founder for "+std::string(channel->name));
@@ -358,7 +358,7 @@ class ModuleChanProtect : public Module
if (dest->GetExt(founder,dummyptr))
{
log(DEBUG,"Has %s",founder.c_str());
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder");
return ACR_DENY;
}
else
@@ -367,7 +367,7 @@ class ModuleChanProtect : public Module
}
if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr)))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're protected (+a)");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're protected (+a)");
return ACR_DENY;
}
break;
@@ -377,12 +377,12 @@ class ModuleChanProtect : public Module
log(DEBUG,"OnAccessCheck AC_KICK");
if (dest->GetExt(founder,dummyptr))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're a channel founder");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're a channel founder");
return ACR_DENY;
}
if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr)))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're protected (+a)");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're protected (+a)");
return ACR_DENY;
}
break;
@@ -391,12 +391,12 @@ class ModuleChanProtect : public Module
case AC_DEHALFOP:
if (dest->GetExt(founder,dummyptr))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're a channel founder");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're a channel founder");
return ACR_DENY;
}
if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr)))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're protected (+a)");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're protected (+a)");
return ACR_DENY;
}
break;
@@ -405,12 +405,12 @@ class ModuleChanProtect : public Module
case AC_DEVOICE:
if (dest->GetExt(founder,dummyptr))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're a channel founder");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're a channel founder");
return ACR_DENY;
}
if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr)))
{
- Srv->SendServ(source->fd,"484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're protected (+a)");
+ source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're protected (+a)");
return ACR_DENY;
}
break;
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 0535c56ee..92b6d64f0 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -63,30 +63,30 @@ class cmd_check : public command_t
* :server.name 304 target :CHECK END
*/
- Srv->SendTo(NULL, user, checkstr + " START " + parameters[0]);
+ user->WriteServ(checkstr + " START " + parameters[0]);
if (targuser)
{
/* /check on a user */
- Srv->SendTo(NULL, user, checkstr + " nuh " + targuser->GetFullHost());
- Srv->SendTo(NULL, user, checkstr + " realnuh " + targuser->GetFullRealHost());
- Srv->SendTo(NULL, user, checkstr + " realname " + targuser->fullname);
- Srv->SendTo(NULL, user, checkstr + " modes +" + targuser->FormatModes());
- Srv->SendTo(NULL, user, checkstr + " server " + targuser->server);
+ user->WriteServ(checkstr + " nuh " + targuser->GetFullHost());
+ user->WriteServ(checkstr + " realnuh " + targuser->GetFullRealHost());
+ user->WriteServ(checkstr + " realname " + targuser->fullname);
+ user->WriteServ(checkstr + " modes +" + targuser->FormatModes());
+ user->WriteServ(checkstr + " server " + targuser->server);
if (targuser->awaymsg[0] != 0)
{
/* user is away */
- Srv->SendTo(NULL, user, checkstr + " awaymsg " + targuser->awaymsg);
+ user->WriteServ(checkstr + " awaymsg " + targuser->awaymsg);
}
if (targuser->oper[0] != 0)
{
/* user is an oper of type ____ */
- Srv->SendTo(NULL, user, checkstr + " opertype " + targuser->oper);
+ user->WriteServ(checkstr + " opertype " + targuser->oper);
}
if (IS_LOCAL(targuser))
{
/* port information is only held for a local user! */
- Srv->SendTo(NULL, user, checkstr + " onport " + ConvToStr(targuser->GetPort()));
+ user->WriteServ(checkstr + " onport " + ConvToStr(targuser->GetPort()));
}
chliststr = chlist(targuser, targuser);
@@ -102,20 +102,20 @@ class cmd_check : public command_t
mytime = gmtime(&creation_time);
strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
- Srv->SendTo(NULL, user, checkstr + " created " + timebuf);
+ user->WriteServ(checkstr + " created " + timebuf);
if (targchan->topic[0] != 0)
{
/* there is a topic, assume topic related information exists */
- Srv->SendTo(NULL, user, checkstr + " topic " + targchan->topic);
- Srv->SendTo(NULL, user, checkstr + " topic_setby " + targchan->setby);
+ user->WriteServ(checkstr + " topic " + targchan->topic);
+ user->WriteServ(checkstr + " topic_setby " + targchan->setby);
mytime = gmtime(&topic_time);
strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
- Srv->SendTo(NULL, user, checkstr + " topic_setat " + timebuf);
+ user->WriteServ(checkstr + " topic_setat " + timebuf);
}
- Srv->SendTo(NULL, user, checkstr + " modes " + chanmodes(targchan, true));
- Srv->SendTo(NULL, user, checkstr + " membercount " + ConvToStr(targchan->GetUserCounter()));
+ user->WriteServ(checkstr + " modes " + chanmodes(targchan, true));
+ user->WriteServ(checkstr + " membercount " + ConvToStr(targchan->GetUserCounter()));
/* now the ugly bit, spool current members of a channel. :| */
@@ -152,7 +152,7 @@ class cmd_check : public command_t
sprintf(tmpbuf, "%s (%s@%s) %s ", i->second->nick, i->second->ident, i->second->dhost, i->second->fullname);
strcat(ptr, tmpbuf);
- Srv->SendTo(NULL, user, checkstr + " member " + ptr);
+ user->WriteServ(checkstr + " member " + ptr);
}
}
else
@@ -166,20 +166,20 @@ class cmd_check : public command_t
if (match(a->second->host, parameters[0]) || match(a->second->dhost, parameters[0]))
{
/* host or vhost matches mask */
- Srv->SendTo(NULL, user, checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
+ user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
}
/* IP address */
else if (match(a->second->GetIPString(), parameters[0]))
{
/* same IP. */
- Srv->SendTo(NULL, user, checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
+ user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
}
}
- Srv->SendTo(NULL, user, checkstr + " matches " + ConvToStr(x));
+ user->WriteServ(checkstr + " matches " + ConvToStr(x));
}
- Srv->SendTo(NULL, user, checkstr + " END " + std::string(parameters[0]));
+ user->WriteServ(checkstr + " END " + std::string(parameters[0]));
}
};
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index ff52fcebf..82a94fadc 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -46,14 +46,14 @@ class cmd_chghost : public command_t
{
if (((*x < '0') || (*x > '9')) && (*x != '-'))
{
- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in hostname");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in hostname");
return;
}
}
}
if ((parameters[1] - x) > 63)
{
- WriteServ(user->fd,"NOTICE %s :*** CHGHOST: Host too long",user->nick);
+ user->WriteServ("NOTICE %s :*** CHGHOST: Host too long",user->nick);
return;
}
userrec* dest = Srv->FindNick(std::string(parameters[0]));
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp
index f83460f54..7cb09127a 100644
--- a/src/modules/m_chgident.cpp
+++ b/src/modules/m_chgident.cpp
@@ -25,7 +25,7 @@ class cmd_chgident : public command_t
{
if(!isident(parameters[1]))
{
- WriteServ(user->fd, "NOTICE %s :*** Invalid characters in ident", user->nick);
+ user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
return;
}
@@ -34,7 +34,7 @@ class cmd_chgident : public command_t
}
else
{
- WriteServ(user->fd, "401 %s %s :No such nick/channel", user->nick, parameters[0]);
+ user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
}
}
};
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp
index d89030ff9..ecda7cd0c 100644
--- a/src/modules/m_conn_waitpong.cpp
+++ b/src/modules/m_conn_waitpong.cpp
@@ -68,10 +68,10 @@ class ModuleWaitPong : public Module
{
char* pingrpl = RandString(10);
- Write(user->fd, "PING :%s", pingrpl);
+ user->Write("PING :%s", pingrpl);
if(sendsnotice)
- WriteServ(user->fd, "NOTICE %s :*** If you are having problems connecting due to ping timeouts, please type /quote PONG %s or /raw PONG %s now.", user->nick, pingrpl, pingrpl);
+ user->WriteServ("NOTICE %s :*** If you are having problems connecting due to ping timeouts, please type /quote PONG %s or /raw PONG %s now.", user->nick, pingrpl, pingrpl);
user->Extend("waitpong_pingstr", pingrpl);
}
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index 67e4da607..300d13b4a 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -72,7 +72,7 @@ class ModuleDenyChannels : public Module
else
{
std::string reason = Conf->ReadValue("badchan","reason",j);
- WriteServ(user->fd,"926 %s %s :Channel %s is forbidden: %s",user->nick,cname,cname,reason.c_str());
+ user->WriteServ("926 %s %s :Channel %s is forbidden: %s",user->nick,cname,cname,reason.c_str());
return 1;
}
}
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 8dd862ee7..1f7f6358a 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -107,7 +107,7 @@ class ModuleFilter : public Module
Srv->SendOpers(std::string("FILTER: ")+std::string(user->nick)+
std::string(" had their notice filtered, target was ")+
target+": "+f->reason);
- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+
+ user->WriteServ("NOTICE "+std::string(user->nick)+
" :Your notice has been filtered and opers notified: "+f->reason);
}
Srv->Log(DEFAULT,std::string("FILTER: ")+std::string(user->nick)+
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp
index e56dfa79c..ca5bdda7e 100644
--- a/src/modules/m_globalload.cpp
+++ b/src/modules/m_globalload.cpp
@@ -41,11 +41,11 @@ class cmd_gloadmodule : public command_t
if (ServerInstance->LoadModule(parameters[0]))
{
WriteOpers("*** NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick);
- WriteServ(user->fd,"975 %s %s :Module successfully loaded.",user->nick, parameters[0]);
+ user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]);
}
else
{
- WriteServ(user->fd,"974 %s %s :Failed to load module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
+ user->WriteServ("974 %s %s :Failed to load module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
}
}
};
@@ -64,11 +64,11 @@ class cmd_gunloadmodule : public command_t
if (ServerInstance->UnloadModule(parameters[0]))
{
WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick);
- WriteServ(user->fd,"973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
+ user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]);
}
else
{
- WriteServ(user->fd,"972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
+ user->WriteServ("972 %s %s :Failed to unload module: %s",user->nick, parameters[0],ServerInstance->ModuleError());
}
}
};
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index e503952d6..5680a239b 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -99,7 +99,7 @@ class cmd_helpop : public command_t
if(output != "")
{
- Srv->SendTo(NULL,user,"290 "+std::string(user->nick)+" :"+output);
+ user->WriteServ("290 "+std::string(user->nick)+" :"+output);
}
}
}
@@ -117,7 +117,7 @@ class cmd_helpop : public command_t
output = helpop->ReadValue("nohelpo", std::string(a), 0);
if (output != "")
{
- Srv->SendTo(NULL,user,"290 "+std::string(user->nick)+" :"+output);
+ user->WriteServ("290 "+std::string(user->nick)+" :"+output);
}
}
// Forward.
@@ -154,7 +154,7 @@ bool do_helpop(const char** parameters, int pcnt, userrec *src)
output = helpop->ReadValue(search, a, 0);
if (output != "")
{
- Srv->SendTo(NULL,src,"290 "+std::string(src->nick)+" :"+output);
+ src->WriteServ("290 "+std::string(src->nick)+" :"+output);
nlines++;
}
}
@@ -249,7 +249,7 @@ class ModuleHelpop : public Module
{
if (dst->IsModeSet('h'))
{
- Srv->SendTo(NULL,src,"310 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is available for help.");
+ src->WriteServ("310 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is available for help.");
}
}
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index de485b2c0..0a9ea8ccc 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -133,7 +133,7 @@ class ModuleHostChange : public Module
}
if (newhost != "")
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Setting your virtual host: " + newhost);
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your virtual host: " + newhost);
Srv->ChangeHost(user,newhost);
return;
}
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index fe697e4b7..4de84ea06 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -55,7 +55,7 @@ class RFC1413 : public InspSocket
if (u && (fd_ref_table[ufd] == u))
{
u->Shrink("ident_data");
- Srv->SendServ(u->fd,"NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead.");
+ u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead.");
}
}
@@ -87,7 +87,7 @@ class RFC1413 : public InspSocket
{
strlcpy(u->ident,section,IDENTMAX);
Srv->Log(DEBUG,"IDENT SET: "+std::string(u->ident));
- Srv->SendServ(u->fd,"NOTICE "+std::string(u->nick)+" :*** Found your ident: "+std::string(u->ident));
+ u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Found your ident: "+std::string(u->ident));
}
}
return false;
@@ -208,7 +208,7 @@ class ModuleIdent : public Module
* is derived from InspSocket, and inserting it into the socket engine using the
* Server::AddSocket() call.
*/
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :*** Looking up your ident...");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident...");
RFC1413* ident = new RFC1413(user, IdentTimeout, Srv);
if (ident->GetState() != I_ERROR)
{
@@ -217,7 +217,7 @@ class ModuleIdent : public Module
}
else
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
DELETE(ident);
}
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index f818484e8..e739e3d92 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -143,7 +143,7 @@ class JoinFlood : public ModeHandler
int nsecs = atoi(secs);
if ((njoins<1) || (nsecs<1))
{
- WriteServ(source->fd,"608 %s %s :Invalid flood parameter",source->nick,channel->name);
+ source->WriteServ("608 %s %s :Invalid flood parameter",source->nick,channel->name);
parameter = "";
return MODEACTION_DENY;
}
@@ -162,7 +162,7 @@ class JoinFlood : public ModeHandler
}
else
{
- WriteServ(source->fd,"608 %s %s :Invalid flood parameter",source->nick,channel->name);
+ source->WriteServ("608 %s %s :Invalid flood parameter",source->nick,channel->name);
return MODEACTION_DENY;
}
}
@@ -206,7 +206,7 @@ class ModuleJoinFlood : public Module
{
if (f->islocked())
{
- WriteServ(user->fd,"609 %s %s :This channel is temporarily unavailable (+j). Please try again later.",user->nick,chan->name);
+ user->WriteServ("609 %s %s :This channel is temporarily unavailable (+j). Please try again later.",user->nick,chan->name);
return 1;
}
}
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 4f415b8a9..c61f6484f 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -100,7 +100,7 @@ public:
if (iter->first == user)
{
log(DEBUG, "m_kicknorejoin.so: and we have the right user");
- WriteServ(user->fd, "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick, chan->name);
+ user->WriteServ( "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick, chan->name);
return 1;
}
}
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index e1c021743..8779804c5 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -42,7 +42,7 @@ class cmd_knock : public command_t
if (!c)
{
- WriteServ(user->fd,"401 %s %s :No such channel",user->nick, parameters[0]);
+ user->WriteServ("401 %s %s :No such channel",user->nick, parameters[0]);
return;
}
@@ -50,7 +50,7 @@ class cmd_knock : public command_t
if (c->IsModeSet('K'))
{
- WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
+ user->WriteServ("480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
return;
}
@@ -63,12 +63,12 @@ class cmd_knock : public command_t
if (c->modes[CM_INVITEONLY])
{
c->WriteChannelWithServ((char*)Srv->GetServerName().c_str(), "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name, user->nick, c->name, line.c_str());
- WriteServ(user->fd,"NOTICE %s :KNOCKing on %s",user->nick,c->name);
+ user->WriteServ("NOTICE %s :KNOCKing on %s",user->nick,c->name);
return;
}
else
{
- WriteServ(user->fd,"480 %s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick, c->name);
+ user->WriteServ("480 %s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick, c->name);
return;
}
}
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 6079eb47b..dbb7cecf1 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -142,7 +142,7 @@ class MsgFlood : public ModeHandler
int nsecs = atoi(secs);
if ((nlines<1) || (nsecs<1))
{
- WriteServ(source->fd,"608 %s %s :Invalid flood parameter",source->nick,channel->name);
+ source->WriteServ("608 %s %s :Invalid flood parameter",source->nick,channel->name);
parameter = "";
return MODEACTION_DENY;
}
@@ -161,7 +161,7 @@ class MsgFlood : public ModeHandler
}
else
{
- WriteServ(source->fd,"608 %s %s :Invalid flood parameter",source->nick,channel->name);
+ source->WriteServ("608 %s %s :Invalid flood parameter",source->nick,channel->name);
parameter = "";
return MODEACTION_DENY;
}
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp
index 36bf0598d..6369e34d7 100644
--- a/src/modules/m_nicklock.cpp
+++ b/src/modules/m_nicklock.cpp
@@ -48,7 +48,7 @@ class cmd_nicklock : public command_t
{
if (source->GetExt("nick_locked", dummy))
{
- WriteServ(user->fd,"946 %s %s :This user's nickname is already locked.",user->nick,source->nick);
+ user->WriteServ("946 %s %s :This user's nickname is already locked.",user->nick,source->nick);
return;
}
if (Srv->IsNick(std::string(parameters[1])))
@@ -81,7 +81,7 @@ class cmd_nickunlock : public command_t
if (source)
{
source->Shrink("nick_locked");
- WriteServ(user->fd,"945 %s %s :Nickname now unlocked.",user->nick,source->nick);
+ user->WriteServ("945 %s %s :Nickname now unlocked.",user->nick,source->nick);
Srv->SendOpers(std::string(user->nick)+" used NICKUNLOCK on "+std::string(parameters[0]));
}
}
@@ -122,7 +122,7 @@ class ModuleNickLock : public Module
{
if (user->GetExt("nick_locked", n))
{
- WriteServ(user->fd,"447 %s :You cannot change your nickname (your nick is locked)",user->nick);
+ user->WriteServ("447 %s :You cannot change your nickname (your nick is locked)",user->nick);
return 1;
}
return 0;
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 1755f8e41..a49e9f622 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -93,7 +93,7 @@ class ModuleNoCTCP : public Module
{
if (strncmp(text.c_str(),"\1ACTION ",8))
{
- WriteServ(user->fd,"492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name);
+ user->WriteServ("492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name);
return 1;
}
}
diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp
index 86b960b63..11a4e9493 100644
--- a/src/modules/m_noinvite.cpp
+++ b/src/modules/m_noinvite.cpp
@@ -81,7 +81,7 @@ class ModuleNoInvite : public Module
{
if (channel->IsModeSet('V'))
{
- WriteServ(user->fd,"492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
+ user->WriteServ("492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
return 1;
}
return 0;
diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp
index aa764b18b..5d406ed85 100644
--- a/src/modules/m_nokicks.cpp
+++ b/src/modules/m_nokicks.cpp
@@ -91,7 +91,7 @@ class ModuleNoKicks : public Module
else
{
// nobody else can (not even opers with override, and founders)
- WriteServ(source->fd,"484 %s %s :Can't kick user %s from channel (+Q set)",source->nick, channel->name,dest->nick);
+ source->WriteServ("484 %s %s :Can't kick user %s from channel (+Q set)",source->nick, channel->name,dest->nick);
return ACR_DENY;
}
}
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index b225cdba5..b96990cdf 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -103,7 +103,7 @@ class ModuleNoNickChange : public Module
{
// don't allow the nickchange, theyre on at least one channel with +N set
// and theyre not an oper
- WriteServ(user->fd,"447 %s :Can't change nickname while on %s (+N is set)",user->nick,curr->name);
+ user->WriteServ("447 %s :Can't change nickname while on %s (+N is set)",user->nick,curr->name);
return 1;
}
}
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index 5fe8a8c93..b11bd9d4e 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -85,7 +85,7 @@ class ModuleNoNotice : public Module
}
else
{
- WriteServ(user->fd,"404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
+ user->WriteServ("404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
return 1;
}
}
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index ebe4bc654..16c988ce8 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -85,7 +85,7 @@ class ModuleOperChans : public Module
{
if (chan->IsModeSet('O'))
{
- WriteServ(user->fd,"520 %s %s :Only IRC operators may join the channel %s (+O is set)",user->nick, chan->name,chan->name);
+ user->WriteServ("520 %s %s :Only IRC operators may join the channel %s (+O is set)",user->nick, chan->name,chan->name);
return 1;
}
}
diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp
index 8df45f0fc..6753daae9 100644
--- a/src/modules/m_operlevels.cpp
+++ b/src/modules/m_operlevels.cpp
@@ -74,8 +74,8 @@ class ModuleOperLevels : public Module
if (dest_level > source_level)
{
WriteOpers("Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str());
- WriteServ(dest->fd,"NOTICE %s :Oper %s attempted to /kill you!",dest->nick,source->nick);
- WriteServ(source->fd,"481 %s :Permission Denied- Oper %s is a higher level than you",source->nick,dest->nick);
+ dest->WriteServ("NOTICE %s :Oper %s attempted to /kill you!",dest->nick,source->nick);
+ source->WriteServ("481 %s :Permission Denied- Oper %s is a higher level than you",source->nick,dest->nick);
return 1;
}
}
diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp
index 1adf0906f..e8fa613ff 100644
--- a/src/modules/m_opermd5.cpp
+++ b/src/modules/m_opermd5.cpp
@@ -281,7 +281,7 @@ class cmd_mkpasswd : public command_t
{
char buffer[MAXBUF];
GenHash(parameters[0],buffer);
- WriteServ(user->fd,"NOTICE %s :MD5 hashed password for %s is %s",user->nick,parameters[0],buffer);
+ user->WriteServ("NOTICE %s :MD5 hashed password for %s is %s",user->nick,parameters[0],buffer);
}
};
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index 4980b74bf..e38d0b827 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -28,18 +28,18 @@ void ShowOperMOTD(userrec* user)
{
if(!opermotd->FileSize())
{
- Srv->SendServ(user->fd,std::string("425 ") + user->nick + std::string(" :OPERMOTD file is missing"));
+ user->WriteServ(std::string("425 ") + user->nick + std::string(" :OPERMOTD file is missing"));
return;
}
- Srv->SendServ(user->fd,std::string("375 ") + user->nick + std::string(" :- IRC Operators Message of the Day"));
+ user->WriteServ(std::string("375 ") + user->nick + std::string(" :- IRC Operators Message of the Day"));
for(int i=0; i != opermotd->FileSize(); i++)
{
- Srv->SendServ(user->fd,std::string("372 ") + user->nick + std::string(" :- ") + opermotd->GetLine(i));
+ user->WriteServ(std::string("372 ") + user->nick + std::string(" :- ") + opermotd->GetLine(i));
}
- Srv->SendServ(user->fd,std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD"));
+ user->WriteServ(std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD"));
}
diff --git a/src/modules/m_opersha256.cpp b/src/modules/m_opersha256.cpp
index b720118e2..289ea6f7d 100644
--- a/src/modules/m_opersha256.cpp
+++ b/src/modules/m_opersha256.cpp
@@ -237,7 +237,7 @@ public:
{
char buffer[SHA256_BLOCK_SIZE + 1];
SHA256(parameters[0], buffer, strlen(parameters[0]));
- WriteServ(user->fd, "NOTICE %s :SHA256 hashed password for %s is %s", user->nick, parameters[0], buffer);
+ user->WriteServ( "NOTICE %s :SHA256 hashed password for %s is %s", user->nick, parameters[0], buffer);
}
};
diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp
index 2a9aad5f0..7b7a0f1b3 100644
--- a/src/modules/m_park.cpp
+++ b/src/modules/m_park.cpp
@@ -78,7 +78,7 @@ class cmd_park : public command_t
othersessions++;
if (othersessions >= ConcurrentParks)
{
- Srv->SendServ(user->fd,"927 "+std::string(user->nick)+" :You are already parked up to the maximum number of allowed times.");
+ user->WriteServ("927 "+std::string(user->nick)+" :You are already parked up to the maximum number of allowed times.");
}
else
{
@@ -112,7 +112,7 @@ class cmd_parkstats : public command_t
{
char status[MAXBUF];
snprintf(status,MAXBUF,"NOTICE %s :There are a total of %lu parked clients on this server, with a maximum of %lu parked sessions allowed per user.",user->nick,(unsigned long)pinfo.size(),(unsigned long)ConcurrentParks);
- Srv->SendServ(user->fd,status);
+ user->WriteServ(std::string(status));
}
};
@@ -146,7 +146,7 @@ class cmd_unpark : public command_t
userrec* unpark = Srv->FindNick(std::string(parameters[0]));
if (!unpark)
{
- WriteServ(user->fd,"942 %s %s :Invalid user specified.",user->nick, parameters[0]);
+ user->WriteServ("942 %s %s :Invalid user specified.",user->nick, parameters[0]);
return;
}
awaylog* awy;
@@ -155,7 +155,7 @@ class cmd_unpark : public command_t
unpark->GetExt("park_key", key);
if (!awy)
{
- WriteServ(user->fd,"943 %s %s :This user is not parked.",user->nick, unpark->nick);
+ user->WriteServ("943 %s %s :This user is not parked.",user->nick, unpark->nick);
return;
}
if (*key == atoi(parameters[1]))
@@ -171,20 +171,20 @@ class cmd_unpark : public command_t
}
}
// remove all their old modes
- WriteServ(user->fd,"MODE %s -%s",user->nick,user->FormatModes());
+ user->WriteServ("MODE %s -%s",user->nick,user->FormatModes());
// now, map them to the parked user, while nobody can see :p
Srv->PseudoToUser(user,unpark,"Unparked to "+std::string(parameters[0]));
// set all their new modes
- WriteServ(unpark->fd,"MODE %s +%s",unpark->nick,unpark->FormatModes());
+ unpark->WriteServ("MODE %s +%s",unpark->nick,unpark->FormatModes());
// spool their away log to them
- WriteServ(unpark->fd,"NOTICE %s :*** You are now unparked. You have successfully taken back the nickname and privilages of %s.",unpark->nick,unpark->nick);
+ unpark->WriteServ("NOTICE %s :*** You are now unparked. You have successfully taken back the nickname and privilages of %s.",unpark->nick,unpark->nick);
for (awaylog::iterator i = awy->begin(); i != awy->end(); i++)
{
char timebuf[MAXBUF];
tm *timeinfo = localtime(&i->tm);
strlcpy(timebuf,asctime(timeinfo),MAXBUF);
timebuf[strlen(timebuf)-1] = '\0';
- WriteServ(unpark->fd,"NOTICE %s :From %s at %s: \2%s\2",unpark->nick,i->from.c_str(),timebuf,i->text.c_str());
+ unpark->WriteServ("NOTICE %s :From %s at %s: \2%s\2",unpark->nick,i->from.c_str(),timebuf,i->text.c_str());
}
DELETE(awy);
DELETE(key);
@@ -201,7 +201,7 @@ class cmd_unpark : public command_t
}
else
{
- Srv->SendServ(user->fd,"928 "+std::string(user->nick)+" :Incorrect park key.");
+ user->WriteServ("928 "+std::string(user->nick)+" :Incorrect park key.");
}
}
};
@@ -284,9 +284,9 @@ class ModulePark : public Module
am.from = user->GetFullHost();
am.tm = time(NULL);
awy->push_back(am);
- Srv->SendServ(user->fd,"930 "+std::string(user->nick)+" :User "+std::string(dest->nick)+" is parked. Your message has been stored.");
+ user->WriteServ("930 "+std::string(user->nick)+" :User "+std::string(dest->nick)+" is parked. Your message has been stored.");
}
- else Srv->SendServ(user->fd,"929 "+std::string(user->nick)+" :User "+std::string(dest->nick)+" is parked, but their message queue is full. Message not saved.");
+ else user->WriteServ("929 "+std::string(user->nick)+" :User "+std::string(dest->nick)+" is parked, but their message queue is full. Message not saved.");
}
}
@@ -348,7 +348,7 @@ class ModulePark : public Module
{
char* dummy;
if (dst->GetExt("park_awaylog", dummy))
- Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a parked client");
+ src->WriteServ("335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a parked client");
}
virtual Version GetVersion()
diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp
index 12049b376..85e4e34b2 100644
--- a/src/modules/m_randquote.cpp
+++ b/src/modules/m_randquote.cpp
@@ -51,12 +51,12 @@ class cmd_randquote : public command_t
fsize = quotes->FileSize();
str = quotes->GetLine(rand() % fsize);
sprintf(buf,"NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str());
- Srv->SendServ(user->fd, buf);
+ user->WriteServ(std::string(buf));
}
else
{
sprintf(buf, "NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick);
- Srv->SendServ(user->fd, buf);
+ user->WriteServ(std::string(buf));
}
return;
}
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index bbddb0f18..c5a7f8e9c 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -54,7 +54,7 @@ class Redirect : public ModeHandler
if (!IsValidChannelName(parameter.c_str()))
{
- WriteServ(source->fd,"403 %s %s :Invalid channel name",source->nick, parameter.c_str());
+ source->WriteServ("403 %s %s :Invalid channel name",source->nick, parameter.c_str());
parameter = "";
return MODEACTION_DENY;
}
@@ -67,7 +67,7 @@ class Redirect : public ModeHandler
{
if ((c == channel) || (c->IsModeSet('L')))
{
- WriteServ(source->fd,"690 %s :Circular or chained +L to %s not allowed (Channel already has +L). Pack of wild dogs has been unleashed.",source->nick,parameter.c_str());
+ source->WriteServ("690 %s :Circular or chained +L to %s not allowed (Channel already has +L). Pack of wild dogs has been unleashed.",source->nick,parameter.c_str());
parameter = "";
return MODEACTION_DENY;
}
@@ -77,7 +77,7 @@ class Redirect : public ModeHandler
{
if ((i->second != channel) && (i->second->IsModeSet('L')) && (irc::string(i->second->GetModeParameter('L').c_str()) == irc::string(channel->name)))
{
- WriteServ(source->fd,"690 %s :Circular or chained +L to %s not allowed (Already forwarded here from %s). Angry monkeys dispatched.",source->nick,parameter.c_str(),i->second->name);
+ source->WriteServ("690 %s :Circular or chained +L to %s not allowed (Already forwarded here from %s). Angry monkeys dispatched.",source->nick,parameter.c_str(),i->second->name);
return MODEACTION_DENY;
}
}
@@ -137,7 +137,7 @@ class ModuleRedirect : public Module
if (Srv->CountUsers(chan) >= chan->limit)
{
std::string channel = chan->GetModeParameter('L');
- WriteServ(user->fd,"470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel.c_str());
+ user->WriteServ("470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel.c_str());
chanrec::JoinUser(user, channel.c_str(), false);
return 1;
}
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 7452b2f33..a9c478a89 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -92,13 +92,13 @@ class RemoveBase
/* Fix by brain - someone needs to learn to validate their input! */
if (!target || !channel)
{
- WriteServ(user->fd,"401 %s %s :No such nick/channel", user->nick, !target ? username : channame);
+ user->WriteServ("401 %s %s :No such nick/channel", user->nick, !target ? username : channame);
return;
}
if (!channel->HasUser(target))
{
- WriteServ(user->fd, "NOTICE %s :*** The user %s is not on channel %s", user->nick, target->nick, channel->name);
+ user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick, target->nick, channel->name);
return;
}
@@ -183,20 +183,20 @@ class RemoveBase
reason << "Removed by " << user->nick << reasonparam;
channel->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :%s removed %s from the channel", channel->name, user->nick, target->nick);
- WriteServ(target->fd, "NOTICE %s :*** %s removed you from %s with the message: %s", target->nick, user->nick, channel->name, reasonparam.c_str());
+ target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick, user->nick, channel->name, reasonparam.c_str());
if (!channel->PartUser(target, reason.str().c_str()))
delete channel;
}
else
{
- WriteServ(user->fd, "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick, target->nick, channel->name);
+ user->WriteServ( "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick, target->nick, channel->name);
}
}
else
{
/* m_nokicks.so was loaded and +Q was set, block! */
- WriteServ(user->fd, "484 %s %s :Can't remove user %s from channel (+Q set)", user->nick, channel->name, target->nick);
+ user->WriteServ( "484 %s %s :Can't remove user %s from channel (+Q set)", user->nick, channel->name, target->nick);
}
}
};
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index a901dfde6..bb804676b 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -72,7 +72,7 @@ class ModuleRestrictChans : public Module
// channel does not yet exist (record is null, about to be created IF we were to allow it)
if (!chan)
{
- WriteServ(user->fd,"530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
+ user->WriteServ("530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
return 1;
}
}
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp
index c51ea4850..50d87b353 100644
--- a/src/modules/m_restrictmsg.cpp
+++ b/src/modules/m_restrictmsg.cpp
@@ -57,7 +57,7 @@ class ModuleRestrictMsg : public Module
// anything else, blocked.
return 0;
}
- WriteServ(user->fd,"531 %s %s :You are not permitted to send private messages to this user",user->nick,u->nick);
+ user->WriteServ("531 %s %s :You are not permitted to send private messages to this user",user->nick,u->nick);
return 1;
}
// however, we must allow channel messages...
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index 148040c6c..16455fe11 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -95,7 +95,7 @@ class ListTimer : public InspTimer
{
log(DEBUG,"Channel %ld",ld->list_position);
if (!ld->list_position)
- WriteServ(u->fd,"321 %s Channel :Users Name",u->nick);
+ u->WriteServ("321 %s Channel :Users Name",u->nick);
chan = Srv->GetChannelIndex(ld->list_position);
/* spool details */
bool has_user = (chan && chan->HasUser(u));
@@ -108,7 +108,7 @@ class ListTimer : public InspTimer
/* Increment total plus linefeed */
amount_sent += counter + 4 + Srv->GetServerName().length();
log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax);
- WriteServ_NoFormat(u->fd,buffer);
+ u->WriteServ(std::string(buffer));
}
}
else
@@ -118,7 +118,7 @@ class ListTimer : public InspTimer
if (!ld->list_ended)
{
ld->list_ended = true;
- WriteServ(u->fd,"323 %s :End of channel list.",u->nick);
+ u->WriteServ("323 %s :End of channel list.",u->nick);
}
}
}
@@ -201,7 +201,7 @@ class ModuleSafeList : public Module
{
if (TIME < (*last_list_time)+60)
{
- WriteServ(user->fd,"NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick);
+ user->WriteServ("NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick);
return 1;
}
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 0c7387213..b32ba58ab 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -43,13 +43,13 @@ class cmd_sajoin : public command_t
{
if (Srv->IsUlined(dest->server))
{
- WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+ user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return;
}
if (!IsValidChannelName(parameters[1]))
{
/* we didn't need to check this for each character ;) */
- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
return;
}
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index 561bca613..7a78a15ce 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -42,7 +42,7 @@ class cmd_sanick : public command_t
{
if (Srv->IsUlined(source->server))
{
- WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+ user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return;
}
if (Srv->IsNick(std::string(parameters[1])))
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp
index df44e4671..6d1086bba 100644
--- a/src/modules/m_sapart.cpp
+++ b/src/modules/m_sapart.cpp
@@ -44,7 +44,7 @@ class cmd_sapart : public command_t
{
if (Srv->IsUlined(dest->server))
{
- WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+ user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return;
}
Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp
index 5ede08b67..7f622483c 100644
--- a/src/modules/m_saquit.cpp
+++ b/src/modules/m_saquit.cpp
@@ -52,7 +52,7 @@ class cmd_saquit : public command_t
{
if (Srv->IsUlined(dest->server))
{
- WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
+ user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return;
}
std::string line = "";
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index 97f84f5c7..c1c79f8da 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -63,12 +63,12 @@ class ModuleSecureList : public Module
if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
{
- WriteServ(user->fd,"NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
+ user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
/* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
* receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
*/
- WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
- WriteServ(user->fd,"323 %s :End of channel list.",user->nick);
+ user->WriteServ("321 %s Channel :Users Name",user->nick);
+ user->WriteServ("323 %s :End of channel list.",user->nick);
return 1;
}
return 0;
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index f27e74a4d..9f5e1bdb7 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -46,7 +46,7 @@ class Channel_r : public ModeHandler
else
{
log(DEBUG,"Only a server can set chanmode +r, server and nick are: '%s','%s'",source->nick,source->server);
- Srv->SendServ(source->fd,"500 "+std::string(source->nick)+" :Only a server may modify the +r channel mode");
+ source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r channel mode");
return MODEACTION_DENY;
}
}
@@ -69,7 +69,7 @@ class User_r : public ModeHandler
else
{
log(DEBUG,"Only a server can set umode +r, server and nick are: '%s','%s'",source->nick, source->server);
- Srv->SendServ(source->fd,"500 "+std::string(source->nick)+" :Only a server may modify the +r user mode");
+ source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r user mode");
return MODEACTION_DENY;
}
}
@@ -196,7 +196,7 @@ class ModuleServices : public Module
if (dest->IsModeSet('r'))
{
/* user is registered */
- WriteServ(source->fd, "307 %s %s :is a registered nick", source->nick, dest->nick);
+ source->WriteServ("307 %s %s :is a registered nick", source->nick, dest->nick);
}
}
@@ -232,7 +232,7 @@ class ModuleServices : public Module
return 0;
}
// user messaging a +M channel and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need a registered nickname to speak on this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need a registered nickname to speak on this channel");
return 1;
}
}
@@ -247,7 +247,7 @@ class ModuleServices : public Module
return 0;
}
// user messaging a +R user and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need a registered nickname to message this user");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need a registered nickname to message this user");
return 1;
}
}
@@ -273,7 +273,7 @@ class ModuleServices : public Module
return 0;
}
// joining a +R channel and not identified
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need a registered nickname to join this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need a registered nickname to join this channel");
return 1;
}
}
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 64ea36c48..5ffb48f98 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -141,7 +141,7 @@ class ModuleServicesAccount : public Module
if (account)
{
- WriteServ(source->fd, "330 %s %s %s :is logged in as", source->nick, dest->nick, account->c_str());
+ source->WriteServ("330 %s %s %s :is logged in as", source->nick, dest->nick, account->c_str());
}
}
@@ -169,7 +169,7 @@ class ModuleServicesAccount : public Module
}
// user messaging a +M channel and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
return 1;
}
}
@@ -186,7 +186,7 @@ class ModuleServicesAccount : public Module
}
// user messaging a +R user and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need to be identified to a registered account to message this user");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need to be identified to a registered account to message this user");
return 1;
}
}
@@ -215,7 +215,7 @@ class ModuleServicesAccount : public Module
return 0;
}
// joining a +R channel and not identified
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need to be identified to a registered account to join this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need to be identified to a registered account to join this channel");
return 1;
}
}
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp
index 9b403506d..94e811d79 100644
--- a/src/modules/m_sethost.cpp
+++ b/src/modules/m_sethost.cpp
@@ -40,7 +40,7 @@ class cmd_sethost : public command_t
{
if (strlen(parameters[0]) > 64)
{
- WriteServ(user->fd,"NOTICE %s :*** SETHOST: Host too long",user->nick);
+ user->WriteServ("NOTICE %s :*** SETHOST: Host too long",user->nick);
return;
}
for (unsigned int x = 0; x < strlen(parameters[0]); x++)
@@ -49,7 +49,7 @@ class cmd_sethost : public command_t
{
if (((parameters[0][x] < '0') || (parameters[0][x]> '9')) && (parameters[0][x] != '-'))
{
- Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in hostname");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in hostname");
return;
}
}
diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp
index 80333ca8d..a5eb27a9b 100644
--- a/src/modules/m_setident.cpp
+++ b/src/modules/m_setident.cpp
@@ -22,7 +22,7 @@ class cmd_setident : public command_t
if(((parameters[0][x] >= 'A') && (parameters[0][x] <= '}')) || strchr(".-0123456789", parameters[0][x]))
continue;
- WriteServ(user->fd, "NOTICE %s :*** Invalid characters in ident", user->nick);
+ user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
return;
}
diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp
index b388d35eb..f17f69e09 100644
--- a/src/modules/m_setidle.cpp
+++ b/src/modules/m_setidle.cpp
@@ -40,7 +40,7 @@ class cmd_setidle : public command_t
{
if (atoi(parameters[0]) < 1)
{
- WriteServ(user->fd,"948 %s :Invalid idle time.",user->nick);
+ user->WriteServ("948 %s :Invalid idle time.",user->nick);
return;
}
user->idle_lastmsg = time(NULL) - atoi(parameters[0]);
@@ -48,7 +48,7 @@ class cmd_setidle : public command_t
if (user->signon > user->idle_lastmsg)
user->signon = user->idle_lastmsg;
Srv->SendOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+std::string(parameters[0])+" seconds");
- WriteServ(user->fd,"944 %s :Idle time set.",user->nick);
+ user->WriteServ("944 %s :Idle time set.",user->nick);
}
};
diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp
index c7ba52035..9b51e6204 100644
--- a/src/modules/m_showwhois.cpp
+++ b/src/modules/m_showwhois.cpp
@@ -75,7 +75,7 @@ class ModuleShowwhois : public Module
{
if ((dest->IsModeSet('W')) && (source != dest))
{
- WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
+ dest->WriteServ("NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
}
}
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index e3cd36f76..855aca0e3 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -55,10 +55,10 @@ class cmd_silence : public command_t
{
for (silencelist::const_iterator c = sl->begin(); c < sl->end(); c++)
{
- WriteServ(user->fd,"271 %s %s %s!*@*",user->nick, user->nick,c->c_str());
+ user->WriteServ("271 %s %s %s!*@*",user->nick, user->nick,c->c_str());
}
}
- WriteServ(user->fd,"272 %s :End of Silence List",user->nick);
+ user->WriteServ("272 %s :End of Silence List",user->nick);
}
else if (pcnt > 0)
{
@@ -84,7 +84,7 @@ class cmd_silence : public command_t
if (listitem == target)
{
sl->erase(i);
- WriteServ(user->fd,"950 %s %s :Removed %s!*@* from silence list",user->nick, user->nick,nick);
+ user->WriteServ("950 %s %s :Removed %s!*@* from silence list",user->nick, user->nick,nick);
// we have modified the vector from within a loop, we must now bail out
return;
}
@@ -118,12 +118,12 @@ class cmd_silence : public command_t
irc::string target = nick;
if (listitem == target)
{
- WriteServ(user->fd,"952 %s %s :%s is already on your silence list",user->nick, user->nick,nick);
+ user->WriteServ("952 %s %s :%s is already on your silence list",user->nick, user->nick,nick);
return;
}
}
sl->push_back(std::string(nick));
- WriteServ(user->fd,"951 %s %s :Added %s!*@* to silence list",user->nick, user->nick,nick);
+ user->WriteServ("951 %s %s :Added %s!*@* to silence list",user->nick, user->nick,nick);
return;
}
}
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 1e908f07b..6ced44c9f 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -614,7 +614,7 @@ class cmd_rconnect : public command_t
void Handle (const char** parameters, int pcnt, userrec *user)
{
- WriteServ(user->fd,"NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]);
+ user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]);
/* Is this aimed at our server? */
if (Srv->MatchText(Srv->GetServerName(),parameters[0]))
{
@@ -2081,7 +2081,7 @@ class TreeSocket : public InspSocket
std::string reason = params[1];
params[1] = ":" + params[1];
DoOneToAllButSender(prefix,"KILL",params,sourceserv);
- ::Write(who->fd, ":%s KILL %s :%s (%s)", sourceserv.c_str(), who->nick, sourceserv.c_str(), reason.c_str());
+ who->Write(":%s KILL %s :%s (%s)", sourceserv.c_str(), who->nick, sourceserv.c_str(), reason.c_str());
userrec::QuitUser(who,reason);
}
return true;
@@ -2115,7 +2115,7 @@ class TreeSocket : public InspSocket
if (u)
{
- WriteServ(u->fd,"PONG %s %s",params[0].c_str(),params[1].c_str());
+ u->WriteServ("PONG %s %s",params[0].c_str(),params[1].c_str());
}
}
else
@@ -2341,7 +2341,7 @@ class TreeSocket : public InspSocket
if (IS_LOCAL(u))
{
- ::Write(u->fd,"%s",params[1].c_str());
+ u->Write(params[1]);
}
else
{
@@ -2391,7 +2391,7 @@ class TreeSocket : public InspSocket
char tms[26];
snprintf(tms,26,"%s",asctime(timeinfo));
tms[24] = 0;
- WriteServ(u->fd,"391 %s %s :%s",u->nick,prefix.c_str(),tms);
+ u->WriteServ("391 %s %s :%s",u->nick,prefix.c_str(),tms);
}
else
{
@@ -3472,7 +3472,7 @@ class ModuleSpanningTree : public Module
/* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */
if ((HideULines) && (Srv->IsUlined(Current->GetName())) && (!*user->oper))
return;
- WriteServ(user->fd,"364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),(FlatLinks && (!*user->oper)) ? Srv->GetServerName().c_str() : Parent.c_str(),(FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str());
+ user->WriteServ("364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),(FlatLinks && (!*user->oper)) ? Srv->GetServerName().c_str() : Parent.c_str(),(FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str());
}
int CountLocalServs()
@@ -3488,7 +3488,7 @@ class ModuleSpanningTree : public Module
void HandleLinks(const char** parameters, int pcnt, userrec* user)
{
ShowLinks(TreeRoot,user,0);
- WriteServ(user->fd,"365 %s * :End of /LINKS list.",user->nick);
+ user->WriteServ("365 %s * :End of /LINKS list.",user->nick);
return;
}
@@ -3502,16 +3502,16 @@ class ModuleSpanningTree : public Module
if (n_users > max_global)
max_global = n_users;
- WriteServ(user->fd,"251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-usercount_invisible(),usercount_invisible(),this->CountServs());
+ user->WriteServ("251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-usercount_invisible(),usercount_invisible(),this->CountServs());
if (usercount_opers())
- WriteServ(user->fd,"252 %s %d :operator(s) online",user->nick,usercount_opers());
+ user->WriteServ("252 %s %d :operator(s) online",user->nick,usercount_opers());
if (usercount_unknown())
- WriteServ(user->fd,"253 %s %d :unknown connections",user->nick,usercount_unknown());
+ user->WriteServ("253 %s %d :unknown connections",user->nick,usercount_unknown());
if (chancount())
- WriteServ(user->fd,"254 %s %d :channels formed",user->nick,chancount());
- WriteServ(user->fd,"254 %s :I have %d clients and %d servers",user->nick,local_count(),this->CountLocalServs());
- WriteServ(user->fd,"265 %s :Current Local Users: %d Max: %d",user->nick,local_count(),max_local);
- WriteServ(user->fd,"266 %s :Current Global Users: %d Max: %d",user->nick,n_users,max_global);
+ user->WriteServ("254 %s %d :channels formed",user->nick,chancount());
+ user->WriteServ("254 %s :I have %d clients and %d servers",user->nick,local_count(),this->CountLocalServs());
+ user->WriteServ("265 %s :Current Local Users: %d Max: %d",user->nick,local_count(),max_local);
+ user->WriteServ("266 %s :Current Global Users: %d Max: %d",user->nick,n_users,max_global);
return;
}
@@ -3588,7 +3588,7 @@ class ModuleSpanningTree : public Module
}
else
{
- WriteServ(user->fd, "402 %s %s :No such server", user->nick, parameters[0]);
+ user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]);
}
return 1;
}
@@ -3652,11 +3652,11 @@ class ModuleSpanningTree : public Module
// dump the whole lot to the user. This is the easy bit, honest.
for (int t = 0; t < line; t++)
{
- WriteServ(user->fd,"006 %s :%s",user->nick,&matrix[t][0]);
+ user->WriteServ("006 %s :%s",user->nick,&matrix[t][0]);
}
float avg_users = totusers / totservers;
- WriteServ(user->fd,"270 %s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick,totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
- WriteServ(user->fd,"007 %s :End of /MAP",user->nick);
+ user->WriteServ("270 %s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick,totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
+ user->WriteServ("007 %s :End of /MAP",user->nick);
return;
}
@@ -3667,7 +3667,7 @@ class ModuleSpanningTree : public Module
{
if (s == TreeRoot)
{
- WriteServ(user->fd,"NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick,parameters[0]);
+ user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick,parameters[0]);
return 1;
}
TreeSocket* sock = s->GetSocket();
@@ -3680,12 +3680,12 @@ class ModuleSpanningTree : public Module
}
else
{
- WriteServ(user->fd,"NOTICE %s :*** SQUIT: The server \002%s\002 is not directly connected.",user->nick,parameters[0]);
+ user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 is not directly connected.",user->nick,parameters[0]);
}
}
else
{
- WriteServ(user->fd,"NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick,parameters[0]);
+ user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick,parameters[0]);
}
return 1;
}
@@ -3708,7 +3708,7 @@ class ModuleSpanningTree : public Module
}
else
{
- WriteServ(user->fd,"402 %s %s :No such server",user->nick,parameters[0]);
+ user->WriteServ("402 %s %s :No such server",user->nick,parameters[0]);
}
}
return 1;
@@ -3728,8 +3728,8 @@ class ModuleSpanningTree : public Module
}
else if (!remote)
{
- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[1]);
- WriteServ(user->fd,"318 %s %s :End of /WHOIS list.",user->nick, parameters[1]);
+ user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[1]);
+ user->WriteServ("318 %s %s :End of /WHOIS list.",user->nick, parameters[1]);
return 1;
}
}
@@ -3819,7 +3819,7 @@ class ModuleSpanningTree : public Module
if (found)
{
std::string Version = found->GetVersion();
- WriteServ(user->fd,"351 %s :%s",user->nick,Version.c_str());
+ user->WriteServ("351 %s :%s",user->nick,Version.c_str());
if (found == TreeRoot)
{
std::stringstream out(Config->data005);
@@ -3835,7 +3835,7 @@ class ModuleSpanningTree : public Module
if ((token_counter >= 13) || (out.eof() == true))
{
- WriteServ(user->fd,"005 %s %s:are supported by this server",user->nick,line5.c_str());
+ user->WriteServ("005 %s %s:are supported by this server",user->nick,line5.c_str());
line5 = "";
token_counter = 0;
}
@@ -3844,7 +3844,7 @@ class ModuleSpanningTree : public Module
}
else
{
- WriteServ(user->fd,"402 %s %s :No such server",user->nick,parameters[0]);
+ user->WriteServ("402 %s %s :No such server",user->nick,parameters[0]);
}
return 1;
}
@@ -3858,7 +3858,7 @@ class ModuleSpanningTree : public Module
TreeServer* CheckDupe = FindServer(x->Name.c_str());
if (!CheckDupe)
{
- WriteServ(user->fd,"NOTICE %s :*** CONNECT: Connecting to server: \002%s\002 (%s:%d)",user->nick,x->Name.c_str(),(x->HiddenFromStats ? "<hidden>" : x->IPAddr.c_str()),x->Port);
+ user->WriteServ("NOTICE %s :*** CONNECT: Connecting to server: \002%s\002 (%s:%d)",user->nick,x->Name.c_str(),(x->HiddenFromStats ? "<hidden>" : x->IPAddr.c_str()),x->Port);
insp_inaddr binip;
/* Do we already have an IP? If so, no need to resolve it. */
@@ -3891,12 +3891,12 @@ class ModuleSpanningTree : public Module
}
else
{
- WriteServ(user->fd,"NOTICE %s :*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002",user->nick,x->Name.c_str(),CheckDupe->GetParent()->GetName().c_str());
+ user->WriteServ("NOTICE %s :*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002",user->nick,x->Name.c_str(),CheckDupe->GetParent()->GetName().c_str());
return 1;
}
}
}
- WriteServ(user->fd,"NOTICE %s :*** CONNECT: No server matching \002%s\002 could be found in the config file.",user->nick,parameters[0]);
+ user->WriteServ("NOTICE %s :*** CONNECT: No server matching \002%s\002 could be found in the config file.",user->nick,parameters[0]);
return 1;
}
diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp
index d6f6826a9..b835e2c66 100644
--- a/src/modules/m_spy.cpp
+++ b/src/modules/m_spy.cpp
@@ -71,14 +71,14 @@ void spy_userlist(userrec *user,chanrec *c)
{
/* list overflowed into
* multiple numerics */
- WriteServ_NoFormat(user->fd,list);
+ user->WriteServ(std::string(list));
snprintf(list,MAXBUF,"353 %s = %s :", user->nick, c->name);
}
}
/* if whats left in the list isnt empty, send it */
if (list[strlen(list)-1] != ':')
{
- WriteServ_NoFormat(user->fd,list);
+ user->WriteServ(std::string(list));
}
}
@@ -96,12 +96,12 @@ class cmd_spylist : public command_t
void Handle (const char** parameters, int pcnt, userrec *user)
{
WriteOpers("*** Oper %s used SPYLIST to list +s/+p channels and keys.",user->nick);
- WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
+ user->WriteServ("321 %s Channel :Users Name",user->nick);
for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++)
{
- WriteServ(user->fd,"322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount(i->second),chanmodes(i->second,true),i->second->topic);
+ user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount(i->second),chanmodes(i->second,true),i->second->topic);
}
- WriteServ(user->fd,"323 %s :End of channel list.",user->nick);
+ user->WriteServ("323 %s :End of channel list.",user->nick);
}
};
@@ -120,7 +120,7 @@ class cmd_spynames : public command_t
if (!pcnt)
{
- WriteServ(user->fd,"366 %s * :End of /NAMES list.",user->nick);
+ user->WriteServ("366 %s * :End of /NAMES list.",user->nick);
return;
}
@@ -133,11 +133,11 @@ class cmd_spynames : public command_t
if (c)
{
spy_userlist(user,c);
- WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, c->name);
+ user->WriteServ("366 %s %s :End of /NAMES list.", user->nick, c->name);
}
else
{
- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
+ user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]);
}
}
};
diff --git a/src/modules/m_ssl_dummy.cpp b/src/modules/m_ssl_dummy.cpp
index 7214c416b..1b022c14b 100644
--- a/src/modules/m_ssl_dummy.cpp
+++ b/src/modules/m_ssl_dummy.cpp
@@ -51,7 +51,7 @@ class ModuleSSLDummy : public Module
{
if(dest->GetExt("ssl", dummy))
{
- WriteServ(source->fd, "320 %s %s :is using a secure connection", source->nick, dest->nick);
+ source->WriteServ("320 %s %s :is using a secure connection", source->nick, dest->nick);
}
}
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index d2a8f6fb1..673c30536 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -24,7 +24,7 @@ class SSLMode : public ModeHandler
{
if(!userlist[i]->GetExt("ssl", dummy))
{
- WriteServ(source->fd, "490 %s %s :all members of the channel must be connected via SSL", source->nick, channel->name);
+ source->WriteServ("490 %s %s :all members of the channel must be connected via SSL", source->nick, channel->name);
return MODEACTION_DENY;
}
}
@@ -86,7 +86,7 @@ class ModuleSSLModes : public Module
else
{
// Deny
- WriteServ(user->fd, "489 %s %s :Cannot join channel (+z)", user->nick, cname);
+ user->WriteServ( "489 %s %s :Cannot join channel (+z)", user->nick, cname);
return 1;
}
}
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index 7ba046983..88856c1f0 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -105,7 +105,7 @@ class ModuleSWhois : public Module
dest->GetExt("swhois", swhois);
if (swhois)
{
- WriteServ(source->fd,"320 %s %s :%s",source->nick,dest->nick,swhois->c_str());
+ source->WriteServ("320 %s %s :%s",source->nick,dest->nick,swhois->c_str());
}
}
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index fbf220929..b3ecfec06 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -58,14 +58,14 @@ class cmd_tban : public command_t
{
if (!Srv->IsValidMask(parameters[2]))
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Invalid ban mask");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban mask");
return;
}
for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
{
if (!strcasecmp(i->data,parameters[2]))
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0]));
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0]));
return;
}
}
@@ -74,7 +74,7 @@ class cmd_tban : public command_t
unsigned long expire = Srv->CalcDuration(parameters[1]) + time(NULL);
if (Srv->CalcDuration(parameters[1]) < 1)
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Invalid ban time");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time");
return;
}
char duration[MAXBUF];
@@ -102,10 +102,10 @@ class cmd_tban : public command_t
}
return;
}
- else WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, channel->name);
+ else user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, channel->name);
return;
}
- WriteServ(user->fd,"401 %s %s :No such channel",user->nick, parameters[0]);
+ user->WriteServ("401 %s %s :No such channel",user->nick, parameters[0]);
}
};
diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp
index 35f2e023e..6ee4d9176 100644
--- a/src/modules/m_tline.cpp
+++ b/src/modules/m_tline.cpp
@@ -65,9 +65,9 @@ class cmd_tline : public command_t
}
}
if (n_matched)
- WriteServ(user->fd, "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against %0.0f user(s) (%0.2f%% of the userbase). %0.0f by hostname and %0.0f by IP address.",user->nick, n_counted, parameters[0], n_matched, (n_counted/n_matched)*100, n_match_host, n_match_ip);
+ user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against %0.0f user(s) (%0.2f%% of the userbase). %0.0f by hostname and %0.0f by IP address.",user->nick, n_counted, parameters[0], n_matched, (n_counted/n_matched)*100, n_match_host, n_match_ip);
else
- WriteServ(user->fd, "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick, n_counted, parameters[0]);
+ user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick, n_counted, parameters[0]);
}
};
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 3e9c37a3a..bde81011d 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -45,11 +45,11 @@ class cmd_uninvite : public command_t
{
if (!c)
{
- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[1]);
+ user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[1]);
}
else
{
- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
+ user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]);
}
return;
@@ -59,7 +59,7 @@ class cmd_uninvite : public command_t
{
if (cstatus(user,c) < STATUS_HOP)
{
- WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, c->name);
+ user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, c->name);
return;
}
}
@@ -68,18 +68,18 @@ class cmd_uninvite : public command_t
if (!u->IsInvited(xname))
{
- WriteServ(user->fd,"491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name);
+ user->WriteServ("491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name);
return;
}
if (!c->HasUser(user))
{
- WriteServ(user->fd,"492 %s %s :You're not on that channel!",user->nick, c->name);
+ user->WriteServ("492 %s %s :You're not on that channel!",user->nick, c->name);
return;
}
u->RemoveInvite(xname);
- WriteServ(user->fd,"494 %s %s %s :Uninvited",user->nick,c->name,u->nick);
- WriteServ(u->fd,"493 %s :You were uninvited from %s by %s",u->nick,c->name,user->nick);
+ user->WriteServ("494 %s %s %s :Uninvited",user->nick,c->name,u->nick);
+ u->WriteServ("493 %s :You were uninvited from %s by %s",u->nick,c->name,user->nick);
c->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :*** %s uninvited %s.", c->name, user->nick, u->nick);
}
};
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index df633af80..1ad0e1c58 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -49,7 +49,7 @@ class cmd_userip : public command_t
strlcat(Return,junk,MAXBUF);
}
}
- WriteServ(user->fd,Return);
+ user->WriteServ(Return);
}
};
diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp
index a7ce8fd4a..71fadf2f9 100644
--- a/src/modules/m_vhost.cpp
+++ b/src/modules/m_vhost.cpp
@@ -47,13 +47,13 @@ class cmd_vhost : public command_t
{
if (mask != "")
{
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
Srv->ChangeHost(user,mask);
return;
}
}
}
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Invalid username or password.");
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid username or password.");
}
};
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index 9f8c15e07..888827cfa 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -60,11 +60,11 @@ class cmd_watch : public command_t
userrec* targ = Srv->FindNick(a->target);
if (targ)
{
- WriteServ(user->fd,"604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
+ user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
}
}
}
- WriteServ(user->fd,"607 %s :End of WATCH list",user->nick);
+ user->WriteServ("607 %s :End of WATCH list",user->nick);
}
else if (pcnt > 0)
{
@@ -101,11 +101,11 @@ class cmd_watch : public command_t
userrec* targ = Srv->FindNick(a->target);
if (targ)
{
- WriteServ(user->fd,"604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
+ user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
}
}
}
- WriteServ(user->fd,"607 %s :End of WATCH list",user->nick);
+ user->WriteServ("607 %s :End of WATCH list",user->nick);
}
else if (!strcasecmp(nick,"S"))
{
@@ -121,8 +121,8 @@ class cmd_watch : public command_t
char* l = (char*)list.c_str();
if (*l == ' ')
l++;
- WriteServ(user->fd,"606 %s :%s",user->nick,l);
- WriteServ(user->fd,"607 %s :End of WATCH S",user->nick);
+ user->WriteServ("606 %s :%s",user->nick,l);
+ user->WriteServ("607 %s :End of WATCH S",user->nick);
}
else if (nick[0] == '-')
{
@@ -138,11 +138,11 @@ class cmd_watch : public command_t
userrec* a = Srv->FindNick(b->target);
if (a)
{
- WriteServ(user->fd,"602 %s %s %s %s %lu :stopped watching",user->nick,a->nick,a->ident,a->dhost,a->age);
+ user->WriteServ("602 %s %s %s %s %lu :stopped watching",user->nick,a->nick,a->ident,a->dhost,a->age);
}
else
{
- WriteServ(user->fd,"602 %s %s * * 0 :stopped watching",user->nick,b->target.c_str());
+ user->WriteServ("602 %s %s * * 0 :stopped watching",user->nick,b->target.c_str());
}
if (n1 == n2)
{
@@ -182,11 +182,11 @@ class cmd_watch : public command_t
userrec* a = Srv->FindNick(nick);
if (a)
{
- WriteServ(user->fd,"604 %s %s %s %s %lu :is online",user->nick,a->nick,a->ident,a->dhost,a->age);
+ user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,a->nick,a->ident,a->dhost,a->age);
}
else
{
- WriteServ(user->fd,"605 %s %s * * 0 :is offline",user->nick,nick);
+ user->WriteServ("605 %s %s * * 0 :is offline",user->nick,nick);
}
}
}
@@ -224,7 +224,7 @@ class Modulewatch : public Module
if (n1 == n2)
{
log(DEBUG,"*** WATCH: On global quit: user %s is in notify of %s",user->nick,a->watcher->nick);
- WriteServ(a->watcher->fd,"601 %s %s %s %s %lu :went offline",a->watcher->nick,user->nick,user->ident,user->dhost,time(NULL));
+ a->watcher->WriteServ("601 %s %s %s %s %lu :went offline",a->watcher->nick,user->nick,user->ident,user->dhost,time(NULL));
}
}
bool done = false;
@@ -256,7 +256,7 @@ class Modulewatch : public Module
if (n1 == n2)
{
log(DEBUG,"*** WATCH: On global connect: user %s is in notify of %s",user->nick,a->watcher->nick);
- WriteServ(a->watcher->fd,"600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age);
+ a->watcher->WriteServ("600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age);
}
}
}
@@ -274,13 +274,13 @@ class Modulewatch : public Module
if (n1 == n2)
{
log(DEBUG,"*** WATCH: On global nickchange: old nick %s was on notify list of %s",oldnick.c_str(),a->watcher->nick);
- WriteServ(a->watcher->fd,"601 %s %s %s %s %lu :went offline",a->watcher->nick,oldnick.c_str(),user->ident,user->dhost,time(NULL));
+ a->watcher->WriteServ("601 %s %s %s %s %lu :went offline",a->watcher->nick,oldnick.c_str(),user->ident,user->dhost,time(NULL));
}
else if (n1 == n3)
{
// changed from a nick not on notify to one that is
log(DEBUG,"*** WATCH: On global nickchange: new nick %s is on notify list of %s",user->nick,a->watcher->nick);
- WriteServ(a->watcher->fd,"600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age);
+ a->watcher->WriteServ("600 %s %s %s %s %lu :arrived online",a->watcher->nick,user->nick,user->ident,user->dhost,user->age);
}
}
}