summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
AgeCommit message (Collapse)Author
2020-10-30Update copyright headers.InspIRCd Robot
2020-09-23Refactor GenRandomStr for performance and readability.Sadie Powell
2020-04-24Update copyright headers.InspIRCd Robot
2020-04-21Fixes by misspell-fixerInspIRCd Robot
2020-04-14Update user-facing text and comments of SSL to TLS.Matt Schatz
2020-01-11Update copyright headers.InspIRCd Robot
2019-12-08Improve behaviour when running as root.Peter Powell
- Only give the annoying message about root if --runasroot is not specified. - If --runasroot is specified then assume the user knows what they are doing. - Move CheckRoot to a static function in inspircd.cpp.
2019-07-04DurationString(): Return "0s" for a duration of 0 (#1677).Matt Schatz
Usually a duration of 0 is not allowed or handled separately, but it can also be used as a 'no set time' without separation. Case in point: m_chanhistory calls DurationString() to convert the max time seconds back to a human readable string for the mode serializer. Returning a blank string is bad here.
2019-07-04Fix years being offset from weeks (#1678).Matt Schatz
Currently a duration of 52w will return a blank string. When I added weeks to the calculations, I failed to update the number of seconds to a year. As 365 days and 52 weeks aren't the same, but the calculation needs to be consistent.
2019-02-18Add a function for displaying human-readable durations.Matt Schatz
Add InspIRCd::DurationString() to take a time_t and return a string with the duration in a human-readable format (ex: 1y20w2d3h5m9s).
2018-12-21Only parse valid durations, don't treat invalid multipliers as seconds (#1538)linuxdaemon
2018-11-24Move IsValidDuration into the core.Peter Powell
2018-11-20Add missing special character for reversing color.Robby
2018-11-18Fix single backslashes in the MOTD erroneously being removed.Peter Powell
2018-07-20Use arc4random_buf() instead of random() when available.Peter Powell
2018-07-10Add InspIRCd::IsHost for checking the validity of hostnames.Peter Powell
2018-04-22Improve support for MOTD escape codes.Peter Powell
- Implement escapes for italic, monospace, and strikethrough. - Use the escape codes in the example MOTDs to demonstrate their formatting effects. - Remove support for octal escape codes. In modern computing octal is rarely used and is confusing for users who might confuse it for decimal.
2018-01-03Make InspIRCd::Format return std::string instead of const char*.Peter Powell
Using the latter is problematic as if you don't copy the return value before calling Format again your formatted message will be overwritten by something else. This bug was observed in m_callerid where InspIRCd::Format was being used for formatting two arguments the latter of which was being overwritten with the former. We could have preserved the return type and just copied the string but then callers would have had to deallocate the string once they have finished with it which is an undesirabable burden to put on callers.
2017-12-19Use GetMaxMask in InspIRCd::IsValidMask instead of hardcoding 250.Peter Powell
2017-11-25Convert GenRandom to std::function.Peter Powell
2017-11-25Convert IsChannel to std::function.Peter Powell
2017-11-25Convert IsIdent to std::function.Peter Powell
2017-11-25Convert IsNick to std::function.Peter Powell
2017-11-17Fix a ton of -Wsign-conversion warnings.Peter Powell
2017-10-20Switch the default datetime format to something easier to read.Peter Powell
2017-03-20Move the OnCheckExemption hook out of the core.Peter Powell
2015-12-29Fix InspIRCd::StripColor() stripping characters that shouldn't be strippedAttila Molnar
2015-12-08Strip all control codes except \001 in InspIRCd::StripColor()Attila Molnar
Fixes issue #1100 reported by @uecasm
2015-12-07Deduplicate code in InspIRCd::FindNick()Attila Molnar
2015-05-17Move InspIRCd::SendError() to cmd_dieAttila Molnar
Fix multiple ERROR messages being sent to unregistered users by removing the "Exiting with status..." message
2015-04-28Move OnWhois* events to core_whois, add Whois::ContextAttila Molnar
Remove InspIRCd::SendWhoisLine()
2015-04-28Prepend target user nick to whois numerics in InspIRCd::SendWhoisLine()Attila Molnar
2014-07-19Access local user list via new UserManager::GetLocalUsers() and make ↵Attila Molnar
local_users private
2014-07-19Move and rename typedef LocalUserList to UserManager::LocalListAttila Molnar
2014-06-25Add parameter to InspIRCd::TimeString for UTC time formats.Peter Powell
Missing doc added by @attilamolnar
2014-06-25Add formatting to InspIRCd::TimeString; switch all code to use it.Peter Powell
m_httpd also now uses the correct timestamp format. Windows-specific fixes by @attilamolnar, original PR #849
2014-05-26Switch to std::string::compare() from substr() in a couple of placesAttila Molnar
2014-03-15Change allocation of UserManager::clientlist to be physically part of the ↵Attila Molnar
object containing it
2014-03-14Change allocation of UserManager::uuidlist to be physically part of the ↵Attila Molnar
object containing it
2014-03-14Change allocation of InspIRCd::chanlist to be physically part of the object ↵Attila Molnar
containing it
2014-01-05Move server description field from TreeServer into Server; remove ↵Attila Molnar
OnGetServerDescription hook
2014-01-05Introduce Server classAttila Molnar
- Replaces std::string server in User - Replaces InspIRCd::ULine() and SilentULine()
2013-12-18Clean up CoreExceptionAttila Molnar
- Remove default constructor - Replace virtual functions returning C strings with functions returning const std::string refs
2013-12-18Fix issues discovered by CoverityDaniel Vassdal
- Fix resource leak in InspIRCd::Format() - Explicitly set NewServices to NULL before the object it points to goes out of scope
2013-11-12Use WriteNumeric() everywhere we send numerics and include the user's nick ↵Adam
automatically
2013-09-11Move prefix mode specific fields and getters into PrefixModeattilamolnar
Add ModeHandler::IsPrefixMode()
2013-08-30Merge insp20attilamolnar
2013-08-27Fix crash caused by passing a large integer to ctime()attilamolnar
In addition to verifying the return value of localtime(), correct tm_year if it is out of bounds Reported by @JDowny
2013-08-04Change the syntax of FOREACH macros to be less dumb.Adam
2013-07-04Remove $Core and $Mod* comments apart from $ModDep.Peter Powell