diff options
| author | 2021-06-19 20:07:35 +0100 | |
|---|---|---|
| committer | 2021-06-19 20:07:35 +0100 | |
| commit | dce2d6a2557b5ea3f2b14fc3c89be3e3f4cfcd1a (patch) | |
| tree | 851650b1febce2028970e01492779eee9d12a4a2 /src | |
| parent | Merge branch 'insp3' into master. (diff) | |
| parent | Fix building the sha256 module on Haiku. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/m_hidechans.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_sha2.cpp | 14 | ||||
| -rw-r--r-- | src/modules/m_timedbans.cpp | 14 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index 89495b65e..ef626b9ae 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -64,7 +64,7 @@ class ModuleHideChans : public Module, public Whois::LineEventListener return MOD_RES_PASSTHRU; /* don't touch anything except 319 */ - if (numeric.GetNumeric() != 319) + if (numeric.GetNumeric() != RPL_WHOISCHANNELS) return MOD_RES_PASSTHRU; /* don't touch if -I */ diff --git a/src/modules/m_sha2.cpp b/src/modules/m_sha2.cpp index 72a6d5530..47d5bd340 100644 --- a/src/modules/m_sha2.cpp +++ b/src/modules/m_sha2.cpp @@ -26,11 +26,21 @@ /// $CompilerFlags: -isystem vendor_directory("sha2") -#include "inspircd.h" -#include "modules/hash.h" +// Fix a collision between the Haiku uint64 typedef and the +// one from the sha2 library. +#ifdef __HAIKU__ +# define uint64 sha2_uint64 +#endif #include <sha2.c> +#ifdef __HAIKU__ +# undef uint64 +#endif + +#include "inspircd.h" +#include "modules/hash.h" + template<void (*SHA)(const unsigned char*, unsigned int, unsigned char*)> class HashSHA2 : public HashProvider { diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 4d3f36717..ef20485a5 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -116,7 +116,8 @@ class CommandTban : public Command } Modes::ChangeList setban; - setban.push_add(ServerInstance->Modes.FindMode('b', MODETYPE_CHANNEL), mask); + setban.push_add(*banmode, mask); + // Pass the user (instead of ServerInstance->FakeClient) to ModeHandler::Process() to // make it so that the user sets the mode themselves ServerInstance->Modes.Process(user, channel, NULL, setban); @@ -126,6 +127,17 @@ class CommandTban : public Command return CmdResult::FAILURE; } + // Attempt to find the actual set ban mask. + for (const auto& mc : ServerInstance->Modes.GetLastChangeList().getlist()) + { + if (mc.mh == *banmode) + { + // We found the actual mask. + mask = mc.param; + break; + } + } + T.mask = mask; T.setter = user->nick; T.expire = expire + (IS_REMOTE(user) ? 5 : 0); |
