aboutsummaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bunch of weird indentation and spacing issues.Gravatar Sadie Powell2021-04-271-1/+1
|
* Fix a bunch of really obvious unnecessary includes.Gravatar Sadie Powell2021-03-051-2/+0
|
* Update copyright headers.Gravatar InspIRCd Robot2021-03-051-1/+1
|
* Update copyright headers.Gravatar InspIRCd Robot2020-10-301-1/+1
|
* Refactor GenRandomStr for performance and readability.Gravatar Sadie Powell2020-09-231-8/+6
|
* Update copyright headers.Gravatar InspIRCd Robot2020-04-241-1/+1
|
* Fixes by misspell-fixerGravatar InspIRCd Robot2020-04-211-1/+1
|
* Update user-facing text and comments of SSL to TLS.Gravatar Matt Schatz2020-04-141-1/+1
|
* Update copyright headers.Gravatar InspIRCd Robot2020-01-111-5/+10
|
* Improve behaviour when running as root.Gravatar Peter Powell2019-12-081-12/+0
| | | | | | | | - 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.
* DurationString(): Return "0s" for a duration of 0 (#1677).Gravatar Matt Schatz2019-07-041-0/+3
| | | | | | | | | 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.
* Fix years being offset from weeks (#1678).Gravatar Matt Schatz2019-07-041-1/+1
| | | | | | 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.
* Add a function for displaying human-readable durations.Gravatar Matt Schatz2019-02-181-0/+28
| | | | | Add InspIRCd::DurationString() to take a time_t and return a string with the duration in a human-readable format (ex: 1y20w2d3h5m9s).
* Only parse valid durations, don't treat invalid multipliers as seconds (#1538)Gravatar linuxdaemon2018-12-211-39/+38
|
* Move IsValidDuration into the core.Gravatar Peter Powell2018-11-241-2/+40
|
* Add missing special character for reversing color.Gravatar Robby2018-11-201-0/+1
|
* Fix single backslashes in the MOTD erroneously being removed.Gravatar Peter Powell2018-11-181-1/+1
|
* Use arc4random_buf() instead of random() when available.Gravatar Peter Powell2018-07-201-3/+7
|
* Add InspIRCd::IsHost for checking the validity of hostnames.Gravatar Peter Powell2018-07-101-0/+59
|
* Improve support for MOTD escape codes.Gravatar Peter Powell2018-04-221-13/+14
| | | | | | | | | - 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.
* Make InspIRCd::Format return std::string instead of const char*.Gravatar Peter Powell2018-01-031-4/+4
| | | | | | | | | | | | | 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.
* Use GetMaxMask in InspIRCd::IsValidMask instead of hardcoding 250.Gravatar Peter Powell2017-12-191-1/+1
|
* Convert GenRandom to std::function.Gravatar Peter Powell2017-11-251-1/+1
|
* Convert IsChannel to std::function.Gravatar Peter Powell2017-11-251-1/+1
|
* Convert IsIdent to std::function.Gravatar Peter Powell2017-11-251-1/+1
|
* Convert IsNick to std::function.Gravatar Peter Powell2017-11-251-1/+1
|
* Fix a ton of -Wsign-conversion warnings.Gravatar Peter Powell2017-11-171-2/+2
|
* Switch the default datetime format to something easier to read.Gravatar Peter Powell2017-10-201-1/+1
|
* Move the OnCheckExemption hook out of the core.Gravatar Peter Powell2017-03-201-25/+0
|
* Fix InspIRCd::StripColor() stripping characters that shouldn't be strippedGravatar Attila Molnar2015-12-291-1/+1
|
* Strip all control codes except \001 in InspIRCd::StripColor()Gravatar Attila Molnar2015-12-081-1/+2
| | | | Fixes issue #1100 reported by @uecasm
* Deduplicate code in InspIRCd::FindNick()Gravatar Attila Molnar2015-12-071-8/+1
|
* Move InspIRCd::SendError() to cmd_dieGravatar Attila Molnar2015-05-171-19/+0
| | | | Fix multiple ERROR messages being sent to unregistered users by removing the "Exiting with status..." message
* Move OnWhois* events to core_whois, add Whois::ContextGravatar Attila Molnar2015-04-281-20/+0
| | | | Remove InspIRCd::SendWhoisLine()
* Prepend target user nick to whois numerics in InspIRCd::SendWhoisLine()Gravatar Attila Molnar2015-04-281-1/+3
|
* Access local user list via new UserManager::GetLocalUsers() and make ↵Gravatar Attila Molnar2014-07-191-1/+2
| | | | local_users private
* Move and rename typedef LocalUserList to UserManager::LocalListGravatar Attila Molnar2014-07-191-1/+1
|
* Add parameter to InspIRCd::TimeString for UTC time formats.Gravatar Peter Powell2014-06-251-2/+2
| | | | Missing doc added by @attilamolnar
* Add formatting to InspIRCd::TimeString; switch all code to use it.Gravatar Peter Powell2014-06-251-2/+10
| | | | | | m_httpd also now uses the correct timestamp format. Windows-specific fixes by @attilamolnar, original PR #849
* Switch to std::string::compare() from substr() in a couple of placesGravatar Attila Molnar2014-05-261-1/+1
|
* Change allocation of UserManager::clientlist to be physically part of the ↵Gravatar Attila Molnar2014-03-151-4/+4
| | | | object containing it
* Change allocation of UserManager::uuidlist to be physically part of the ↵Gravatar Attila Molnar2014-03-141-2/+2
| | | | object containing it
* Change allocation of InspIRCd::chanlist to be physically part of the object ↵Gravatar Attila Molnar2014-03-141-2/+2
| | | | containing it
* Move server description field from TreeServer into Server; remove ↵Gravatar Attila Molnar2014-01-051-17/+0
| | | | OnGetServerDescription hook
* Introduce Server classGravatar Attila Molnar2014-01-051-17/+0
| | | | | - Replaces std::string server in User - Replaces InspIRCd::ULine() and SilentULine()
* Clean up CoreExceptionGravatar Attila Molnar2013-12-181-2/+2
| | | | | - Remove default constructor - Replace virtual functions returning C strings with functions returning const std::string refs
* Fix issues discovered by CoverityGravatar Daniel Vassdal2013-12-181-0/+2
| | | | | - Fix resource leak in InspIRCd::Format() - Explicitly set NewServices to NULL before the object it points to goes out of scope
* Use WriteNumeric() everywhere we send numerics and include the user's nick ↵Gravatar Adam2013-11-121-1/+1
| | | | automatically
* Move prefix mode specific fields and getters into PrefixModeGravatar attilamolnar2013-09-111-1/+1
| | | | Add ModeHandler::IsPrefixMode()
* Merge insp20Gravatar attilamolnar2013-08-301-1/+20
|\