From 02830985a18950497003f3392cf8d6cc30c15c50 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 5 Oct 2013 04:55:11 +0100 Subject: Move stuff around a bit: - Create FileSystem class: * Move ServerConfig::CleanFilename to FileSystem::GetFileName and rewrite. * Move ServerConfig::ExpandPath to FileSystem. * Move ServerConfig::FileExists to FileSystem. * Move ServerConfig::StartsWithWindowsDriveLetter to FileSystem. - Move FileReader to fileutils.cpp and fix documentation. - Move UserManager::DoBackgroundUserStuff to usermanager.cpp. --- include/configreader.h | 30 +++-------------- include/fileutils.h | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/inspircd.h | 1 + include/modules.h | 38 ---------------------- 4 files changed, 92 insertions(+), 64 deletions(-) create mode 100644 include/fileutils.h (limited to 'include') diff --git a/include/configreader.h b/include/configreader.h index 0fbf234c3..a46f9cf95 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -225,10 +225,10 @@ class CoreExport ServerConfig , Log(LOG_PATH) , Module(MOD_PATH) { } - std::string PrependConfig(const std::string& fn) const { return ServerConfig::ExpandPath(Config, fn); } - std::string PrependData(const std::string& fn) const { return ServerConfig::ExpandPath(Data, fn); } - std::string PrependLog(const std::string& fn) const { return ServerConfig::ExpandPath(Log, fn); } - std::string PrependModule(const std::string& fn) const { return ServerConfig::ExpandPath(Module, fn); } + std::string PrependConfig(const std::string& fn) const { return FileSystem::ExpandPath(Config, fn); } + std::string PrependData(const std::string& fn) const { return FileSystem::ExpandPath(Data, fn); } + std::string PrependLog(const std::string& fn) const { return FileSystem::ExpandPath(Log, fn); } + std::string PrependModule(const std::string& fn) const { return FileSystem::ExpandPath(Module, fn); } }; /** Get a configuration tag @@ -551,30 +551,8 @@ class CoreExport ServerConfig void Fill(); - /** Returns true if the given string starts with a windows drive letter - */ - static bool StartsWithWindowsDriveLetter(const std::string& path); - bool ApplyDisabledCommands(const std::string& data); - /** Clean a filename, stripping the directories (and drives) from string. - * @param name Directory to tidy - * @return The cleaned filename - */ - static const char* CleanFilename(const char* name); - - /** Check if a file exists. - * @param file The full path to a file - * @return True if the file exists and is readable. - */ - static bool FileExists(const char* file); - - /** Expands a path fragment to a full path. - * @param base The base path to expand from - * @param fragment The path fragment to expand on top of base. - */ - static std::string ExpandPath(const std::string& base, const std::string& fragment); - /** Escapes a value for storage in a configuration key. * @param str The string to escape. * @param xml Are we using the XML config format? diff --git a/include/fileutils.h b/include/fileutils.h new file mode 100644 index 000000000..45865bbb0 --- /dev/null +++ b/include/fileutils.h @@ -0,0 +1,87 @@ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2013 Peter Powell + * + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#pragma once + +/** Provides an easy method of reading a text file into memory. */ +class CoreExport FileReader : public classbase +{ + /** The lines of text in the file. */ + std::vector lines; + + /** File size in bytes. */ + unsigned long totalSize; + + public: + /** Initializes a new file reader. */ + FileReader() : totalSize(0) { } + + /** Initializes a new file reader and reads the specified file. + * @param filename The file to read into memory. + */ + FileReader(const std::string& filename); + + /** Loads a text file from disk. + * @param filename The file to read into memory. + * @throw CoreException The file can not be loaded. + */ + void Load(const std::string& filename); + + /** Retrieves the entire contents of the file cache as a single string. */ + std::string GetString() const; + + /** Retrieves the entire contents of the file cache as a vector of strings. */ + const std::vector& GetVector() const { return lines; } + + /** Retrieves the total size in bytes of the file. */ + unsigned long TotalSize() const { return totalSize; } +}; + +/** Implements methods for file system access */ +class CoreExport FileSystem +{ +private: + FileSystem() { } + +public: + /** Expands a path fragment to a full path. + * @param base The base path to expand from + * @param fragment The path fragment to expand on top of base. + */ + static std::string ExpandPath(const std::string& base, const std::string& fragment); + + /** + * Checks whether a file with the specified name exists on the filesystem. + * @param path The path to a file. + * @return True if the file exists; otherwise, false. + */ + static bool FileExists(const std::string& path); + + /** Gets the file name segment of a path. + * @param path The path to extract the file name from. + * @return The file name segment of a path. + */ + static std::string GetFileName(const std::string& path); + + /** Determines whether the given path starts with a Windows drive letter. + * @param path The path to validate. + * @returns True if the path begins with a Windows drive letter; otherwise, false. + */ + static bool StartsWithWindowsDriveLetter(const std::string& path); +}; diff --git a/include/inspircd.h b/include/inspircd.h index f43141c38..e02a5deb5 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -54,6 +54,7 @@ CoreExport extern InspIRCd* ServerInstance; #include "caller.h" #include "cull_list.h" #include "extensible.h" +#include "fileutils.h" #include "numerics.h" #include "uid.h" #include "users.h" diff --git a/include/modules.h b/include/modules.h index 931d85032..b7cffd1a0 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1078,44 +1078,6 @@ class CoreExport Module : public classbase, public usecountbase virtual void OnSetUserIP(LocalUser* user); }; -/** Provides an easy method of reading a text file into memory. */ -class CoreExport FileReader : public classbase -{ - /** The lines of text in the file. - */ - std::vector lines; - - /** Content size in bytes - */ - unsigned long totalSize; - - public: - /** Initializes a new file reader. - */ - FileReader() : totalSize(0) { } - - /** Initializes a new file reader and reads the specified file. - * @param filename The file to read into memory. - */ - FileReader(const std::string& filename); - - /** Loads a text file from disk. - * @param filename The file to read into memory. - * @throw CoreException The file can not be loaded. - */ - void Load(const std::string& filename); - - /** Retrieves the entire contents of the file cache as a single string. - */ - std::string GetString(); - - /** Retrieves the entire contents of the file cache as a vector of strings. - */ - const std::vector& GetVector() { return lines; } - - unsigned long TotalSize() { return totalSize; } -}; - /** A list of modules */ typedef std::vector IntModuleList; -- cgit v1.2.3 From 07d0d8f52f361c64b3c16d7e432f475cd2131a28 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 24 Nov 2013 15:05:12 +0000 Subject: Remove some pointless code: - Remove the CHARSET entry from ISUPPORT. CHARSET was removed in draft-brocklesby-irc-isupport-03 and we always used the default value anyway. This has also been removed in the latest version of Charybdis. - Remove irc::sockets::satouser. This helper method was longer than the code it replaced. --- include/socket.h | 7 ------- src/listensocket.cpp | 2 +- src/modules/m_check.cpp | 4 ++-- src/modules/m_httpd_stats.cpp | 2 +- src/server.cpp | 1 - 5 files changed, 4 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/socket.h b/include/socket.h index 3abbeef32..c54517a76 100644 --- a/include/socket.h +++ b/include/socket.h @@ -124,13 +124,6 @@ namespace irc * @return true if the conversion was successful, false if unknown address family */ CoreExport bool satoap(const irc::sockets::sockaddrs& sa, std::string& addr, int &port); - - /** Convert a binary sockaddr to a user-readable string. - * This means IPv6 addresses are written as [::1]:6667, and *:6668 is used for 0.0.0.0:6668 - * @param sa The structure to convert - * @return The string; "" if not a valid address - */ - inline std::string satouser(const irc::sockets::sockaddrs& sa) { return sa.str(); } } } diff --git a/src/listensocket.cpp b/src/listensocket.cpp index ca518c59e..108466ae3 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -30,7 +30,7 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t : bind_tag(tag) { irc::sockets::satoap(bind_to, bind_addr, bind_port); - bind_desc = irc::sockets::satouser(bind_to); + bind_desc = bind_to.str(); fd = socket(bind_to.sa.sa_family, SOCK_STREAM, 0); diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 5e154feea..84e147f7b 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -180,8 +180,8 @@ class CommandCheck : public Command if (loctarg) { - user->SendText(checkstr + " clientaddr " + irc::sockets::satouser(loctarg->client_sa)); - user->SendText(checkstr + " serveraddr " + irc::sockets::satouser(loctarg->server_sa)); + user->SendText(checkstr + " clientaddr " + loctarg->client_sa.str()); + user->SendText(checkstr + " serveraddr " + loctarg->server_sa.str()); std::string classname = loctarg->GetClass()->name; if (!classname.empty()) diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 5114b26d5..346fe41f5 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -197,7 +197,7 @@ class ModuleHttpStats : public Module LocalUser* lu = IS_LOCAL(u); if (lu) data << "" << lu->GetServerPort() << "" - << irc::sockets::satouser(lu->server_sa) << ""; + << lu->server_sa.str() << ""; data << "" << u->GetIPString() << ""; DumpMeta(data, u); diff --git a/src/server.cpp b/src/server.cpp index 4974b8501..1d1f52641 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -172,7 +172,6 @@ void ISupportManager::Build() tokens["CHANMODES"] = ServerInstance->Modes->GiveModeList(MASK_CHANNEL); tokens["CHANNELLEN"] = ConvToStr(ServerInstance->Config->Limits.ChanMax); tokens["CHANTYPES"] = "#"; - tokens["CHARSET"] = "ascii"; tokens["ELIST"] = "MU"; tokens["KICKLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxKick); tokens["MAXBANS"] = "64"; // TODO: make this a config setting. -- cgit v1.2.3 From ad47ea662698e72ff8f79b03512b1e7fe81bdf53 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 15 Dec 2013 05:34:00 +0000 Subject: Make various self contained methods static. - InspIRCd::IsValidMask - InspIRCd::TimeString --- include/inspircd.h | 4 ++-- src/channels.cpp | 2 +- src/commands/cmd_eline.cpp | 2 +- src/commands/cmd_gline.cpp | 2 +- src/commands/cmd_kline.cpp | 2 +- src/commands/cmd_qline.cpp | 2 +- src/commands/cmd_whowas.cpp | 2 +- src/commands/cmd_zline.cpp | 2 +- src/modules/m_cban.cpp | 2 +- src/modules/m_connectban.cpp | 2 +- src/modules/m_dccallow.cpp | 2 +- src/modules/m_dnsbl.cpp | 6 +++--- src/modules/m_rline.cpp | 4 ++-- src/modules/m_shun.cpp | 2 +- src/modules/m_spanningtree/addline.cpp | 2 +- src/modules/m_svshold.cpp | 2 +- src/modules/m_timedbans.cpp | 2 +- 17 files changed, 21 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/inspircd.h b/include/inspircd.h index e02a5deb5..d045b347b 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -565,7 +565,7 @@ class CoreExport InspIRCd * @param mask A nick!user\@host masak to match against * @return True i the mask is valid */ - bool IsValidMask(const std::string &mask); + static bool IsValidMask(const std::string& mask); /** Strips all color codes from the given string * @param sentence The string to strip from @@ -685,7 +685,7 @@ class CoreExport InspIRCd /** Return a time_t as a human-readable string. */ - std::string TimeString(time_t curtime); + static std::string TimeString(time_t curtime); /** Begin execution of the server. * NOTE: this function NEVER returns. Internally, diff --git a/src/channels.cpp b/src/channels.cpp index 4e266fb7c..563bc2704 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -849,7 +849,7 @@ Invitation* Invitation::Find(Channel* c, LocalUser* u, bool check_expired) if ((check_expired) && (inv->expiry != 0) && (inv->expiry <= ServerInstance->Time())) { /* Expired invite, remove it. */ - std::string expiration = ServerInstance->TimeString(inv->expiry); + std::string expiration = InspIRCd::TimeString(inv->expiry); ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Find ecountered expired entry: %p expired %s", (void*) inv, expiration.c_str()); i = locallist.erase(i); inv->cull(); diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index 67f67e9f0..8025ba15a 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -80,7 +80,7 @@ CmdResult CommandEline::Handle (const std::vector& parameters, User else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(), timestr.c_str(), parameters[2].c_str()); } diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index bdb5c26b2..bc81172d3 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -87,7 +87,7 @@ CmdResult CommandGline::Handle (const std::vector& parameters, User else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(), timestr.c_str(), parameters[2].c_str()); } diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index 20afae2a9..e95a7ca66 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -87,7 +87,7 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x',"%s added timed K-line for %s, expires on %s: %s",user->nick.c_str(),target.c_str(), timestr.c_str(), parameters[2].c_str()); } diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp index bfc9e4519..06b0e74f1 100644 --- a/src/commands/cmd_qline.cpp +++ b/src/commands/cmd_qline.cpp @@ -63,7 +63,7 @@ CmdResult CommandQline::Handle (const std::vector& parameters, User else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires on %s: %s",user->nick.c_str(),parameters[0].c_str(), timestr.c_str(), parameters[2].c_str()); } diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index bdd16b520..fab65aae3 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -62,7 +62,7 @@ CmdResult CommandWhowas::Handle (const std::vector& parameters, Use user->WriteNumeric(RPL_WHOWASIP, "%s :was connecting from *@%s", parameters[0].c_str(), u->host.c_str()); - std::string signon = ServerInstance->TimeString(u->signon); + std::string signon = InspIRCd::TimeString(u->signon); bool hide_server = (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex")); user->WriteNumeric(RPL_WHOISSERVER, "%s %s :%s", parameters[0].c_str(), (hide_server ? ServerInstance->Config->HideWhoisServer.c_str() : u->server.c_str()), signon.c_str()); } diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index fdb156e0a..2c5997558 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -83,7 +83,7 @@ CmdResult CommandZline::Handle (const std::vector& parameters, User else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Z-line for %s, expires on %s: %s",user->nick.c_str(),ipaddr, timestr.c_str(), parameters[2].c_str()); } diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 5f3f1c7f1..4fb0653a9 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -121,7 +121,7 @@ class CommandCBan : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), reason); } } diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 39639927c..0b61ec668 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -80,7 +80,7 @@ class ModuleConnectBan : public Module } ServerInstance->XLines->ApplyLines(); std::string maskstr = mask.str(); - std::string timestr = ServerInstance->TimeString(zl->expiry); + std::string timestr = InspIRCd::TimeString(zl->expiry); ServerInstance->SNO->WriteGlobalSno('x',"Module m_connectban added Z:line on *@%s to expire on %s: Connect flooding", maskstr.c_str(), timestr.c_str()); ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", maskstr.c_str(), threshold); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index e5c8df6aa..487e4a7ed 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -168,7 +168,7 @@ class CommandDccallow : public Command length = InspIRCd::Duration(parameters[1]); } - if (!ServerInstance->IsValidMask(mask)) + if (!InspIRCd::IsValidMask(mask)) { return CMD_FAILURE; } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index fa9e73bd4..48ce1d791 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -136,7 +136,7 @@ class DNSBLResolver : public DNS::Request "*", them->GetIPString()); if (ServerInstance->XLines->AddLine(kl,NULL)) { - std::string timestr = ServerInstance->TimeString(kl->expiry); + std::string timestr = InspIRCd::TimeString(kl->expiry); ServerInstance->SNO->WriteGlobalSno('x',"K:line added due to DNSBL match on *@%s to expire on %s: %s", them->GetIPString().c_str(), timestr.c_str(), reason.c_str()); ServerInstance->XLines->ApplyLines(); @@ -151,7 +151,7 @@ class DNSBLResolver : public DNS::Request "*", them->GetIPString()); if (ServerInstance->XLines->AddLine(gl,NULL)) { - std::string timestr = ServerInstance->TimeString(gl->expiry); + std::string timestr = InspIRCd::TimeString(gl->expiry); ServerInstance->SNO->WriteGlobalSno('x',"G:line added due to DNSBL match on *@%s to expire on %s: %s", them->GetIPString().c_str(), timestr.c_str(), reason.c_str()); ServerInstance->XLines->ApplyLines(); @@ -166,7 +166,7 @@ class DNSBLResolver : public DNS::Request them->GetIPString()); if (ServerInstance->XLines->AddLine(zl,NULL)) { - std::string timestr = ServerInstance->TimeString(zl->expiry); + std::string timestr = InspIRCd::TimeString(zl->expiry); ServerInstance->SNO->WriteGlobalSno('x',"Z:line added due to DNSBL match on *@%s to expire on %s: %s", them->GetIPString().c_str(), timestr.c_str(), reason.c_str()); ServerInstance->XLines->ApplyLines(); diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index 0bfdc3565..35f88ea93 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -78,7 +78,7 @@ class RLine : public XLine ZLine* zl = new ZLine(ServerInstance->Time(), duration ? expiry - ServerInstance->Time() : 0, ServerInstance->Config->ServerName.c_str(), reason.c_str(), u->GetIPString()); if (ServerInstance->XLines->AddLine(zl, NULL)) { - std::string timestr = ServerInstance->TimeString(zl->expiry); + std::string timestr = InspIRCd::TimeString(zl->expiry); ServerInstance->SNO->WriteToSnoMask('x', "Z-line added due to R-line match on *@%s%s%s: %s", zl->ipaddr.c_str(), zl->duration ? " to expire on " : "", zl->duration ? timestr.c_str() : "", zl->reason.c_str()); added_zline = true; @@ -168,7 +168,7 @@ class CommandRLine : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x', "%s added timed R-line for %s to expire on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), parameters[2].c_str()); } diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index f0524435b..075b80eb7 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -140,7 +140,7 @@ class CommandShun : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x', "%s added timed SHUN for %s to expire on %s: %s", user->nick.c_str(), target.c_str(), timestr.c_str(), expr.c_str()); } diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index d06317674..f4485030a 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -50,7 +50,7 @@ CmdResult CommandAddLine::Handle(User* usr, std::vector& params) { if (xl->duration) { - std::string timestr = ServerInstance->TimeString(xl->expiry); + std::string timestr = InspIRCd::TimeString(xl->expiry); ServerInstance->SNO->WriteToSnoMask('X',"%s added %s%s on %s to expire on %s: %s",setter.c_str(),params[0].c_str(),params[0].length() == 1 ? "-line" : "", params[1].c_str(), timestr.c_str(), params[5].c_str()); } diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 7d40f0cc0..bb2fcdbc0 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -123,7 +123,7 @@ class CommandSvshold : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteGlobalSno('x', "%s added timed SVSHOLD for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), parameters[2].c_str()); } } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 2441f1aa8..40cc162c1 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -75,7 +75,7 @@ class CommandTban : public Command setban.push_back(parameters[0]); setban.push_back("+b"); bool isextban = ((mask.size() > 2) && (mask[1] == ':')); - if (!isextban && !ServerInstance->IsValidMask(mask)) + if (!isextban && !InspIRCd::IsValidMask(mask)) mask.append("!*@*"); setban.push_back(mask); -- cgit v1.2.3