summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp12
-rw-r--r--src/modules.cpp92
-rw-r--r--src/modules/m_alias.cpp4
-rw-r--r--src/modules/m_blockamsg.cpp4
-rwxr-xr-xsrc/svn-rev.sh2
5 files changed, 54 insertions, 60 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index a9e3c0110..9157a7f62 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -689,7 +689,7 @@ void ChanExceptSender_NoFormat(chanrec* Ptr, userrec* user, char status, const c
}
}
-std::string& GetServerDescription(char* servername)
+std::string GetServerDescription(char* servername)
{
std::string description = "";
@@ -956,7 +956,6 @@ void WriteCommonExcept_NoFormat(userrec *u, const char* text)
void WriteOpers(char* text, ...)
{
char textbuffer[MAXBUF];
- char formatbuffer[MAXBUF];
va_list argsPtr;
if (!text)
@@ -969,8 +968,6 @@ void WriteOpers(char* text, ...)
vsnprintf(textbuffer, MAXBUF, text, argsPtr);
va_end(argsPtr);
- snprintf(formatbuffer,MAXBUF,"NOTICE %s :%s",a->nick,textbuffer);
-
for (std::vector<userrec*>::iterator i = all_opers.begin(); i != all_opers.end(); i++)
{
userrec* a = *i;
@@ -980,7 +977,7 @@ void WriteOpers(char* text, ...)
if (a->modebits & UM_SERVERNOTICE)
{
// send server notices to all with +s
- WriteServ_NoFormat(a->fd,formatbuffer);
+ WriteServ(a->fd,"NOTICE %s :%s",a->nick,textbuffer);
}
}
}
@@ -1031,7 +1028,6 @@ void ServerPrivmsgAll(char* text, ...)
void WriteMode(const char* modes, int flags, const char* text, ...)
{
char textbuffer[MAXBUF];
- char formatbuffer[MAXBUF];
int modelen;
va_list argsPtr;
@@ -1046,8 +1042,6 @@ void WriteMode(const char* modes, int flags, const char* text, ...)
va_end(argsPtr);
modelen = strlen(modes);
- snprintf(formatbuffer,MAXBUF,"NOTICE %s :%s",t->nick,textbuffer);
-
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
userrec* t = (userrec*)(*i);
@@ -1082,7 +1076,7 @@ void WriteMode(const char* modes, int flags, const char* text, ...)
if (send_to_user)
{
- WriteServ_NoFormat(t->fd,formatbuffer);
+ WriteServ(t->fd,"NOTICE %s :%s",t->nick,textbuffer);
}
}
}
diff --git a/src/modules.cpp b/src/modules.cpp
index 135c0d3e3..7fcca4f79 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -220,84 +220,84 @@ std::string Event::GetEventID()
Module::Module(Server* Me) { }
Module::~Module() { }
void Module::OnUserConnect(userrec* user) { }
-void Module::OnUserQuit(userrec* user, std::string message) { }
+void Module::OnUserQuit(userrec* user, const std::string& message) { }
void Module::OnUserDisconnect(userrec* user) { }
void Module::OnUserJoin(userrec* user, chanrec* channel) { }
-void Module::OnUserPart(userrec* user, chanrec* channel, std::string partmessage) { }
-void Module::OnRehash(std::string parameter) { }
+void Module::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage) { }
+void Module::OnRehash(const std::string &parameter) { }
void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; }
int Module::OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params) { return false; }
-void Module::OnMode(userrec* user, void* dest, int target_type, std::string text) { };
+void Module::OnMode(userrec* user, void* dest, int target_type, const std::string &text) { };
Version Module::GetVersion() { return Version(1,0,0,0,VF_VENDOR); }
-void Module::OnOper(userrec* user, std::string opertype) { };
-void Module::OnPostOper(userrec* user, std::string opertype) { };
+void Module::OnOper(userrec* user, const std::string &opertype) { };
+void Module::OnPostOper(userrec* user, const std::string &opertype) { };
void Module::OnInfo(userrec* user) { };
void Module::OnWhois(userrec* source, userrec* dest) { };
int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0; };
int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status) { return 0; };
-int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; };
-void Module::OnUserPostNick(userrec* user, std::string oldnick) { };
+int Module::OnUserPreNick(userrec* user, const std::string &newnick) { return 0; };
+void Module::OnUserPostNick(userrec* user, const std::string &oldnick) { };
int Module::OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { return ACR_DEFAULT; };
void Module::On005Numeric(std::string &output) { };
-int Module::OnKill(userrec* source, userrec* dest, std::string reason) { return 0; };
-void Module::OnLoadModule(Module* mod,std::string name) { };
-void Module::OnUnloadModule(Module* mod,std::string name) { };
+int Module::OnKill(userrec* source, userrec* dest, const std::string &reason) { return 0; };
+void Module::OnLoadModule(Module* mod,const std::string &name) { };
+void Module::OnUnloadModule(Module* mod,const std::string &name) { };
void Module::OnBackgroundTimer(time_t curtime) { };
void Module::OnSendList(userrec* user, chanrec* channel, char mode) { };
-int Module::OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user, bool validated) { return 0; };
+int Module::OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) { return 0; };
bool Module::OnCheckReady(userrec* user) { return true; };
void Module::OnUserRegister(userrec* user) { };
-int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason) { return 0; };
-void Module::OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason) { };
-int Module::OnRawMode(userrec* user, chanrec* chan, char mode, std::string param, bool adding, int pcnt) { return 0; };
+int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { return 0; };
+void Module::OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { };
+int Module::OnRawMode(userrec* user, chanrec* chan, char mode, const std::string &param, bool adding, int pcnt) { return 0; };
int Module::OnCheckInvite(userrec* user, chanrec* chan) { return 0; };
-int Module::OnCheckKey(userrec* user, chanrec* chan, std::string keygiven) { return 0; };
+int Module::OnCheckKey(userrec* user, chanrec* chan, const std::string &keygiven) { return 0; };
int Module::OnCheckLimit(userrec* user, chanrec* chan) { return 0; };
int Module::OnCheckBan(userrec* user, chanrec* chan) { return 0; };
int Module::OnStats(char symbol, userrec* user) { return 0; };
-int Module::OnChangeLocalUserHost(userrec* user, std::string newhost) { return 0; };
-int Module::OnChangeLocalUserGECOS(userrec* user, std::string newhost) { return 0; };
-int Module::OnLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { return 0; };
+int Module::OnChangeLocalUserHost(userrec* user, const std::string &newhost) { return 0; };
+int Module::OnChangeLocalUserGECOS(userrec* user, const std::string &newhost) { return 0; };
+int Module::OnLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic) { return 0; };
void Module::OnEvent(Event* event) { return; };
char* Module::OnRequest(Request* request) { return NULL; };
-int Module::OnOperCompare(std::string password, std::string input) { return 0; };
+int Module::OnOperCompare(const std::string &password, const std::string &input) { return 0; };
void Module::OnGlobalOper(userrec* user) { };
void Module::OnGlobalConnect(userrec* user) { };
-int Module::OnAddBan(userrec* source, chanrec* channel,std::string banmask) { return 0; };
-int Module::OnDelBan(userrec* source, chanrec* channel,std::string banmask) { return 0; };
-void Module::OnRawSocketAccept(int fd, std::string ip, int localport) { };
+int Module::OnAddBan(userrec* source, chanrec* channel,const std::string &banmask) { return 0; };
+int Module::OnDelBan(userrec* source, chanrec* channel,const std::string &banmask) { return 0; };
+void Module::OnRawSocketAccept(int fd, const std::string &ip, int localport) { };
int Module::OnRawSocketWrite(int fd, char* buffer, int count) { return 0; };
void Module::OnRawSocketClose(int fd) { };
int Module::OnRawSocketRead(int fd, char* buffer, unsigned int count, int &readresult) { return 0; };
-void Module::OnUserMessage(userrec* user, void* dest, int target_type, std::string text, char status) { };
-void Module::OnUserNotice(userrec* user, void* dest, int target_type, std::string text, char status) { };
-void Module::OnRemoteKill(userrec* source, userrec* dest, std::string reason) { };
+void Module::OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status) { };
+void Module::OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status) { };
+void Module::OnRemoteKill(userrec* source, userrec* dest, const std::string &reason) { };
void Module::OnUserInvite(userrec* source,userrec* dest,chanrec* channel) { };
-void Module::OnPostLocalTopicChange(userrec* user, chanrec* chan, std::string topic) { };
-void Module::OnGetServerDescription(std::string servername,std::string &description) { };
+void Module::OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic) { };
+void Module::OnGetServerDescription(const std::string &servername,std::string &description) { };
void Module::OnSyncUser(userrec* user, Module* proto, void* opaque) { };
void Module::OnSyncChannel(chanrec* chan, Module* proto, void* opaque) { };
-void Module::ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline) { };
-void Module::OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname) { };
-void Module::OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname) { };
+void Module::ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline) { };
+void Module::OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, const std::string &extname) { };
+void Module::OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, const std::string &extname) { };
void Module::OnSyncOtherMetaData(Module* proto, void* opaque) { };
-void Module::OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata) { };
-void Module::ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata) { };
-void Module::OnWallops(userrec* user, std::string text) { };
-void Module::OnChangeHost(userrec* user, std::string newhost) { };
-void Module::OnChangeName(userrec* user, std::string gecos) { };
-void Module::OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask) { };
-void Module::OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask) { };
-void Module::OnAddKLine(long duration, userrec* source, std::string reason, std::string hostmask) { };
-void Module::OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask) { };
-void Module::OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask) { };
-void Module::OnDelGLine(userrec* source, std::string hostmask) { };
-void Module::OnDelZLine(userrec* source, std::string ipmask) { };
-void Module::OnDelKLine(userrec* source, std::string hostmask) { };
-void Module::OnDelQLine(userrec* source, std::string nickmask) { };
-void Module::OnDelELine(userrec* source, std::string hostmask) { };
+void Module::OnDecodeMetaData(int target_type, void* target, const std::string &extname, const std::string &extdata) { };
+void Module::ProtoSendMetaData(void* opaque, int target_type, void* target, const std::string &extname, const std::string &extdata) { };
+void Module::OnWallops(userrec* user, const std::string &text) { };
+void Module::OnChangeHost(userrec* user, const std::string &newhost) { };
+void Module::OnChangeName(userrec* user, const std::string &gecos) { };
+void Module::OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
+void Module::OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask) { };
+void Module::OnAddKLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
+void Module::OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask) { };
+void Module::OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask) { };
+void Module::OnDelGLine(userrec* source, const std::string &hostmask) { };
+void Module::OnDelZLine(userrec* source, const std::string &ipmask) { };
+void Module::OnDelKLine(userrec* source, const std::string &hostmask) { };
+void Module::OnDelQLine(userrec* source, const std::string &nickmask) { };
+void Module::OnDelELine(userrec* source, const std::string &hostmask) { };
void Module::OnCleanup(int target_type, void* item) { };
void Module::Implements(char* Implements) { for (int j = 0; j < 255; j++) Implements[j] = 0; };
void Module::OnChannelDelete(chanrec* chan) { };
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index db3d75bae..80b55e0a4 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -87,7 +87,7 @@ class ModuleAlias : public Module
return Version(1,0,0,1,VF_VENDOR);
}
- virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
{
userrec *u = NULL;
irc::string c = command.c_str();
@@ -148,7 +148,7 @@ class ModuleAlias : public Module
return 0;
}
- virtual void OnRehash(std::string parameter)
+ virtual void OnRehash(const std::string &parameter)
{
delete MyConf;
MyConf = new ConfigReader;
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index bb9512754..95dfa40c4 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -70,7 +70,7 @@ public:
return Version(1,0,0,0,VF_VENDOR);
}
- virtual void OnRehash(std::string parameter)
+ virtual void OnRehash(const std::string &parameter)
{
ConfigReader* Conf = new ConfigReader;
@@ -94,7 +94,7 @@ public:
delete Conf;
}
- virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
{
// Don't do anything with unregistered users, or remote ones.
if(!user || (user->registered != 7) || !IS_LOCAL(user))
diff --git a/src/svn-rev.sh b/src/svn-rev.sh
index 972734b6c..17013d1b1 100755
--- a/src/svn-rev.sh
+++ b/src/svn-rev.sh
@@ -1 +1 @@
-echo 3651
+echo 3653